browser-testing
Run, write, and troubleshoot Japa browser tests that use Playwright; use when you add or change frontend functionality that should be covered by tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run, write, and troubleshoot Japa browser tests that use Playwright; use when you add or change frontend functionality that should be covered by tests
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Testing guidelines. Use when writing or updating tests.
Caching with @adonisjs/cache (keys, tags, invalidation). Use when adding or debugging cache behavior.
Lucid models/migrations conventions and safe workflows. Use when changing schema or models.
Writing documentation. Use when key functionality is added or changed
Frontend rules conventions. Use when working with frontend-related tasks.
Background job conventions (BullMQ via @rlanz/bull-queue). Use when adding or editing jobs.
| name | browser-testing |
| description | Run, write, and troubleshoot Japa browser tests that use Playwright; use when you add or change frontend functionality that should be covered by tests |
Japa is built on Playwright, so you can use the methods from Playwright. See resources for more detailed Japa documentation.
node ace test browser runs the suite; limit files with --files tests/browser/smoketest.spec.ts.BROWSER_TIMEOUT (ms); defaults to 40000.tests/bootstrap.ts via testUtils.db().migrate() and reset DB state per test with testUtils.db().withGlobalTransaction().PWDEBUG=console node ace test browser
Alongside the page.pause method, you can use the page.pauseIf and page.pauseUnless methods to pause the script conditionally.
test('visit home page', async ({ visit }) => {
const page = await visit('/')
await page.pauseIf(process.env.DEBUG_TEST)
await page.pauseUnless(process.env.NO_DEBUG)
})
browserContext.loginAs(testUser) from tests/bootstrap.ts to seed sessions.tmp/browser/<suite>/<flow>/<step>.png via captureScreenshot in tests/browser/utils.ts (step can be 01-*). Take them only when the UI is idle to avoid empty or mid-animation shots.page.getByTestId/getByRole over CSS selectors; add data-testid on status badges/CTAs you need.page.evaluate for state checks; assert only on rendered UI.visit('/path'), then waitForLoadState('networkidle') before assertions.app.container.swap (e.g., fake MSAL that returns a callback URL).tests/bootstrap.ts, then reset each browser test with testUtils.db().withGlobalTransaction(). If suite wiring happens in tests/bootstrap.ts, attach the transaction hook per test via suite.onTest((test) => test.setup(() => testUtils.db().withGlobalTransaction())).