Skip to main content

Shared Setup and Dependencies

Each test should explain how it reaches the state it needs. TestVibe does not provide a feature-to-feature prerequisite picker, and selecting a group does not make its tests run in dependency order or share a browser session.

Reuse setup within a feature​

A Gherkin Background runs before each scenario in that feature. Use it for a short sign-in or navigation sequence that every scenario needs.

Feature: Account settings

Background:
Given I am on the "Sign in" page
When I enter "{{var:USERNAME}}" in the "Email" field
And I enter "{{secret:PASSWORD}}" in the "Password" field
And I click "Sign in"
And I open "Account settings"

Scenario: Update display name
When I change the display name to "QA User"
And I click "Save"
Then the display name should be "QA User"

A Markdown test can describe the same prerequisites in its opening instructions. Include the navigation and expected starting state rather than assuming another test already prepared the browser.

Prepare reusable data​

Store credentials in Variables & Secrets. Use stable test fixtures, or describe how the test creates and cleans up its own data. Values that must be new on every run can include {{unique}}.

For code-owned setup, use appropriate Playwright configuration or helpers and review them with your team. Sequential run options limit concurrency; they do not create a dependency relationship between tests.

When shared setup changes, review every affected test. Start with one test before running the group again.

See Gherkin and feature files and Choose browser, viewport, and configuration.