Skip to content

feat: support per-entry workingDir on playwrightChecks#1351

Open
kiroushi wants to merge 3 commits into
mainfrom
kiroushi/red-625-pwcs-per-entry-workingdir
Open

feat: support per-entry workingDir on playwrightChecks#1351
kiroushi wants to merge 3 commits into
mainfrom
kiroushi/red-625-pwcs-per-entry-workingdir

Conversation

@kiroushi

@kiroushi kiroushi commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Adds an optional per-entry workingDir to playwrightChecks entries (and the PlaywrightCheck construct).

A single bundled checkly test/deploy session can contain several playwrightChecks, but today they share one bundle root and one working directory. So each self-contained Playwright project (its own package manager and pinned @playwright/test) needs hand-written installCommand/testCommand shell surgery, and the CLI resolves a single @playwright/test version for all of them.

With workingDir set on an entry, the bundler:

  • resolves that entry's Playwright version from the working directory (so the provisioned browser version matches what the project actually runs), and
  • stamps a per-entry workingDir + a working-dir-relative playwrightConfigPath into the check payload.

So one session can carry projects on different Playwright versions without command surgery.

Backward compatibility

When workingDir is omitted, every computed value is identical to today (defaults to the project directory).

Changes

  • PlaywrightCheckProps.workingDir (+ the slimmed config prop) — new optional prop, threaded via the existing config spread.
  • PlaywrightProjectBundler.bundle/bundleProject — accept workingDir; compute the version anchor, payload workingDir, and relativePlaywrightConfigPath from the effective working directory; cache key includes it.
  • Unit tests for threading + cache-key separation.

Verification

  • tsc --noEmit clean
  • eslint clean
  • playwright-check.spec.ts (54) + playwright-project-bundler.spec.ts (20, incl. new workingDir tests) pass

@kiroushi kiroushi added the build Issue regarding building and packaging label Jun 17, 2026
A single bundled `checkly test`/`deploy` session can contain several
playwrightChecks, but they share one bundle root and one working directory, so
each self-contained Playwright project (its own package manager and pinned
@playwright/test) needs hand-written installCommand/testCommand shell surgery,
and the CLI resolves a single @playwright/test version for all of them.

Add an optional per-entry `workingDir` to PlaywrightCheck and playwrightChecks
config entries. When set, the bundler resolves that entry's Playwright version
from the working directory and stamps a per-entry working directory (plus a
working-dir-relative playwright config path) into the check payload, so one
session can carry projects on different Playwright versions without command
surgery.

Backward compatible: when `workingDir` is omitted, every computed value is
identical to today (defaults to the project directory).
@kiroushi kiroushi force-pushed the kiroushi/red-625-pwcs-per-entry-workingdir branch from f0b7fac to da101f2 Compare June 17, 2026 11:42
@kiroushi kiroushi changed the title feat: support per-entry workingDir on playwrightChecks [RED-625] feat: support per-entry workingDir on playwrightChecks Jun 17, 2026
kiroushi added 2 commits June 17, 2026 15:00
…'s lockfile

RED-625 Phase 3: make the CLI the source of truth for each playwrightChecks
entry's Playwright version. When an entry has a workingDir, resolve
@playwright/test from that fixture's own lockfile (the nearest one walking up,
bounded strictly below the monorepo/Session.workspace lockfile) instead of
collapsing every fixture to the monorepo catalog version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issue regarding building and packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant