Steps available out of the box

Description

Here one could find description of the steps that are delivered with Vividus itself without any plugins required.

While-like steps executor

Info

Executes steps until condition or iteration limit reached.

If iteration limit is reached no failure or exception will occur.

Wording

Main:

When I execute steps at most $max times while variable `$variableName` is $comparisonRule `$expectedValue`:$stepsToExecute

Alias:

When I execute steps at most $max times while variable '$variableName' is $comparisonRule '$expectedValue':$stepsToExecute

Parameters

  1. $max - defines how many iteration could be executed

  2. $variableName - a name of the variable to check

  3. $comparisonRule - Comparison rule

  4. $expectedValue - expected value of the variable

  5. $stepsToExecute - examples table with a single column containing the steps

Usage

Example 1. ExecuteWhile.story
Scenario: Click button 5 times
Given I am on a page with the URL 'https://vividus-test-site.herokuapp.com/mouseEvents.html'
When I execute steps at most 5 times while variable `var` is < `3`:
|step                                                                                                                   |
|When I click on element located `id(counter)`                                                                          |
|When I find <= `1` elements by `xpath(//div[@id='clickResult' and (text()='3' or text()='4')])` and for each element do|
|{headerSeparator=!,valueSeparator=!}                                                                                   |
|!step!                                                                                                                 |
|!When I set the text found in search context to the 'scenario' variable 'var'!                                         |
Then `${var}` is = `3`