test: enable waitForXPath tests (#10580)

This commit is contained in:
Alex Rudenko 2023-07-18 21:11:12 +02:00 committed by GitHub
parent b032b629cb
commit 3b4ff2ad32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 11 deletions

View File

@ -2706,9 +2706,8 @@ export class Page extends EventEmitter {
waitForXPath( waitForXPath(
xpath: string, xpath: string,
options?: WaitForSelectorOptions options?: WaitForSelectorOptions
): Promise<ElementHandle<Node> | null>; ): Promise<ElementHandle<Node> | null> {
waitForXPath(): Promise<ElementHandle<Node> | null> { return this.mainFrame().waitForXPath(xpath, options);
throw new Error('Not implemented');
} }
/** /**

View File

@ -57,7 +57,6 @@ import {TargetCloseError} from './Errors.js';
import {FileChooser} from './FileChooser.js'; import {FileChooser} from './FileChooser.js';
import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js'; import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js';
import {CDPKeyboard, CDPMouse, CDPTouchscreen} from './Input.js'; import {CDPKeyboard, CDPMouse, CDPTouchscreen} from './Input.js';
import {WaitForSelectorOptions} from './IsolatedWorld.js';
import {MAIN_WORLD} from './IsolatedWorlds.js'; import {MAIN_WORLD} from './IsolatedWorlds.js';
import { import {
Credentials, Credentials,
@ -1378,13 +1377,6 @@ export class CDPPage extends Page {
return this.#mouse; return this.#mouse;
} }
override waitForXPath(
xpath: string,
options: WaitForSelectorOptions = {}
): Promise<ElementHandle<Node> | null> {
return this.mainFrame().waitForXPath(xpath, options);
}
/** /**
* This method is typically coupled with an action that triggers a device * This method is typically coupled with an action that triggers a device
* request from an api such as WebBluetooth. * request from an api such as WebBluetooth.

View File

@ -269,6 +269,12 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[waittask.spec] waittask specs Frame.waitForXPath *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[accessibility.spec] *", "testIdPattern": "[accessibility.spec] *",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1529,6 +1535,18 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[waittask.spec] waittask specs Frame.waitForXPath should run in specified frame",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[waittask.spec] waittask specs Frame.waitForXPath should throw when frame is detached",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{ {
"testIdPattern": "[waittask.spec] waittask specs Page.waitForTimeout waits for the given timeout before resolving", "testIdPattern": "[waittask.spec] waittask specs Page.waitForTimeout waits for the given timeout before resolving",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],