mirror of
https://github.com/tester-army/e2e.git
synced 2026-11-21 03:05:26 +08:00
* feat!: browser fixture, getByRole name arg, toMatchSchema, top-level hooks, separate credential namespace API review feedback before launch: - web fixture renamed browser (Web -> Browser, WebExpectation -> BrowserExpectation); requires: ['browser']; destructuring web hints the new name. web() factory and other Web* types unchanged. - getByRole(role, name, options?) beside the object form; MCP locate writes the short form. - expect(value).toMatchSchema(standardSchema): sync, returns the typed output; poll resolves to it, soft returns undefined after a kept failure. - describe, beforeEach, afterEach, beforeAll, afterAll exported from e2e; web and mobile export typed beforeEach/afterEach. - credentials and secrets are separate namespaces: a password handle is <name>.password, secrets.get() never returns it. Committed recordings migrated offline (old key hash verified, then recomputed). - runtime test.skip keeps Playwright semantics; docs say it throws. * docs(web): browser acts on one active tab; cookies, routes, dialogs cover the whole browser * fix(secrets): judge a fill's purpose by the config, not the handle; no old-name hints A config-time secrets.get() handle reads its purpose from the run's registry again, and authorizeSecretFill checks the registered purpose, so a handle claiming generic-secret cannot put a password into a plain field. Drop the web fixture migration hint. Changesets name the on-screen marker change for replay entries. * docs(skill): browser fixture, getByRole name arg, toMatchSchema, top-level hooks, credential namespace on the rewritten skill * fix(expect): negated toMatchSchema returns nothing, as its type says * fix(expect,docs): soft double negation stays soft, null ~standard is INVALID_ARGUMENT, Playwright samples keep Playwright's getByRole Also documents SoftExpectCall, SoftValueExpectation, and NegatedPollExpectation on the expect reference, requires: ['browser'] in the skill's options table, and tightens the poll and secret-purpose tests. * docs(babysit): triage pattern for scripted renames that rewrite another library's code * docs: engine options take a secrets entry, web package hook exports, vault example imports * refactor(secrets)!: credentials hold their password, allSecrets feeds fills; engines export describe and every hook; BrowserRoute, BrowserResponse From the maintainability review: - ResolvedConfig.secrets is the config.secrets entries only; a credential carries its password; allSecrets is the one map fills, the ledger, and redaction read. The per-consumer purpose filters and the .password suffix parsing are gone, and e2e mcp builds handles from config. - The config load and a running test name the credential a missing secrets.get() most likely meant. - @e2e-dev/web and @e2e-dev/mobile export describe and all four hooks beside test, so a test file registers from one import. - WebRoute and WebResponse are BrowserRoute and BrowserResponse. - getByRole normalizes its arguments once; isTextMatch is the one string-or-RegExp check; poll reuses ValueMatcherName. * revert(web): keep WebRoute and WebResponse; Browser names the fixture, Web the network and option types
8 lines
198 B
TypeScript
8 lines
198 B
TypeScript
import { test } from '@e2e-dev/web';
|
|
import { expect } from 'e2e';
|
|
|
|
test('app opens', async ({ app, browser }) => {
|
|
await app.open('/');
|
|
await expect(browser.locator('body')).toBeVisible();
|
|
});
|