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.

0.1.1 2017-06-21 20:51 UTC

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.

Example

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:

Example

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.