Skip to main content

Interactive

REPL

Since v1.0.0

By default, Gwen will run in interactive mode which means it will start the REPL console as soon as it finishes executing features. This allows you to interactively enter commands to analyse the state of the environment or to continue entering additional steps. This is useful for testing the execution of features and verifying additional steps you want to add.

Debugging

Breakpoints

Since v3.2.0

Breakpoints can be added to any feature or meta steps by prefixing their expressions with @Breakpoint . These are ignored unless debugging is explicitly enabled with the -d|--debug CLI option.

Example

Breakpoint in feature file

File: 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 @Breakpoint the list will contain 2 items
info

To activate breakpoints, launch Gwen in debug mode by specifying the -d|--debug CLI option.

When a breakpoint on a step is encountered and debugging is enabled, Gwen will pause execution, open the REPL, and prompt the user to continue execution from that step or to quit (or to perform other REPL operations).

Sample breakpoint prompt in REPL
Feature: Add todo items

Scenario: Create todo list
Given a new todo list [6s 344ms] Passed
When the following items are added
| Item |
| Get the milk |
| Walk the dog | [2s 200ms] Passed

Paused at features/todo.feature:9
Then the list will contain 2 items

Enter c to continue or q to quit (or type help for more options)..

gwen> _