Skip to main content

gwen

Specifications Driven Automation

Declare features

Write feature specs to describe how scenarios should behave.

File: gwen/features/todo.feature

Feature: Add todo items

Scenario: Create todo list
Given a new todo list
When the following items are added
| Item |
| Get the milk |
| Walk the dog |
Then the list will contain 2 items

Compose meta

Write meta specs to describe how steps will execute.

File: gwen/features/todo.meta

Feature: Todo Meta

@Context
@StepDef
Scenario: a new todo list
Given my todo list can be located by css ".todo-list"
When I navigate to "https://todomvc.com/examples/react/dist"
Then the page title should contain "TodoMVC"
And my todo list should not be displayed

@Action
@DataTable
@ForEach
@StepDef
Scenario: the following items are added
Given the todo field can be located by class "new-todo"
When I enter Item in the todo field
Then my todo list should contain Item

@Assertion
@StepDef
Scenario: the list will contain <expected-count> items
Given the item count can be located by css ".todo-count"
Then the item count should contain "$<expected-count>"
And my todo list should be displayed

Gwen logoGwen logo

Launch Gwen

Launch Gwen to automate execution.

Quick setup (see getting started)
yarn add -D @gweninterpreter/gwen-web
yarn gwen init
cp -R gwen/samples/* gwen/features
Execute one feature spec
yarn gwen -b gwen/features/todo.feature
Execute all feature specs in a directory
yarn gwen -b gwen/features