Scenario and scenario diagram

Background:

I am currently writing behavior tests (Mink / Selenium) for the Symfony2 webpage. I have many examples to go through, and actually writing them should not be a problem. Step definitions have already been recorded.

However, in the examples, they define a Scenario: several times and a Scenario Outline: several times Scenario Outline:

Question:

What is the difference between these two ways of defining a test?

+6
source share
3 answers

From the official guide :

Copying and pasting scripts to use different values ​​can quickly become tedious and repetitive:

 Scenario: Eat 5 out of 12 Given there are 12 cucumbers When I eat 5 cucumbers Then I should have 7 cucumbers Scenario: Eat 5 out of 20 Given there are 20 cucumbers When I eat 5 cucumbers Then I should have 15 cucumbers 

Scenario outlines allow us to more concisely express these examples using a placeholder template.

 Scenario Outline: Eating Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples: | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 | 

Script steps are a template that never starts directly. The script schema is run once for each line in the Examples section below it (except for the first title line).

Read more in the Function Writing Guide .

+10
source

A script is what it is.

The script script uses placeholders for faster testing.

https://github.com/cucumber/cucumber/wiki/Scenario-Outlines

0
source

Intellij IDEA + Cucumber Support this, but I do not know if this is standard for everyone.

 Feature: LoginFeature This feature deals the login functionality of the application Scenario: Login with correct username and password Given I navigate to the login page And I enter the following for Login | username | password | | admin | adminpassword | | admin2 | adminpassword2 | | admin3 | adminpassword3 | | admin4 | adminpassword4 | | admin5 | adminpassword5 | And I click login button Then I should see the userform page 
0
source

Source: https://habr.com/ru/post/989791/


All Articles