mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
parent
7ec70c61d7
commit
11f2ce7d3b
@ -17,7 +17,7 @@
|
|||||||
import { Map, Set } from '@isomorphic/builtins';
|
import { Map, Set } from '@isomorphic/builtins';
|
||||||
import { escapeRegExp, longestCommonSubstring, normalizeWhiteSpace } from '@isomorphic/stringUtils';
|
import { escapeRegExp, longestCommonSubstring, normalizeWhiteSpace } from '@isomorphic/stringUtils';
|
||||||
|
|
||||||
import { getElementComputedStyle, getGlobalOptions, isElementVisible } from './domUtils';
|
import { getElementComputedStyle, getGlobalOptions } from './domUtils';
|
||||||
import * as roleUtils from './roleUtils';
|
import * as roleUtils from './roleUtils';
|
||||||
import { yamlEscapeKeyIfNeeded, yamlEscapeValueIfNeeded } from './yaml';
|
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);
|
addElement(element);
|
||||||
const childAriaNode = toAriaNode(element, options);
|
const childAriaNode = toAriaNode(element, options);
|
||||||
if (childAriaNode)
|
if (childAriaNode)
|
||||||
|
@ -68,6 +68,7 @@ test.describe(() => {
|
|||||||
await recorder.trustedClick();
|
await recorder.trustedClick();
|
||||||
await recorder.recorderPage.getByRole('tab', { name: 'Aria' }).click();
|
await recorder.recorderPage.getByRole('tab', { name: 'Aria' }).click();
|
||||||
await expect(recorder.recorderPage.locator('.tab-aria .CodeMirror')).toMatchAriaSnapshot(`
|
await expect(recorder.recorderPage.locator('.tab-aria .CodeMirror')).toMatchAriaSnapshot(`
|
||||||
|
- textbox
|
||||||
- text: '- button "Submit"'
|
- text: '- button "Submit"'
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
@ -731,18 +731,6 @@ it('ref mode can be used to stitch all frame snapshots', async ({ page, server }
|
|||||||
`.trim());
|
`.trim());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not include hidden input elements', async ({ page }) => {
|
|
||||||
await page.setContent(`
|
|
||||||
<button>One</button>
|
|
||||||
<button style="width: 0; height: 0; appearance: none; border: 0; padding: 0;">Two</button>
|
|
||||||
<button>Three</button>
|
|
||||||
`);
|
|
||||||
|
|
||||||
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 }) => {
|
it('emit generic roles for nodes w/o roles', async ({ page }) => {
|
||||||
await page.setContent(`
|
await page.setContent(`
|
||||||
<style>
|
<style>
|
||||||
@ -754,21 +742,12 @@ it('emit generic roles for nodes w/o roles', async ({ page }) => {
|
|||||||
</style>
|
</style>
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
<span>
|
|
||||||
<input type="radio" value="Apple" checked="">
|
|
||||||
</span>
|
|
||||||
<span>Apple</span>
|
<span>Apple</span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<span>
|
|
||||||
<input type="radio" value="Pear">
|
|
||||||
</span>
|
|
||||||
<span>Pear</span>
|
<span>Pear</span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<span>
|
|
||||||
<input type="radio" value="Orange">
|
|
||||||
</span>
|
|
||||||
<span>Orange</span>
|
<span>Orange</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user