Skip to main content

@svatah/yam-host-playwright

Playwright Test host for Yam flows: the yam fixture, generated specs and the results reporter

Exports

ExportKindSignature
Binderclassdeclare class BinderA bind() bound to one page.
BindModetypealiastype BindMode = "run" | "record" | "heal";
BindOptionsinterfaceinterface BindOptions
BindOutcomeinterfaceinterface BindOutcomeHow a bind() call was answered, for the reporter and the annotations.
bindTestvariabletest: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & YamOptions & YamFixtures, _playwright_test.Playwr
expectvariableexpect: Expect<{}>
FAILURE_ANNOTATIONvariableFAILURE_ANNOTATION = "yam-failure"The annotation a failing step leaves, so a report can group by class.
GeneratedSpecinterfaceexport interface GeneratedSpec
GenerateOptionsinterfaceexport interface GenerateOptions
generateSpecsfunctionexport function generateSpecs(options: GenerateOptions): GeneratedSpec[]Write one spec per flow that has something to run.
HEALED_ANNOTATIONvariableHEALED_ANNOTATION = "healed"The annotation a healed test leaves (REQ-HEAL-4).
modeFromEnvironmentfunctiondeclare function modeFromEnvironment(value: string | undefined): BindMode;YAM_MODE, defaulting to run (LLD §6.5).
renderSpecfunctionexport function renderSpec(The spec's text for one flow. Pure, so it can be asserted without a disk.
RESULTS_ATTACHMENTvariableRESULTS_ATTACHMENT = "yam-results"The attachment name the fixture uses and the reporter reads.
retriesAllowedfunctionexport function retriesAllowed(plan: Plan, storyName: string): booleanWhether retries are permitted for a story (LLD §9.1).
specNamefunctionexport function specName(flow: string): stringA flow file path as a spec file name: flows/simple.flowsimple.
testvariabletest = base.extend<
YamHostFixtureinterfaceexport interface YamHostFixture
YamHostFixturesinterfaceexport interface YamHostFixtures
YamHostOptionsinterfaceexport interface YamHostOptions
YamReporterclassexport default class YamReporter implements Reporter
YamReporterOptionsinterfaceexport interface YamReporterOptions