Examples · Atlas Payments demo project

Example: checkout test cases from the spec

A tester gets a test case per checkout scenario, sees requirements without an error case, writes steps and exports them to Xray, TestRail or Azure.

For
QA
Time
About 20 minutes
Plan
The Tests tab, coverage and the traceability matrix are free. Editing steps, steps from your agent and every export need Solo Pro or Team.

The checkout spec of Atlas Payments says what checkout must do, as requirements with scenarios. Each scenario is already a test: a situation and an expected outcome. This example turns them into test cases without retyping them.

You start with: the Atlas Payments project linked on this computer, and its checkout spec:

openspec/specs/checkout/spec.md
### Requirement: Card authorization
When a customer submits the card form, the system SHALL authorize the cart total with the acquirer and show the
receipt within 3 seconds at p95.

#### Scenario: Authorized
- **WHEN** a customer pays a 42.00 EUR cart with a valid Visa card
- **THEN** the payment is authorized for 4200 minor units and the receipt is shown

#### Scenario: Declined
- **WHEN** the acquirer declines the card
- **THEN** the cart is kept and the form shows the decline reason without the card number

1. Open the Tests tab#

Open the project and choose the Tests tab, scope Specs. Every #### Scenario: of the main specs is one test case under its requirement, with its WHEN and THEN lines as steps. Authorized and Declined above are two test cases of Card authorization. Each gets an id such as TC-3f9a1c02 that survives archiving its change. Copy id puts it in a ticket or a test.

The Tests tab: scope Specs, 10 of 10 requirements with a test case and 7 without an error case, and the test case Authorized open with its id, the requirement it checks and steps from the spec

2. Find the gaps#

Above the list the tab counts the requirements with no test case, no error case or a spec changed since the steps were saved. Here every requirement has a test case, but 7 have no error case: Currency display, for example, says nothing about an unknown locale. Choose the count to show only those requirements. With a test case open, Suggest missing cases asks your agent for scenarios to copy into the spec. You close the gap in the spec itself, and the test cases follow from it.

3. Steps and test data#

Edit steps opens the test case as Gherkin lines with | name | value | tables for test data, or Ask agent for steps proposes them as a card you take with Apply. Saved steps go to openspec/test-cases/checkout.feature, never into the spec. When the scenario changes later, the test case shows Spec changed until you update it and choose Mark as reviewed.

4. Export and trace#

Export saves the test cases in view as Gherkin, Xray CSV, TestRail CSV or Azure Test Plans CSV: one row per step, each title ending with its id, so you can find it after the import. The Matrix view shows, per requirement, the change it comes from, its tasks, its linked issues and its test cases, marked Traced, In progress or Gap.

The Matrix view of the Tests tab: gap filters with counts and one row per requirement with its change, tasks done, linked issues, test case ids and status

What you have now#

  • One test case per scenario of the spec, with ids that stay stable.
  • A list of requirements without an error case, to close in the spec.
  • Steps in a .feature file in the repository, and an import file for your test management tool.

Read more in Test cases.