@radhya/mach 2.6.12 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -185,29 +185,60 @@ mach web domain add --domain www.customer.com
185
185
  ## Local Playwright Web E2E Testing
186
186
 
187
187
  `mach web test` runs Playwright from the current project on the developer's
188
- machine or the project's existing CI runner. It never starts a Mach browser
188
+ machine or the project's existing CI runner. It creates a tenant-scoped
189
+ `Playwright · Web · Local` entry in Mach **Test Runs**, where it shares the
190
+ same history and detail screen as Maestro. It never starts a Mach browser
189
191
  runner, creates a billable test run, uploads test source or artifacts, or sends
190
- environment variables to Mach. Browser CPU time, reports, screenshots, and
191
- traces stay local.
192
+ environment variables to Mach. Browser CPU time, reports, screenshots, traces,
193
+ and browser output stay local.
192
194
 
193
- Install Playwright as a project development dependency once, then install only
194
- the browser you intend to test first (Chromium is the recommended default):
195
+ The first run automatically adds `@playwright/test` to the project using its
196
+ existing package manager and ensures local Chromium is available. That is a
197
+ one-time local dependency/browser download, not Mach infrastructure. Use a
198
+ different browser when needed:
195
199
 
196
200
  ```bash
197
- npm install --save-dev @playwright/test
198
- npx playwright install chromium
199
-
200
- # Mach runs the project's existing Playwright configuration locally.
201
+ # Mach runs the project's Playwright configuration locally and records the
202
+ # safe status/timing outcome in the dashboard.
201
203
  mach web test
202
204
  mach web test --project chromium --trace on-first-retry
203
205
  mach web test --base-url https://staging.example.com
206
+ mach web test --install-browser firefox
204
207
  ```
205
208
 
206
209
  `--base-url` sets `PLAYWRIGHT_BASE_URL`; use that variable in the project's
207
210
  `playwright.config.ts`. For local applications, Playwright's own `webServer`
208
- setting should start and wait for the project server. Use
209
- `mach web test --install-browser chromium` only when you deliberately want to
210
- download a browser on that machine.
211
+ setting should start and wait for the project server. The first setup saves
212
+ `@playwright/test` in the project's development dependencies; commit that
213
+ package-manager lockfile. Later local and CI runs use the normal project
214
+ install, rather than adding the dependency again. Mach checks the Chromium
215
+ installation on each run, but Playwright skips the download when it is already
216
+ in its browser cache. On short-lived Linux CI runners, cache
217
+ `~/.cache/ms-playwright` to avoid the initial browser download for every fresh
218
+ worker. Use `--no-setup` only in a pre-provisioned CI image to prevent any
219
+ dependency or browser installation.
220
+
221
+ ### Keep CI web tests fast
222
+
223
+ - Commit `package.json` and the matching npm, pnpm, or Yarn lockfile after the
224
+ initial setup. Let the pipeline use its normal frozen dependency install;
225
+ never add Playwright during every job.
226
+ - Cache both the package-manager store and Playwright's browser directory. On
227
+ Linux runners the browser cache is `~/.cache/ms-playwright`; key both caches
228
+ from the dependency lockfile so a Playwright upgrade gets a compatible
229
+ browser automatically.
230
+ - Run one browser project for the fast validation path, for example
231
+ `mach web test --project chromium`. Use a separate scheduled or release
232
+ job for cross-browser coverage.
233
+ - Keep CI headless. Avoid `--headed`, `--ui`, and `--debug` in pipelines;
234
+ use `--trace on-first-retry` rather than recording traces for every passing
235
+ test.
236
+ - Match `--workers` to the runner capacity. Start with `--workers 2` on a
237
+ two-core runner and increase it only when tests remain stable. Use `--grep`
238
+ or explicit test files for a focused pull-request check, then keep the full
239
+ suite for the main branch or release gate.
240
+ - Keep `--no-setup` for a deliberately pre-built image. With normal caches,
241
+ the default setup check is fast and protects a newly provisioned runner.
211
242
 
212
243
  ## Managed Maestro Testing
213
244