Repository navigation
test: fix user activation file chooser tests on Electron, Android and the frozen clock - #43408
Merged
Merged
Conversation
Chromium 148 in Electron 42 and Chrome on the Android emulator open a second file chooser instead of consuming the user activation. Under the frozen clock, page timers are fired from evaluate calls that carry user activation, so input.click() and showPicker() succeed without a gesture. Failing runs: https://github.com/microsoft/playwright/actions/runs/38660724131 https://github.com/microsoft/playwright/actions/runs/38660427709 https://github.com/microsoft/playwright/actions/runs/38658323573
Yury Semikhatsky (yury-s)
marked this pull request as ready for review
October 15, 2026 01:50
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| test('should not open file chooser without user activation', async ({ page, server, browserName }) => { | ||
| test.fixme(browserName === 'webkit', 'WebKit opens the file chooser from input.click() without user activation'); | ||
| test.skip(process.env.PW_CLOCK === 'frozen', 'The fake clock fires page timers from evaluate calls, which carry user activation'); |
There was a problem hiding this comment.
I don't think this comment is right.
Member
Author
There was a problem hiding this comment.
You're right, the comment blamed the wrong thing. Under the frozen clock the 0ms timer fires ~100ms after load, after waitForFunction has started polling, and polling evaluates with a user gesture that grants activation. Changed the test to wait for a console message instead of polling, so the skip is gone.
… test Under the frozen clock the 0ms timer fires after page.waitForFunction has started polling, and polling evaluates with a user gesture that grants activation. Waiting for a console message avoids evaluating in the page, so the test no longer needs a skip for that configuration.
Yury Semikhatsky (yury-s)
requested a review
from Pavel Feldman (pavelfeldman)
October 15, 2026 02:57
This comment has been minimized.
This comment has been minimized.
Contributor
Test results for "MCP"5154 passed, 614 skipped Merge workflow run. |
Contributor
Test results for "tests 1"3 flaky21780 passed, 525 skipped Merge workflow run. |
Pavel Feldman (pavelfeldman)
approved these changes
Oct 15, 2026
This comment has been minimized.
This comment has been minimized.
Contributor
Test results for "tests 2"33 flaky126650 passed, 4057 skipped Merge workflow run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
should consume user activation when opening file chooser: Chromium 148 in Electron 42 and Chrome on the Android emulator open a second file chooser instead of consuming the activation, so the test is afixmethere.should not open file chooser without user activation: under the frozen clock the 0ms timer fires afterpage.waitForFunctionhas started polling, and polling evaluates with a user gesture that grants activation. The test now waits for a console message instead of polling.Both tests were added in #43380 and have failed on every
mainrun since, e.g. https://github.com/microsoft/playwright/actions/runs/38660724131.