Skip to main content

YAML Test Format

The simplest way to write browser tests.

Example

name: TodoMVC Tests
url: https://demo.playwright.dev/todomvc/

tests:
  - name: Add todo item
    tags: [smoke]
    steps:
      - Navigate to the TodoMVC home page
      - Add a new todo item "Buy groceries"
      - Verify "Buy groceries" appears in the todo list

  - name: Complete and filter todos
    tags: [smoke, regression]
    steps:
      - Navigate to the TodoMVC home page
      - Add three todo items "Task 1", "Task 2", and "Task 3"
      - Mark the first todo as completed
      - Click the Active filter
      - Verify 2 active todos are shown

Schema

FieldRequiredDescription
nameYesTest suite name
urlNoBase URL for all tests
testsYesArray of test cases
tests[].nameYesIndividual test name
tests[].tagsNoTags for filtering
tests[].stepsYesNatural language steps

Running

npm test
Filter by tag:
npm test -- --grep @smoke

Writing Steps

Steps are natural language instructions. Be specific:
- Navigate to "https://example.com/login"
- Enter "user@test.com" in the email field
- Click the "Sign In" button
- Verify "Dashboard" appears in the heading

Tips

  • Include URLs in navigation steps
  • Use quotes for specific text values
  • Be explicit about what to verify