ci: build frontend before nightly cross-browser Playwright run#6658
Draft
Ludy87 wants to merge 10 commits into
Draft
ci: build frontend before nightly cross-browser Playwright run#6658Ludy87 wants to merge 10 commits into
Ludy87 wants to merge 10 commits into
Conversation
# Description of Changes This change updates the nightly GitHub Actions workflow so the cross-browser Playwright job builds the frontend bundle before launching the test suite. - Added a `task frontend:build` step to `.github/workflows/nightly.yml` - Set `VITE_BUILD_FOR_PREVIEW=1` so the CI build produces assets compatible with `vite preview` - Kept the existing `task e2e:cross-browser` step unchanged - Addresses the nightly `webServer` timeout caused by Playwright waiting on `vite preview` without a prebuilt `dist/` Why the change was made: - `frontend/editor/playwright.config.ts` uses `vite preview` in CI - `vite preview` requires a built frontend bundle - The nightly workflow previously installed Playwright browsers and immediately started tests without building the frontend first
Introduce a seedKey (stirling-pdf-files-page-seeded) in files-page test helpers to prevent re-initializing the IndexedDB on subsequent test runs. The init script now accepts seedKey and returns early if localStorage indicates seeding already occurred. After writing records the tx.oncomplete handler sets the flag, closes the DB, and reloads the page when on /files to ensure the UI picks up the seeded state. Changes applied to both files-page.spec.ts and files-page-screenshots.spec.ts to reduce flakiness and redundant work.
Replace clicks on the visible FileSidebar / Mantine upload buttons with direct calls to the hidden native file input (setInputFiles) across tests and helpers. This avoids native file-picker side effects in Firefox while still exercising the same upload path; helper comments updated accordingly and redundant button clicks removed.
Replace the fragile "go to file editor" role lookup with a robust selector for the view-switcher ([data-tour="view-switcher"]). The helper now counts buttons, early-returns if there aren't multiple segments, and clicks the last segment (the file-editor option) with a short timeout. This avoids visibility/detached-node flakiness and Playwright actionability retry issues when the viewer/editor controls are re-mounted.
Add waitForFilesPageSeed helper to tests which waits for localStorage key "stirling-pdf-files-page-seeded" === "1" (15s timeout). Invoke this helper after navigating to /files in the files-page screenshot tests before awaiting load state, ensuring the seeded data is present and reducing flakiness when asserting non-skeleton file cards. (frontend/editor/src/core/tests/stubbed/files-page-screenshots.spec.ts)
Remove the waitForFilesPageSeed helper and its calls from files-page-screenshots.spec.ts to simplify startup sequencing. In files-page.spec.ts replace a single containsText([...]) assertion with two explicit filtered toHaveCount checks to avoid relying on ordering and reduce flakiness. Changes focus on test stability and clarity across the files-page test suite.
Contributor
|
🚀 Auto-deploying V2 version for PR #6658... This is an automated deployment for approved V2 contributors. |
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.
Description of Changes
This change updates the nightly GitHub Actions workflow so the cross-browser Playwright job builds the frontend bundle before launching the test suite.
task frontend:buildstep to.github/workflows/nightly.ymlVITE_BUILD_FOR_PREVIEW=1so the CI build produces assets compatible withvite previewtask e2e:cross-browserstep unchangedwebServertimeout caused by Playwright waiting onvite previewwithout a prebuiltdist/Why the change was made:
frontend/editor/playwright.config.tsusesvite previewin CIvite previewrequires a built frontend bundleChecklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass