test(e2e): [OCISDEV-1009] fix webkit race in PDF test cleanup#478
Merged
Conversation
Two race conditions caused the "Edit mode pill is disabled for PDF files" webkit test to flake and block unrelated PRs: 1. After navigating back to the Files personal folder via the app switcher, webkit hadn't finished rendering the file list before selectAllCheckbox.check() ran. With an empty list the select-all checkbox state never changes, so Playwright retried until the test timed out. Fixed by waiting for the first file row to be visible before attempting to select all. 2. If a previous run's cleanup was interrupted (e.g. by the above timeout), test-document.pdf remained on the server. On retry, uploadFile hit a "File already exists" conflict dialog, which blocked waitForResponse indefinitely. Fixed by checking for the Replace button immediately after setInputFiles and clicking it if present. Signed-off-by: Lukas Hirt <info@hirt.cz> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Lukas Hirt <info@hirt.cz>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
mzner
approved these changes
Jun 25, 2026
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
selectAllCheckbox.check()ran — an empty list means the checkbox state never changes. Fixed by waiting for the first file row to be visible before selecting all.test-document.pdfcould remain on the server. On retry,uploadFilewould hit a "File already exists" conflict dialog that blockedwaitForResponseindefinitely. Fixed by checking for the Replace button immediately aftersetInputFilesand clicking it if present.Test plan
[webkit] › chatWithFile.spec.ts:65:1 › Edit mode pill is disabled for PDF filestest passes on CI🤖 Generated with Claude Code