Skip to content

ci: build frontend before nightly cross-browser Playwright run#6658

Draft
Ludy87 wants to merge 10 commits into
mainfrom
build_nightly_20260613
Draft

ci: build frontend before nightly cross-browser Playwright run#6658
Ludy87 wants to merge 10 commits into
mainfrom
build_nightly_20260613

Conversation

@Ludy87

@Ludy87 Ludy87 commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

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

Checklist

General

Documentation

Translations (if applicable)

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have run task check to verify linters, typechecks, and tests pass
  • I have tested my changes locally. Refer to the Testing Guide for more details.

# 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
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines ignoring generated files. label Jun 13, 2026
@stirlingbot stirlingbot Bot added Github ci Changes to CI configuration files and scripts labels Jun 13, 2026
@stirlingbot stirlingbot Bot added the Front End Issues or pull requests related to front-end development label Jun 13, 2026
@Ludy87 Ludy87 marked this pull request as draft June 13, 2026 22:12
Ludy87 added 4 commits June 14, 2026 13:16
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.
@Ludy87 Ludy87 marked this pull request as ready for review June 14, 2026 13:44
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)
@Ludy87 Ludy87 marked this pull request as draft June 14, 2026 14:49
Ludy87 added 3 commits June 14, 2026 17:59
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.
@stirlingbot

stirlingbot Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🚀 Auto-deploying V2 version for PR #6658...

This is an automated deployment for approved V2 contributors.

⚠️ Note: If new commits are pushed during deployment, this build will be cancelled and replaced with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes to CI configuration files and scripts Front End Issues or pull requests related to front-end development Github size:XS This PR changes 0-9 lines ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant