{"_id":"@cerberauth/stubidp-playwright","_rev":"4-b6a626e2d16a2feaf6451b7177ce20d9","name":"@cerberauth/stubidp-playwright","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.0":{"name":"@cerberauth/stubidp-playwright","version":"0.0.0","keywords":["playwright","oidc","stubidp","testing","e2e"],"author":{"name":"cerberauth"},"license":"MIT","_id":"@cerberauth/stubidp-playwright@0.0.0","maintainers":[{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"}],"homepage":"https://github.com/cerberauth/stubidp-playwright","bugs":{"url":"https://github.com/cerberauth/stubidp-playwright/issues"},"dist":{"shasum":"36401676ef09178b865a5218f5c3bcd4b2bfee88","tarball":"https://registry.npmjs.org/@cerberauth/stubidp-playwright/-/stubidp-playwright-0.0.0.tgz","fileCount":9,"integrity":"sha512-BUZu8BmZyAVZQGTyDRk4CZOMG2Hd/33c8rmjaJ8p9S/o1FNhgYa8IStl7pqrMGCeiQursmYo3NyyQwQvubNe+A==","signatures":[{"sig":"MEYCIQDGIyU+m4ync5KyuJDUHQz97ccDqvhZw8wXFD5ffqht7gIhAMsYTYhzfXhMLNyOpaD/sVrXtyes3PusinZcxx9tt7P8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50802},"type":"module","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"91cd6b0e085203de5595043504b169fbc8df0067","scripts":{"lint":"eslint .","build":"tsup","format":"prettier --write .","lint:fix":"eslint . --fix","test:e2e":"playwright test -c test/playwright.config.ts","typecheck":"tsc --noEmit","format:check":"prettier --check .","prepublishOnly":"npm run build","test:e2e:install":"playwright install --with-deps chromium"},"_npmUser":{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"},"repository":{"url":"git+https://github.com/cerberauth/stubidp-playwright.git","type":"git"},"_npmVersion":"11.19.0","description":"Playwright helper to drive stubidp interaction UI in E2E tests","directories":{},"_nodeVersion":"26.8.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4","tsup":"^8","eslint":"^9","express":"^5","prettier":"^3","typescript":"^5","@types/node":"^24","@types/express":"^5","@playwright/test":"^1.61.1","@cerberauth/stubidp":"^0.3.1","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8"},"peerDependencies":{"@playwright/test":">=1.40.0 <2"},"_npmOperationalInternal":{"tmp":"tmp/stubidp-playwright_0.0.0_1788712869484_0.9491076189847507","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@cerberauth/stubidp-playwright","version":"0.1.0","keywords":["playwright","oidc","stubidp","testing","e2e"],"author":{"name":"cerberauth"},"license":"MIT","_id":"@cerberauth/stubidp-playwright@0.1.0","maintainers":[{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"}],"homepage":"https://github.com/cerberauth/stubidp-playwright","bugs":{"url":"https://github.com/cerberauth/stubidp-playwright/issues"},"dist":{"shasum":"fefbcf1a5a9de7b11dcaa795e3dd440271156a69","tarball":"https://registry.npmjs.org/@cerberauth/stubidp-playwright/-/stubidp-playwright-0.1.0.tgz","fileCount":9,"integrity":"sha512-V+UFKrvFk8r/iFTBsBLhQCmQ/d1Ldjt7u1XNNEOH16SdiBfsg/HaVqfSKpyVmdTHmiqQLso5CPi10ekiOz0e7w==","signatures":[{"sig":"MEUCIHn/4m7gZsFrlgwc7pwZ/DkMNZ1YsKWvS0/ZvMGnSObtAiEA38j62c/xNKh65XsKVBxQyLbCsc/nbJas4LPiFxUofjA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cerberauth%2fstubidp-playwright@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50802},"type":"module","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"0496fb79595aaaafbe7c7f4acbb0d1d82497257d","scripts":{"lint":"eslint .","build":"tsup","format":"prettier --write .","lint:fix":"eslint . --fix","test:e2e":"playwright test -c test/playwright.config.ts","typecheck":"tsc --noEmit","format:check":"prettier --check .","prepublishOnly":"npm run build","test:e2e:install":"playwright install --with-deps chromium"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8b81427b-32cd-4098-8ce5-aa632198f21d"}},"repository":{"url":"git+https://github.com/cerberauth/stubidp-playwright.git","type":"git"},"_npmVersion":"11.19.0","description":"Playwright helper to drive stubidp interaction UI in E2E tests","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4","tsup":"^8","eslint":"^9","express":"^5","prettier":"^3","typescript":"^5","@types/node":"^24","@types/express":"^5","@playwright/test":"^1.61.1","@cerberauth/stubidp":"^0.3.1","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8"},"peerDependencies":{"@playwright/test":">=1.40.0 <2"},"_npmOperationalInternal":{"tmp":"tmp/stubidp-playwright_0.1.0_1788713144057_0.5253617686726539","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cerberauth/stubidp-playwright","version":"0.1.1","keywords":["playwright","oidc","stubidp","testing","e2e"],"author":{"name":"cerberauth"},"license":"MIT","_id":"@cerberauth/stubidp-playwright@0.1.1","maintainers":[{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"}],"homepage":"https://github.com/cerberauth/stubidp-playwright","bugs":{"url":"https://github.com/cerberauth/stubidp-playwright/issues"},"dist":{"shasum":"9a071991ef19c14b16fb0ed4b18edd2d48a86409","tarball":"https://registry.npmjs.org/@cerberauth/stubidp-playwright/-/stubidp-playwright-0.1.1.tgz","fileCount":9,"integrity":"sha512-OEp3XzDBKrELdbu8nHoNR8MVHXBGGk+Eo4nsM8mIvmb6Zjaa45Hl7v6fmc5UZs5PaKqRPZYXUK04iEF0CeHCvQ==","signatures":[{"sig":"MEUCICVzBqS8/MWUVUF3GeidFwDLQ11ufG91s4V8jhgzqOIyAiEA7oaTpbqasdM20vT8Ix29VfgfWvyWgdj2dC2GmS+qgNI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cerberauth%2fstubidp-playwright@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50802},"type":"module","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"40d8f4ba81d6908e7c866097ea0df9204e26e6e6","scripts":{"lint":"eslint .","build":"tsup","format":"prettier --write .","lint:fix":"eslint . --fix","test:e2e":"playwright test -c test/playwright.config.ts","typecheck":"tsc --noEmit","format:check":"prettier --check .","prepublishOnly":"npm run build","test:e2e:install":"playwright install --with-deps chromium"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8b81427b-32cd-4098-8ce5-aa632198f21d"}},"repository":{"url":"git+https://github.com/cerberauth/stubidp-playwright.git","type":"git"},"_npmVersion":"11.19.0","description":"Playwright helper to drive stubidp interaction UI in E2E tests","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4","tsup":"^8","eslint":"^9","express":"^5","prettier":"^3","typescript":"^5","@types/node":"^24","@types/express":"^5","@playwright/test":"^1.61.1","@cerberauth/stubidp":"^0.3.1","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8"},"peerDependencies":{"@playwright/test":">=1.40.0 <2"},"_npmOperationalInternal":{"tmp":"tmp/stubidp-playwright_0.1.1_1788716611950_0.8730403609427608","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cerberauth/stubidp-playwright","description":"Playwright helper to drive stubidp interaction UI in E2E tests","version":"0.2.0","author":{"name":"cerberauth"},"type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cerberauth/stubidp-playwright.git"},"homepage":"https://github.com/cerberauth/stubidp-playwright","bugs":{"url":"https://github.com/cerberauth/stubidp-playwright/issues"},"keywords":["playwright","oidc","stubidp","testing","e2e"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"engines":{"node":">=24.0.0"},"scripts":{"build":"tsup","test:e2e":"playwright test -c test/playwright.config.ts","test:e2e:install":"playwright install --with-deps chromium","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"peerDependencies":{"@playwright/test":">=1.40.0 <2"},"devDependencies":{"@cerberauth/stubidp":"^0.3.1","@playwright/test":"^1.61.1","@types/express":"^5","@types/node":"^24","@typescript-eslint/eslint-plugin":"^8","@typescript-eslint/parser":"^8","eslint":"^9","express":"^5","prettier":"^3","tsup":"^8","tsx":"^4","typescript":"^5"},"gitHead":"043e05047696aef9b0705c8a962787a7d7f894da","_id":"@cerberauth/stubidp-playwright@0.2.0","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-WsEaWatjQYbQaQm8G6BS4J2wV9fyV+YuK6qsWh9YdSWYOb3e/0WASO1e2dF2ei6m3ZE8Ra905cykjrvOZE5KfA==","shasum":"fc1639dd641965d568ac3705e8d822fe88e08fcf","tarball":"https://registry.npmjs.org/@cerberauth/stubidp-playwright/-/stubidp-playwright-0.2.0.tgz","fileCount":9,"unpackedSize":50960,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cerberauth%2fstubidp-playwright@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDGziRffvJsU/JmS9L8QCnyfX+g/4aF4QduI/QVr4RrlQIhAPleA2kRVUkMY6A3t2wd6Eu4yxstm7kjkrCcNYf9rera"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8b81427b-32cd-4098-8ce5-aa632198f21d"}},"directories":{},"maintainers":[{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stubidp-playwright_0.2.0_1789251103605_0.021687145492739424"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-06T16:41:09.337Z","modified":"2026-09-12T22:11:44.036Z","0.0.0":"2026-09-06T16:41:09.627Z","0.1.0":"2026-09-06T16:45:44.196Z","0.1.1":"2026-09-06T17:43:32.073Z","0.2.0":"2026-09-12T22:11:43.727Z"},"bugs":{"url":"https://github.com/cerberauth/stubidp-playwright/issues"},"author":{"name":"cerberauth"},"license":"MIT","homepage":"https://github.com/cerberauth/stubidp-playwright","keywords":["playwright","oidc","stubidp","testing","e2e"],"repository":{"type":"git","url":"git+https://github.com/cerberauth/stubidp-playwright.git"},"description":"Playwright helper to drive stubidp interaction UI in E2E tests","maintainers":[{"name":"emmanuelgautier","email":"npm@emmanuelgautier.fr"}],"readme":"# @cerberauth/stubidp-playwright\n\nPlaywright helper to drive [stubidp](https://github.com/cerberauth/stubidp) interaction UI from your own E2E tests.\n\nThe package does **not** start, configure, or own a stubidp instance — it only takes over the browser once your app's OIDC redirect lands on stubidp, and hands control back when the flow completes.\n\n## Install\n\n```sh\nnpm install -D @cerberauth/stubidp-playwright\n```\n\n`@playwright/test` is a peer dependency — bring your own.\n\n## Usage\n\n```ts\nimport { test, expect } from '@playwright/test'\nimport { StubIdp } from '@cerberauth/stubidp-playwright'\n\ntest('user signs in via stubidp', async ({ page }) => {\n  await page.goto('/')\n  await page.getByRole('button', { name: /sign in/i }).click() // app kicks off OIDC\n  await new StubIdp(page).signIn({ username: 'alice' }) // package drives stub UI\n  await expect(page.getByText('Welcome')).toBeVisible() // back in the app\n})\n```\n\n### With the fixture\n\nSet `stubidpOptions` once in `playwright.config.ts` instead of repeating the issuer everywhere:\n\n```ts\n// playwright.config.ts\nimport { defineConfig } from '@playwright/test'\nexport default defineConfig({\n  use: { stubidpOptions: { issuer: 'https://idp.dev.example.com' } },\n})\n```\n\n```ts\n// my.spec.ts\nimport { test, expect } from '@cerberauth/stubidp-playwright'\n\ntest('signs in', async ({ page, stubidp }) => {\n  await page.goto('/')\n  await page.getByRole('button', { name: /sign in/i }).click()\n  await stubidp.signIn({ username: 'alice' })\n  await expect(page.getByText('Welcome')).toBeVisible()\n})\n```\n\n## API\n\n### `new StubIdp(page, options?)`\n\n| Option    | Type     | Default | Description                                                   |\n| --------- | -------- | ------- | ------------------------------------------------------------- |\n| `issuer`  | `string` | —       | Issuer origin; prompts are only acted on while on this origin |\n| `timeout` | `number` | `15000` | Max ms for the whole interaction                              |\n\n### `stubidp.signIn(options?)`\n\nHigh-level helper. Resolves whatever prompts stubidp shows (login, consent) and returns once the browser leaves stubidp. Tolerates skip-prompt and remembered grants.\n\n| Option      | Type                     | Default       | Description                            |\n| ----------- | ------------------------ | ------------- | -------------------------------------- |\n| `username`  | `string`                 | `'stub-user'` | Username to fill                       |\n| `password`  | `string`                 | `'password'`  | Password to fill                       |\n| `consent`   | `'allow' \\| 'deny'`      | `'allow'`     | What to do at the consent prompt       |\n| `returnUrl` | `string \\| RegExp \\| fn` | —             | URL to wait for after the flow returns |\n| `timeout`   | `number`                 | inherited     | Override per-call timeout              |\n\n### Individual step methods\n\nUse these when you need to assert between steps:\n\n```ts\nconst stubidp = new StubIdp(page)\nawait stubidp.login({ username: 'alice' })\nawait expect(page.locator('#consent-screen')).toBeVisible()\nawait stubidp.allow()\n```\n\n| Method            | Description                                               |\n| ----------------- | --------------------------------------------------------- |\n| `login(opts?)`    | Fill and submit the login form                            |\n| `allow()`         | Click the consent-allow button                            |\n| `deny()`          | Click the consent-deny / abort button                     |\n| `confirmLogout()` | Click the logout-confirm button if shown, no-op otherwise |\n\n### `assertStubidpReachable(issuer, options?)`\n\nUtility to verify a stubidp instance is up before your tests run. Checks the OIDC discovery endpoint.\n\n```ts\nimport { assertStubidpReachable } from '@cerberauth/stubidp-playwright'\nawait assertStubidpReachable('http://localhost:9000')\n```\n\n### `stubidpSelectors`\n\nRaw selector functions (e.g. for custom assertions):\n\n```ts\nimport { stubidpSelectors as sel } from '@cerberauth/stubidp-playwright'\nawait expect(sel.loginForm(page)).toBeVisible()\n```\n\n## Selector contract\n\nThe helper is coupled to stubidp's rendered markup. Stable anchors (current):\n\n| Prompt         | Selector                                         |\n| -------------- | ------------------------------------------------ |\n| Login form     | `form[action$=\"/login\"]`                         |\n| Username       | `#username`                                      |\n| Password       | `#password`                                      |\n| Login submit   | `form[action$=\"/login\"] button[type=\"submit\"]`   |\n| Consent allow  | `form[action$=\"/confirm\"] button[type=\"submit\"]` |\n| Consent deny   | `form[action$=\"/abort\"] button[type=\"submit\"]`   |\n| Logout confirm | `button[form=\"op.logoutForm\"][value=\"yes\"]`      |\n\nWhen stubidp adds `data-testid` attributes (`stubidp-login-form`, `stubidp-username`, etc.) the helper will prefer them automatically via a fallback chain — no consumer change needed.\n\n**Minimum stubidp version:** `0.0.3` (current stable selectors). `data-testid` support: TBD in a follow-up PR.\n\n## Examples\n\n- [`examples/react`](examples/react) — a Vite + React SPA signing in via stubidp, with a Playwright e2e suite using this package.\n\n## License\n\nThis repository is licensed under the MIT License @ [CerberAuth](https://www.cerberauth.com/).\n","readmeFilename":"README.md"}