diff --git a/packages/injected/src/ariaSnapshot.ts b/packages/injected/src/ariaSnapshot.ts index 17de28ecbf..9c87d38fc1 100644 --- a/packages/injected/src/ariaSnapshot.ts +++ b/packages/injected/src/ariaSnapshot.ts @@ -17,7 +17,7 @@ import { Map, Set } from '@isomorphic/builtins'; import { escapeRegExp, longestCommonSubstring, normalizeWhiteSpace } from '@isomorphic/stringUtils'; -import { getElementComputedStyle, getGlobalOptions, isElementVisible } from './domUtils'; +import { getElementComputedStyle, getGlobalOptions } from './domUtils'; import * as roleUtils from './roleUtils'; import { yamlEscapeKeyIfNeeded, yamlEscapeValueIfNeeded } from './yaml'; @@ -86,10 +86,6 @@ export function generateAriaTree(rootElement: Element, generation: number, optio } } - // Skip all the leaf nodes that are not visible as they can't be interacted with. - if (!ariaChildren.length && !isElementVisible(element)) - return; - addElement(element); const childAriaNode = toAriaNode(element, options); if (childAriaNode) diff --git a/tests/library/inspector/cli-codegen-aria.spec.ts b/tests/library/inspector/cli-codegen-aria.spec.ts index 9a81f25f73..a11cf33342 100644 --- a/tests/library/inspector/cli-codegen-aria.spec.ts +++ b/tests/library/inspector/cli-codegen-aria.spec.ts @@ -68,6 +68,7 @@ test.describe(() => { await recorder.trustedClick(); await recorder.recorderPage.getByRole('tab', { name: 'Aria' }).click(); await expect(recorder.recorderPage.locator('.tab-aria .CodeMirror')).toMatchAriaSnapshot(` + - textbox - text: '- button "Submit"' `); }); diff --git a/tests/page/page-aria-snapshot.spec.ts b/tests/page/page-aria-snapshot.spec.ts index c52dd68df1..809d419eec 100644 --- a/tests/page/page-aria-snapshot.spec.ts +++ b/tests/page/page-aria-snapshot.spec.ts @@ -731,18 +731,6 @@ it('ref mode can be used to stitch all frame snapshots', async ({ page, server } `.trim()); }); -it('should not include hidden input elements', async ({ page }) => { - await page.setContent(` - - - - `); - - const snapshot = await page.locator('body').ariaSnapshot(); - expect(snapshot).toContain(`- button \"One\" -- button \"Three\"`); -}); - it('emit generic roles for nodes w/o roles', async ({ page }) => { await page.setContent(`