协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
quality-engineering-playwright-pom-generation【开发与工程】Generates Playwright page objects from an executable test plan, one class per screen with ladder-compliant locators and no assertions, wired into a shared fixture. Use when a web scenario needs a page object that does not exist yet, or when locators drift and the page object must be rebuilt.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
A web-lane scenario block from docs/srs/test-plan-[slug].md (Steps, Expected, @AC-n) plus the resolved SELECTOR_GAPS for that screen. Generate from the plan, never from a live DOM crawl alone: the plan says which elements matter.
tests/pages/<screen>.page.ts, class <Screen>Page (e.g. CheckoutPage).submitButton, emailInput).fillShipping(data), submit()); actions return void or the next page object.pages fixture in tests/fixtures.ts exposes every page object; specs import test from there, never from @playwright/test directly.Follow the web ladder in quality-engineering-selector-stability: getByRole / getByLabel first, then getByTestId using the <screen>-<element>-<role> id, then attribute CSS. Never XPath, nth, text on translated strings, or generated class names. When the element has no stable locator, do not invent one: record it as a selector gap for specialist-testid-inserter.
Page objects expose state (orderId(), isVisible()), specs assert on it. An expect inside a page object hides the assertion from the scenario and breaks reuse across positive and negative cases.
Expected to a state getter.Selector Gaps in the output.pages fixture.npx tsc --noEmit -p tests (or the repo's typecheck) and the seed spec once.expect belongs in the spec.tests/pages/ before creating; extend the existing class.page in specs: every interaction goes through a page object or the seed.