bwowk / behat-overlook-extension
Behat extension to keep testing a Scenario outcomes after one of them fails.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 8 320
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- behat/behat: ^3.0
Requires (Dev)
- phpspec/phpspec: ^3.4
- phpunit/phpunit: ^6.2
- symfony/process: ^3.3
This package is not auto-updated.
Last update: 2023-04-29 21:06:21 UTC
README
Turn a blind eye on those failing steps 🙈
TL;DR intro: Your steps won't be skipped after a failing one.
Installing
Do it with composer:
composer require bwowk/behat-overlook-extension
Setting up
Just this will do:
default: extensions: bwowk\Behat\OverlookExtension: overlook_tag: overlook
Usage
Just put a @overlook tag on the scenarios where you want to prevent your Then
steps from being skipped over after a failure:
@overlook Scenario: Keep Running steps Given a passing step When a step succeeds Then a step fails But the following step succeeds And all of them run
you can also put the tag above the Feature declaration so it works for all of the Scenarios in that feature:
@overlook Feature: Fail more
But there's a catch
If there are other action steps (Given|When) after your failing Thens, they will be skipped. It wouldn't make sense to try and keep running the flow if the previous assertions failed, because the Scenario didn't reach the desired state on that part:
Motivation
The Overlook Extension makes it possible to run multiple assertions on the outcomes of a Scenario without fearing to have several steps obscured after one of them fails.
This helps keeping your Scenarios on the line without a whole lot of redundancy. If your Then
steps just test the outcomes of your scenario, they shouldn't affect the state which it reached by means of their Given
and When
steps, so why stop there?
It was inspired by an old goodie from Google's testing blog on the importance of seeing more failures by test.