Skip to content

Commit

Permalink
test: enable a11y tests for Firefox (#12421)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed May 13, 2024
1 parent c229fc8 commit 812851c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
17 changes: 1 addition & 16 deletions packages/puppeteer-core/src/bidi/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ import {
switchMap,
} from '../../third_party/rxjs/rxjs.js';
import type {CDPSession} from '../api/CDPSession.js';
import type {ElementHandle} from '../api/ElementHandle.js';
import {
Frame,
throwIfDetached,
type GoToOptions,
type WaitForOptions,
} from '../api/Frame.js';
import type {WaitForSelectorOptions} from '../api/Page.js';
import {PageEvent} from '../api/Page.js';
import {
ConsoleMessage,
type ConsoleMessageLocation,
} from '../common/ConsoleMessage.js';
import {TargetCloseError, UnsupportedOperation} from '../common/Errors.js';
import type {TimeoutSettings} from '../common/TimeoutSettings.js';
import type {Awaitable, NodeFor} from '../common/types.js';
import type {Awaitable} from '../common/types.js';
import {debugError, fromEmitterEvent, timeout} from '../common/util.js';
import {isErrorLike} from '../util/ErrorLike.js';

Expand Down Expand Up @@ -456,19 +454,6 @@ export class BidiFrame extends Frame {
await exposedFunction[Symbol.asyncDispose]();
}

override waitForSelector<Selector extends string>(
selector: Selector,
options?: WaitForSelectorOptions
): Promise<ElementHandle<NodeFor<Selector>> | null> {
if (selector.startsWith('aria') && !this.page().browser().cdpSupported) {
throw new UnsupportedOperation(
'ARIA selector is not supported for BiDi!'
);
}

return super.waitForSelector(selector, options);
}

async createCDPSession(): Promise<CDPSession> {
const {sessionId} = await this.client.send('Target.attachToTarget', {
targetId: this._id,
Expand Down
32 changes: 23 additions & 9 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[
{
"testIdPattern": "[ariaqueryhandler.spec] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox"],
"expectations": ["SKIP"],
"comment": "Firefox crashes when a document is provided as a start node"
},
{
"testIdPattern": "[autofill.spec] *",
"platforms": ["darwin", "linux", "win32"],
Expand Down Expand Up @@ -202,13 +195,27 @@
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[ariaqueryhandler.spec] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["SKIP"],
"comment": "Not supported over CDP"
},
{
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler queryOne (Chromium web test) should find by role \"heading\"",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "WebDriver BiDi locateNodes does not support shadow roots so far"
},
{
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler waitForSelector *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs investigation"
},
{
"testIdPattern": "[autofill.spec] *",
"platforms": ["darwin", "linux", "win32"],
Expand Down Expand Up @@ -961,11 +968,18 @@
"comment": "times out flakily"
},
{
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler queryOne (Chromium web test) should find by role \"button\"",
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler queryOne (Chromium web test) should find by name \"bar\"",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: Needs investigation"
},
{
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler queryOne (Chromium web test) should find treeitem by name",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Querying by a11y attributes is not standard behavior"
"comment": "TODO: Needs investigation"
},
{
"testIdPattern": "[bfcache.spec] BFCache can navigate to a BFCached page containing an OOPIF and a worker",
Expand Down

0 comments on commit 812851c

Please sign in to comment.