Step Definitions

A step definition is a piece of JavaScript that maps a plain English Gherkin phrase (for example When I press "Submit") to a Playwright action or assertion. Webship-js ships 411 built-in steps across 36 step files, so Product Owners, PMs, QA, CQ, DevOps, and automation engineers can author end-to-end tests without writing custom code.

The four sections below organise every step group by how teams use them. Click any card to see the full step list with role-targeted explanations and examples.

User journeys

How the visitor moves through your site and interacts with the page.

Outcome verification

What the page shows, how it is structured, what the server returned.

APIs and data formats

Drive REST endpoints, inspect JSON, XML, and YAML payloads directly from Gherkin.

Test resilience and instrumentation

Smart waits, mocked dependencies, accessibility audits, visual evidence, debug hooks.

WaitsSmart waits, edge waits, never sleep.Clockpage.clock install, advance, pause, set. Deterministic time.NetworkRoute stubs, mocks, delays, offline mode.StorageLocal and session storage assertions.CookiesCookie existence and value assertions.Auth stateSave and restore storageState for session re-use.JavaScript errorsTrack and assert clean console.AccessibilityPOUR smoke checks: alt text, labels, landmarks, focus, lang.IframesFrame switching and frame-scoped interactions.File downloadsCapture downloads and assert filename / content.Selector registryNamed CSS and XPath plus 22 CMS / framework presets.Responsive viewportsNamed breakpoints (xs to xxxl) plus explicit sizing.ScreenshotsManual capture, auto-on-failure, per-step hooks.Video recordingPlaywright recordVideo with start, stop, save steps.DebugPrint URL, last response. Pause for inspection.

Where the steps live

Source code: tests/step-definitions/<group>.steps.js. Every file exports a JSDoc block with at least five Gherkin examples per step, and every step phrasing supports the pronoun prefix (I |we )* so your scenarios read naturally in either voice.