fix: specify the context id when adding bindings (#10366)

This commit is contained in:
Alex Rudenko
2023-06-13 10:17:48 +02:00
committed by GitHub
parent 903afc3715
commit c2d3488ad8
3 changed files with 44 additions and 4 deletions

View File

@@ -803,6 +803,12 @@
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work for ARIA selectors in multiple isolated worlds",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work with :hover",
"platforms": ["darwin", "linux", "win32"],
@@ -2429,6 +2435,12 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work for ARIA selectors in multiple isolated worlds",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[requestinterception-experimental.spec] request interception \"after each\" hook in \"request interception\"",
"platforms": ["win32"],

View File

@@ -446,6 +446,26 @@ describe('Query handler tests', function () {
).toBeTruthy();
});
it('should work for ARIA selectors in multiple isolated worlds', async () => {
const {page} = getTestState();
let element = await page.waitForSelector('::-p-aria(world)');
assert(element, 'Could not find element');
expect(
await element.evaluate(element => {
return element.id === 'b';
})
).toBeTruthy();
// $ would add ARIA query handler to the main world.
await element.$('::-p-aria(world)');
element = await page.waitForSelector('::-p-aria(world)');
assert(element, 'Could not find element');
expect(
await element.evaluate(element => {
return element.id === 'b';
})
).toBeTruthy();
});
it('should work ARIA selectors with role', async () => {
const {page} = getTestState();
const element = await page.$('::-p-aria(world[role="button"])');