Skip to content

test: wait for dev server in Playwright config - #121

Merged
MyNameIsEdi merged 2 commits into
MyNameIsEdi:mainfrom
omribz156:codex/playwright-webserver-timeout
May 25, 2026
Merged

MyNameIsEdi merged 2 commits into
MyNameIsEdi:mainfrom
omribz156:codex/playwright-webserver-timeout

Conversation

@omribz156

@omribz156 omribz156 commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a Playwright webServer block so direct Playwright runs wait for the local dev server before starting tests. The repo currently documents the dev app at http://localhost:5173, so the config waits on that URL with a 120s timeout.

The block is skipped when PW_RUNTIME_CONFIG.baseUrl is provided, so dashboard/external-target runs keep using their injected target instead of forcing the local dev server.

Fixes #60

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Verification

  • npm ci --ignore-scripts
  • npx prettier --check playwright.config.ts
  • npx playwright test --list --config=playwright.config.ts
  • npx tsc --noEmit --pretty false
  • git diff --check

I also tried npx playwright test tests/healing.spec.ts --project=chromium --reporter=list, but local browser execution stopped before tests because the Playwright Chromium binary is not installed in this workspace. I did not run npx playwright install to avoid the extra browser download.

Implemented with Codex assistance; I kept the patch focused and manually reviewed the final diff.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Chores
    • Improved test environment configuration for enhanced compatibility and reliability across development and CI environments.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 50458399-b562-4759-a4a3-5e25d1b52cb6

📥 Commits

Reviewing files that changed from the base of the PR and between 6ca14f9 and 23e2122.

📒 Files selected for processing (1)
  • playwright.config.ts

📝 Walkthrough

Walkthrough

playwright.config.ts adds a dev server URL constant and conditionally configures Playwright to start the Vite dev server with a 120-second timeout and CI-aware server reuse when no baseUrl is provided, addressing flaky CI test connection errors.

Changes

Playwright WebServer Configuration

Layer / File(s) Summary
WebServer URL and conditional server startup
playwright.config.ts
Introduces localWebServerUrl constant targeting localhost:5173. Adds conditional webServer block to Playwright config: when rc.baseUrl is unset, starts npm run dev against that URL with 120s timeout and reuses existing server unless running in CI; when rc.baseUrl is set, webServer is omitted. buildProjects function signature and logic remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 A timeout so true, one-twenty seconds strong,

Dev server awakens, no more connection gone,

CI runs will flourish, no flakes to delay,

Playwright hops forward, saving the day! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a Playwright webServer configuration to wait for the dev server before tests run.
Description check ✅ Passed The PR description covers the change summary, type of change, verification steps, and completes most checklist items; all required template sections are addressed.
Linked Issues check ✅ Passed The PR implements the exact webServer configuration required by issue #60: command ('npm run dev'), conditional URL ('http://localhost:5173'), reuseExistingServer toggling based on CI environment, and 120s timeout.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #60: adding webServer configuration to playwright.config.ts with conditional baseUrl handling; no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@omribz156

Copy link
Copy Markdown
Contributor Author

Quick CI note: the Lint job is red in npm run format:check, but the reported files are untouched by this PR: .github/wiki/Home.md, CHANGELOG.md, and README.md. The touched config file passed local Prettier/TypeScript checks.

@MyNameIsEdi
MyNameIsEdi self-requested a review May 25, 2026 09:14
@MyNameIsEdi
MyNameIsEdi merged commit 3cccdac into MyNameIsEdi:main May 25, 2026
5 of 6 checks passed
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.

[Test] Playwright tests flaky in CI — missing webServer timeout

2 participants