diff --git a/packages/puppeteer-core/src/api/Page.ts b/packages/puppeteer-core/src/api/Page.ts index fa8b0c943b3..217af5039fc 100644 --- a/packages/puppeteer-core/src/api/Page.ts +++ b/packages/puppeteer-core/src/api/Page.ts @@ -2768,12 +2768,8 @@ export class Page extends EventEmitter { pageFunction: Func | string, options?: FrameWaitForFunctionOptions, ...args: Params - ): Promise>>>; - waitForFunction< - Params extends unknown[], - Func extends EvaluateFunc = EvaluateFunc - >(): Promise>>> { - throw new Error('Not implemented'); + ): Promise>>> { + return this.mainFrame().waitForFunction(pageFunction, options, ...args); } /** diff --git a/packages/puppeteer-core/src/common/Page.ts b/packages/puppeteer-core/src/common/Page.ts index 7ef40ca991c..6dbfebf1df7 100644 --- a/packages/puppeteer-core/src/common/Page.ts +++ b/packages/puppeteer-core/src/common/Page.ts @@ -25,7 +25,6 @@ import { Frame, FrameAddScriptTagOptions, FrameAddStyleTagOptions, - FrameWaitForFunctionOptions, } from '../api/Frame.js'; import {HTTPRequest} from '../api/HTTPRequest.js'; import {HTTPResponse} from '../api/HTTPResponse.js'; @@ -1438,17 +1437,6 @@ export class CDPPage extends Page { return this.mainFrame().waitForXPath(xpath, options); } - override waitForFunction< - Params extends unknown[], - Func extends EvaluateFunc = EvaluateFunc - >( - pageFunction: Func | string, - options: FrameWaitForFunctionOptions = {}, - ...args: Params - ): Promise>>> { - return this.mainFrame().waitForFunction(pageFunction, options, ...args); - } - /** * This method is typically coupled with an action that triggers a device * request from an api such as WebBluetooth. diff --git a/test/TestExpectations.json b/test/TestExpectations.json index a7ef1683715..1f79beff572 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -245,6 +245,42 @@ "parameters": ["webDriverBiDi"], "expectations": ["PASS"] }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction *", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["PASS"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should work when resolved right before execution context disposal", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["SKIP"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should work with strict CSP policy", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["SKIP"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should disable timeout when its set to 0", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["SKIP"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should survive cross-process navigation", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["SKIP"] + }, + { + "testIdPattern": "[waittask.spec] waittask specs Frame.waitForFunction should survive navigations", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["webDriverBiDi"], + "expectations": ["SKIP"] + }, { "testIdPattern": "[accessibility.spec] *", "platforms": ["darwin", "linux", "win32"],