Skip to content

test(e2e): [OCISDEV-1009] fix webkit race in PDF test cleanup#478

Merged
LukasHirt merged 1 commit into
mainfrom
chore/e2e-webkit-pdf-cleanup-race
Jun 25, 2026
Merged

test(e2e): [OCISDEV-1009] fix webkit race in PDF test cleanup#478
LukasHirt merged 1 commit into
mainfrom
chore/e2e-webkit-pdf-cleanup-race

Conversation

@LukasHirt

Copy link
Copy Markdown
Collaborator

Summary

  • After navigating back to Files via the app switcher, webkit hadn't finished rendering the file list before 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.
  • If a previous run's cleanup was interrupted, test-document.pdf could remain on the server. On retry, uploadFile would hit a "File already exists" conflict dialog that blocked waitForResponse indefinitely. Fixed by checking for the Replace button immediately after setInputFiles and clicking it if present.

Test plan

  • Confirm the [webkit] › chatWithFile.spec.ts:65:1 › Edit mode pill is disabled for PDF files test passes on CI
  • Confirm all other chat-with-file e2e tests still pass across all three browsers

🤖 Generated with Claude Code

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>
@kw-security

kw-security commented Jun 25, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@LukasHirt LukasHirt requested a review from mzner June 25, 2026 09:55
@LukasHirt LukasHirt merged commit 624ca01 into main Jun 25, 2026
24 checks passed
@LukasHirt LukasHirt deleted the chore/e2e-webkit-pdf-cleanup-race branch June 25, 2026 11:21
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.

3 participants