Behat
Vortex uses Behat for Behavior-Driven Development (BDD) testing. Behat allows to write human-readable stories that describe the behavior of the application. Behat tests primarily focus on critical user journeys, serving as comprehensive end-to-end validations.
Vortex provides full Behat support, including configuration in behat.yml
and a browser container to run tests interactively in a real browser with
a VNC viewer.
Additional features include:
- Behat Drupal Extension - an extension to work with Drupal.
- Behat Steps - a library of re-usable Behat steps.
- Behat Screenshot - extension to capture screenshots on-demand and on failure.
- Behat Progress formatter - extension to show progress as TAP and failures inline.
- Parallel profiles - configuration to allow running tests in parallel.
Running tests
- Ahoy
- Docker Compose
# Run all Behat tests
ahoy test-bdd
# Run specific feature file
ahoy test-bdd tests/behat/features/homepage.feature
# Run scenarios with specific tag
ahoy test-bdd -- --tags=@smoke
# Run all Behat tests
docker compose exec cli vendor/bin/behat
# Run specific feature file
docker compose exec cli vendor/bin/behat tests/behat/features/homepage.feature
# Run scenarios with specific tag
docker compose exec cli vendor/bin/behat -- --tags=@smoke
Discovering available step definitions
- Ahoy
- Docker Compose
# Generate step definitions reference
ahoy test-bdd -- --definitions=l
# Generate step definitions reference
docker compose exec cli vendor/bin/behat -- --definitions=l
FeatureContext
The FeatureContext.php file comes with
included steps from Behat steps package.
You can add your custom steps into this file.
Profiles
Behat's default profile configured with sensible defaults to allow running it
with provided extensions.
In continuous integration environment, the profile can be overridden using
$VORTEX_CI_BEHAT_PROFILE environment variable.