Skip to content

Conversation

@yury-s
Copy link
Member

@yury-s yury-s commented Nov 15, 2024

Fixes the following error on the bots:

Error:    TestPageClock.shouldNotRunTimeBeforePopupOnPause:313 » Playwright Error {
  message='ReferenceError: time is not defined
    at eval (eval at evaluate (:234:30), <anonymous>:1:1)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:234:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)
  name='Error
  stack='Error: ReferenceError: time is not defined
    at eval (eval at evaluate (:234:30), <anonymous>:1:1)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:234:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)
    at CRExecutionContext.evaluateWithArguments (/tmp/playwright-java-947970650740572645/package/lib/server/chromium/crExecutionContext.js:79:33)
    at async LongStandingScope._race (/tmp/playwright-java-947970650740572645/package/lib/utils/manualPromise.js:96:14)
    at async Object.evaluateExpression (/tmp/playwright-java-947970650740572645/package/lib/server/javascript.js:229:12)
    at async Frame.evaluateExpression (/tmp/playwright-java-947970650740572645/package/lib/server/frames.js:608:19)
    at async FrameDispatcher.evaluateExpression (/tmp/playwright-java-947970650740572645/package/lib/server/dispatchers/frameDispatcher.js:92:55)
    at async LongStandingScope._race (/tmp/playwright-java-947970650740572645/package/lib/utils/manualPromise.js:96:14)
    at async FrameDispatcher._handleCommand (/tmp/playwright-java-947970650740572645/package/lib/server/dispatchers/dispatcher.js:96:14)
    at async DispatcherConnection.dispatch (/tmp/playwright-java-947970650740572645/package/lib/server/dispatchers/dispatcher.js:361:22)
}

Page popup = page.waitForPopup(() -> {
page.evaluate("url => window.open(url)", server.PREFIX + "/popup.html");
});
popup.waitForURL(server.PREFIX + "/popup.html");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for url does wait for load state too by default and also ensures we are not on about:blank (unlikely).

@yury-s yury-s merged commit 29f58a5 into microsoft:main Nov 15, 2024
10 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants