{"id":15434521,"url":"https://github.com/paperstrike/playwright-fixtures","last_synced_at":"2026-04-28T08:38:52.785Z","repository":{"id":57325838,"uuid":"400851889","full_name":"PaperStrike/playwright-fixtures","owner":"PaperStrike","description":"Wrap your tests with Playwright-like test fixtures in node \u0026 browsers","archived":false,"fork":false,"pushed_at":"2021-09-24T19:43:41.000Z","size":492,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T12:41:28.246Z","etag":null,"topics":["folio","playwright","test-fixtures","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaperStrike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-28T17:29:50.000Z","updated_at":"2022-10-23T15:10:01.000Z","dependencies_parsed_at":"2022-09-21T02:01:03.773Z","dependency_job_id":null,"html_url":"https://github.com/PaperStrike/playwright-fixtures","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaperStrike%2Fplaywright-fixtures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaperStrike%2Fplaywright-fixtures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaperStrike%2Fplaywright-fixtures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaperStrike%2Fplaywright-fixtures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaperStrike","download_url":"https://codeload.github.com/PaperStrike/playwright-fixtures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978277,"owners_count":20703678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["folio","playwright","test-fixtures","testing"],"created_at":"2024-10-01T18:39:48.732Z","updated_at":"2026-04-28T08:38:52.728Z","avatar_url":"https://github.com/PaperStrike.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playwright-fixtures\n\n[![npm Package](https://img.shields.io/npm/v/playwright-fixtures?logo=npm \"playwright-fixtures\")](https://www.npmjs.com/package/playwright-fixtures)\n\nWrap your tests with Playwright-like test fixtures in node \u0026 browsers.\n\n```shell\nnpm install playwright-fixtures --save-dev\n```\n\n\u003e Playwright Test is based on the concept of the test fixtures. Test fixtures are used to establish environment for each test, giving the test everything it needs and nothing else.\n\u003e\n\u003e For more information, check [Advanced: fixtures | Playwright][playwright-docs-test-fixtures].\n\n🐿️ Jump to [Entry](#entry).\n\n[playwright-docs-test-fixtures]: https://playwright.dev/docs/test-fixtures/\n\n## API\n\n### Type BaseTest\n\nSupported base tests. Generally, tests that accepts a string (as its name) and a function that can return a promise.\n\n```ts\nexport type BaseTest =\n  (name: string, inner: (...args: unknown[]) =\u003e Promise\u003cvoid\u003e | void) =\u003e unknown;\n```\n\n### Type Test\n\nThe test you get from this wrapper. All properties in the base test are retained, and the call signature is replaced.\n\n```ts\ntype KeyValue = Record\u003cstring, unknown\u003e;\n\ntype TestCall\u003cArgs extends KeyValue, B extends BaseTest\u003e =\n  B extends (name: string, inner: (...args: infer BaseArgs) =\u003e infer InnerReturn) =\u003e infer Return\n    ? (name: string, inner: (args: Args, ...baseArgs: BaseArgs) =\u003e InnerReturn) =\u003e Return\n    : never;\n\ntype Test\u003cArgs extends KeyValue, B extends BaseTest\u003e = Pick\u003cB, keyof B\u003e \u0026 TestCall\u003cArgs, B\u003e \u0026 {\n  extend\u003cT extends KeyValue = {}\u003e(\n    fixtures: Fixtures\u003cT, Args\u003e,\n  ): Test\u003cArgs \u0026 T, B\u003e;\n};\n```\n\n#### Method extend\n\nExtend fixtures like you do in Playwright. Parameters given by the base test will move right one position for it.\n\nExample on [tape](https://github.com/substack/tape):\n\n```ts\ntype TestFixtures = {\n  input: HTMLInputElement;\n};\nconst inputTest = test.extend\u003cTestFixtures\u003e({\n  input: async (baseFixtures, use) =\u003e {\n    const input = document.createElement('input');\n    document.body.append(input);\n    await use(input);\n    input.remove();\n  },\n});\ninputTest('focusable', ({ input }, t) =\u003e {\n  input.focus();\n  t.equal(document.activeElement, input);\n  t.end();\n});\n```\n\n```tap\nTAP version 13\n# focusable\nok 1 should be strictly equal\n# ...\n```\n\nThe report format depends entirely on your base test.\n\n### Entry\n\nThe wrap function. Accepts one single argument, the base test. Returns the wrapped test.\n\n```ts\ndeclare const wrap: \u003cB extends BaseTest = BaseTest\u003e(baseTest: B) =\u003e Test\u003c{}, B\u003e;\nexport default wrap;\n```\n\nUse it like:\n\n```ts\nimport { test as base } from 'uvu'; // mocha, tape, zora, etc.\nimport fixtureWrap from 'playwright-fixtures';\nconst test = fixtureWrap(base);\n\ntest('your tests', () =\u003e {\n  // ...\n});\n```\n\n## [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaperstrike%2Fplaywright-fixtures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaperstrike%2Fplaywright-fixtures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaperstrike%2Fplaywright-fixtures/lists"}