{"_id":"@burojs/test-helpers","_rev":"3-932cf30161424f175a04a10b639d80ce","name":"@burojs/test-helpers","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.0":{"name":"@burojs/test-helpers","version":"0.2.0","license":"MIT","_id":"@burojs/test-helpers@0.2.0","maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"dist":{"shasum":"67513ce07d5906d7be10b029a2edf95f0bda7283","tarball":"https://registry.npmjs.org/@burojs/test-helpers/-/test-helpers-0.2.0.tgz","fileCount":9,"integrity":"sha512-iBW/k92ZAF5Wv0ECWwS6JZ/OgMh5FitHQERf5VWwq1dS/kHXYPTKNygN8GluYGfmU+ZfZCl2QPNHOEKagxgc+A==","signatures":[{"sig":"MEUCIQCWN4xyy1OqSq4l4X/IIvu7eBGmjt2DoTV0s9562Lk9JgIgLSMA2u9ZwWNK2nyV0a1WVBgkj+T/hukUzT8fDBiIRUM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135538},"main":"./dist/index.cjs","type":"module","_from":"file:burojs-test-helpers-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit","typecheck:tests":"tsc -p tsconfig.test.json"},"_npmUser":{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"},"_resolved":"/tmp/31687e74e4929592fc6e087a06604fb0/burojs-test-helpers-0.2.0.tgz","_integrity":"sha512-iBW/k92ZAF5Wv0ECWwS6JZ/OgMh5FitHQERf5VWwq1dS/kHXYPTKNygN8GluYGfmU+ZfZCl2QPNHOEKagxgc+A==","_npmVersion":"10.9.8","description":"Buro: typed Playwright Page Objects over the testid convention","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@burojs/core":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","typescript":"^5.5.0","expect-type":"^1.1.0","@burojs/tooling-eslint":"0.0.0","@burojs/tooling-tsconfig":"0.0.0"},"peerDependencies":{"vitest":"^2.1.0","@playwright/test":"^1.49.0"},"_npmOperationalInternal":{"tmp":"tmp/test-helpers_0.2.0_1786820380598_0.13689544624606942","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@burojs/test-helpers","version":"0.3.0","license":"MIT","_id":"@burojs/test-helpers@0.3.0","maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"dist":{"shasum":"16a2e8b62ecb16bfc1709c6e53dc7a1dd59f7efa","tarball":"https://registry.npmjs.org/@burojs/test-helpers/-/test-helpers-0.3.0.tgz","fileCount":9,"integrity":"sha512-GJi7MuCjO5Y+UuRNxy0YKmbB05p4V+wVctmQEzn8gDOvndZqAO8MHNlpLkuiH9wVDii7sZF+mYzyVCAc0XBE5Q==","signatures":[{"sig":"MEUCIBmCant+NwocHsIGdTYBbrZF4r8meyOZ+6KaJqb0E/OUAiEA8GTRdJCD+yxcmhDJszsVLHgL6UpfudmgGsu0cSJLVdA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135558},"main":"./dist/index.cjs","type":"module","_from":"file:burojs-test-helpers-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit","typecheck:tests":"tsc -p tsconfig.test.json"},"_npmUser":{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"},"_resolved":"/tmp/4400f7f9599ffbbd01b983aa68c35a16/burojs-test-helpers-0.3.0.tgz","_integrity":"sha512-GJi7MuCjO5Y+UuRNxy0YKmbB05p4V+wVctmQEzn8gDOvndZqAO8MHNlpLkuiH9wVDii7sZF+mYzyVCAc0XBE5Q==","_npmVersion":"10.9.8","description":"Buro: typed Playwright Page Objects over the testid convention","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@burojs/core":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^4.0.0","typescript":"^5.5.0","expect-type":"^1.1.0","@burojs/tooling-eslint":"0.0.0","@burojs/tooling-tsconfig":"0.0.0"},"peerDependencies":{"vitest":"^2.1.0 || ^3.0.0 || ^4.0.0","@playwright/test":"^1.49.0"},"_npmOperationalInternal":{"tmp":"tmp/test-helpers_0.3.0_1786874027274_0.3502750039499667","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"_id":"@burojs/test-helpers@0.4.0","dist":{"shasum":"47538373944fb8a93727bd6c4590bc758c3374eb","tarball":"https://registry.npmjs.org/@burojs/test-helpers/-/test-helpers-0.4.0.tgz","fileCount":15,"integrity":"sha512-mhflWNZZ3RXrljSZNJkZYKAH4cVzk0gqUg6rKpg3FUii6uaUi57s2RZ9oUCCvxw3/kHulCg+7Ot4XeLVOJIcfg==","signatures":[{"sig":"MEUCIQD8hMOcMlX5nsNUFuRxdSUSeoVl/gfG9WCewPsmWfM+ewIgcgnwxEmMWdf48+M6iT1k883e1prKj+ttWb829OXQEpE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDkoKvcocMAEalNqTpDzjFxoYbRi10naXNKW8p8NFRcuAiEAkVqMvzvLC80CdUWBe4jMR4PCPUr97xfjCk6JgsqibvE="}],"unpackedSize":226836},"main":"./dist/index.cjs","name":"@burojs/test-helpers","type":"module","_from":"file:burojs-test-helpers-0.4.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json","./provider-contract":{"import":{"types":"./dist/provider-contract.d.ts","default":"./dist/provider-contract.js"},"require":{"types":"./dist/provider-contract.d.cts","default":"./dist/provider-contract.cjs"}}},"license":"MIT","scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit","typecheck:tests":"tsc -p tsconfig.test.json"},"version":"0.4.0","_npmUser":{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"},"_resolved":"/tmp/298c51388b20504f8a6e0458d5205e7e/burojs-test-helpers-0.4.0.tgz","_integrity":"sha512-mhflWNZZ3RXrljSZNJkZYKAH4cVzk0gqUg6rKpg3FUii6uaUi57s2RZ9oUCCvxw3/kHulCg+7Ot4XeLVOJIcfg==","_npmVersion":"10.9.8","description":"Buro: typed Playwright Page Objects over the testid convention","directories":{},"maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"@burojs/core":"0.4.0"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"provider-contract":["./dist/provider-contract.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.0","typescript":"^5.5.0","expect-type":"^1.1.0","@burojs/tooling-eslint":"0.0.0","@burojs/tooling-tsconfig":"0.0.0"},"peerDependencies":{"vitest":"^2.1.0 || ^3.0.0 || ^4.0.0","@playwright/test":"^1.49.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/test-helpers_0.4.0_1790626445790_0.11501703180186729"}}},"time":{"created":"2026-08-15T18:59:40.431Z","modified":"2026-09-28T20:14:06.093Z","0.2.0":"2026-08-15T18:59:40.752Z","0.3.0":"2026-08-16T09:53:47.434Z","0.4.0":"2026-09-28T20:14:05.901Z"},"license":"MIT","description":"Buro: typed Playwright Page Objects over the testid convention","maintainers":[{"name":"maksimkuznetsov","email":"mak.kooz@gmail.com"}],"readme":"# @burojs/test-helpers\n\nTyped [Playwright](https://playwright.dev) page objects for [buro](https://github.com/buro/buro) apps, built over the framework's stable `data-testid` convention.\n\nBecause buro generates its own test ids (`list-row:<resource>:<id>`, `picker-quickcreate:<resource>`, …), your e2e tests can address a screen you never hand-wrote.\n\n## Install\n\n```bash\npnpm add -D @burojs/test-helpers @playwright/test\n```\n\n## Usage\n\n```ts\nimport { test, expect } from '@playwright/test';\nimport { createBuroPage } from '@burojs/test-helpers';\n\ntest('a document can be filtered and opened', async ({ page }) => {\n  const app = createBuroPage(page);\n  const documents = app.resource('document_document');\n\n  const list = documents.list();\n  await list.goto();\n  await list.search().fill('invoice');\n  await list.paginationNext().click();\n\n  await expect(documents.show('42').field('title').input()).toBeVisible();\n});\n```\n\nEvery locator above is derived from the resource name, so none of these test ids are hand-written in your app.\n\n## Main exports\n\n- **`createBuroPage` / `BuroPage`** — the entry point; wraps a Playwright `Page`. Exposes `resource(name)`, `contextPicker(slice)`, `notification(type)`, `actionConfirm(resource, scope, action)` and the raw `page`.\n- **`createResourceObject` / `ResourceObject`** — one resource's four surfaces: `list()`, `create()`, `edit(id)`, `show(id)`, plus `picker()`.\n- **`createFormView` / `FormView` / `FormFieldObject`** — form fields across create/edit/show: `field(name).input()`, `.error()`, `.help()`, and `section(key)`.\n- **`createShowView` / `ShowView`** — the detail surface (a `FormView` in `show` mode).\n- **`createPickerObject` / `PickerObject`** — relation pickers, including quick-create.\n- **`createConfirmDialog` / `ConfirmDialogObject`** — confirmation dialogs raised by declared actions.\n\nThe list surface (`documents.list()`) covers `goto()`, `row(id)`, `rows()`, `column(field)`, `columnMenu(field)` / `columnSort(field, direction)`, `search()`, `paginationPrev()` / `paginationNext()`, and the filter builder: `filterButton()`, `filterPanel()`, `filterAddRow(groupPath?)`, `filterRowField(path)` / `filterRowOp(path)` / `filterRowValue(path)`, `filterApply()`, `filterReset()`, `filterBadge(index)` / `filterBadgeRemove(index)`, `filterClearAll()` and `filterPinned(field)`.\n\n`rows()` and `column(field)` address a SET — every rendered row, or one column across all of them. They are what a count or an ordering assertion is built on (`await expect(list.rows()).toHaveCount(10)`), and they cannot go through `getByTestId`: those ids embed a record id, so the set is only addressable by prefix.\n\n## Provider contract — a separate entry point\n\n`dataProviderContract` (the vitest suite an adapter author runs against a `DataProvider`) lives at `@burojs/test-helpers/provider-contract`, not at the package root:\n\n```ts\nimport { dataProviderContract } from '@burojs/test-helpers/provider-contract';\n```\n\nIt registers a vitest suite, so it imports `vitest` at module scope. `@vitest/expect` and `@playwright/test` both install `Symbol($$jest-matchers-object)` on `globalThis` and the second to load throws `TypeError: Cannot redefine property` — so a root entry carrying both would make the page objects unimportable from a Playwright spec. Page objects at the root, provider contract at its own path; nothing needs both in one process.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}