Add storageState config + saveStorageState action, plus CI cleanup safety net #1

Merged
zachhandley merged 2 commits from feat/storage-state into main 2026-05-11 18:51:53 +00:00
Owner

Summary

  • storageState config on workflow.config.web, pipeline.config.web, test.config.web, and platforms.web — accepts either a file path or an inline {cookies, origins} object. Mapped straight through to Playwright's browser.newContext({ storageState }). Forwarded from YAML through WebRunOptions/WorkflowOptions to both newContext call sites.
  • saveStorageState action to persist context state mid-test: path form calls page.context().storageState({path}); handler form dynamic-imports a user TS/JS file and invokes its default async ({page, context, variables}) => void. Variable interpolation on both fields.
  • action.yml gets a timeout-minutes input (default 30) on the Run Intellitester step plus an if: always() Cleanup safety net step that runs npx intellitester cleanup:retry against .intellitester/cleanup/failed/. Catches the SIGKILL-before-finally case where the runner cancels the main step.

Files touched: 13 (4 Zod schemas, 4 JSON schemas, 2 executors, 1 CLI, 1 reporter, 1 action.yml). +238 / -1.

Test plan

  • pnpm typecheck clean
  • pnpm build clean
  • pnpm test — 14/14 passing (schema + interpolation + browser-launch)
  • pnpm lint — only 2 pre-existing warnings, none introduced
  • Both action.yml and all JSON schemas validated as parseable
  • Manual: round-trip a saveStorageState: {path: ./auth.json} step in one workflow, then config.web.storageState: ./auth.json in a second workflow, confirm login state carries
  • Manual: write a custom handler file (.js default-export async fn) and trigger via saveStorageState: {handler: ./scripts/saveAuth.js}
  • Manual: trigger a timeout in CI via the action; confirm Cleanup safety net step runs (if: always()) and either retries or reports no failed cleanups

Out of scope / follow-ups

  • No --storage-state CLI flag yet — easy follow-up.
  • No automatic relative-to-workflow-file path resolution; Playwright resolves against cwd and we keep that contract.
  • Cleanup-in-CI investigation: the safety net only retries resources Intellitester already recorded as failed. If resources are never tracked at all (interception miss) or the API key lacks scope, that needs real intellitester CI logs to diagnose.
## Summary - **storageState config** on `workflow.config.web`, `pipeline.config.web`, `test.config.web`, and `platforms.web` — accepts either a file path or an inline `{cookies, origins}` object. Mapped straight through to Playwright's `browser.newContext({ storageState })`. Forwarded from YAML through `WebRunOptions`/`WorkflowOptions` to both `newContext` call sites. - **saveStorageState action** to persist context state mid-test: `path` form calls `page.context().storageState({path})`; `handler` form dynamic-imports a user TS/JS file and invokes its `default async ({page, context, variables}) => void`. Variable interpolation on both fields. - **action.yml** gets a `timeout-minutes` input (default 30) on the Run Intellitester step plus an `if: always()` Cleanup safety net step that runs `npx intellitester cleanup:retry` against `.intellitester/cleanup/failed/`. Catches the SIGKILL-before-finally case where the runner cancels the main step. Files touched: 13 (4 Zod schemas, 4 JSON schemas, 2 executors, 1 CLI, 1 reporter, 1 action.yml). +238 / -1. ## Test plan - [x] `pnpm typecheck` clean - [x] `pnpm build` clean - [x] `pnpm test` — 14/14 passing (schema + interpolation + browser-launch) - [x] `pnpm lint` — only 2 pre-existing warnings, none introduced - [x] Both action.yml and all JSON schemas validated as parseable - [ ] Manual: round-trip a `saveStorageState: {path: ./auth.json}` step in one workflow, then `config.web.storageState: ./auth.json` in a second workflow, confirm login state carries - [ ] Manual: write a custom handler file (`.js` default-export async fn) and trigger via `saveStorageState: {handler: ./scripts/saveAuth.js}` - [ ] Manual: trigger a timeout in CI via the action; confirm Cleanup safety net step runs (`if: always()`) and either retries or reports no failed cleanups ## Out of scope / follow-ups - No `--storage-state` CLI flag yet — easy follow-up. - No automatic relative-to-workflow-file path resolution; Playwright resolves against cwd and we keep that contract. - Cleanup-in-CI investigation: the safety net only retries resources Intellitester already recorded as failed. If resources are never tracked at all (interception miss) or the API key lacks scope, that needs real intellitester CI logs to diagnose.
Add storageState config + saveStorageState action, plus CI cleanup safety net
Some checks are pending
CI / lint (pull_request) Successful in 16s
CI / typecheck (pull_request) Successful in 15s
CI / build (pull_request) Successful in 21s
CI / integration-test (pull_request) Successful in 51s
CI / test (pull_request) Successful in 41s
CI / trigger-publish (pull_request) Waiting to run
CI / Cleanup Old Caches (pull_request) Waiting to run
b56df0edc6
Add --storage-state CLI flag + resolve YAML paths relative to their file
Some checks failed
CI / test (pull_request) Successful in 16s
CI / lint (pull_request) Successful in 18s
CI / typecheck (pull_request) Successful in 15s
CI / build (pull_request) Successful in 24s
CI / integration-test (pull_request) Successful in 23s
CI / trigger-publish (pull_request) Has been cancelled
CI / Cleanup Old Caches (pull_request) Has been cancelled
97c0bcc030
zachhandley deleted branch feat/storage-state 2026-05-11 18:51:54 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zachhandley/Intellitester!1
No description provided.