igniteram / protractor-cucumber-typescript

e2e kickstarter test framework which consists of protractor, cucumber frameworks using typescript lang!
MIT License
196 stars 170 forks source link

How to setup a feature with multiple scenarios? #67

Open vuhi opened 5 years ago

vuhi commented 5 years ago

Hello team, I am new to e2e. I have a feature file with multiple scenarios like this:

**Feature**: I would like to login

**Scenario**: Success Login (no active session)
Given ... scenario 1
Then ... scenario 1
When ... scenario 1

**Scenario**: Success Login (active session)
Given ... scenario 2
Then ... scenario 2
When ... scenario 2

**Scenario**: Failed Login
Given ... scenario 3
Then ... scenario 3
When ... scenario 3

I have a step file like this:

Given('... scenario 1, () => { });
Then ('... scenario 1, () => { });
When ('... scenario 1, () => { });

Given('... scenario 2, () => { });
Then ('... scenario 2, () => { });
When ('... scenario 2, () => { });

Given('... scenario 3, () => { });
Then ('... scenario 3, () => { });
When ('... scenario 3, () => { });

My questions are:

rahulkedia1409 commented 4 years ago

@igniteram Even i have setup my tests to run around this framework, can you please confirm if currently there is no support for scenario like this mentioned above? So as per now we have to write one scenario per feature file multiple scenario is not possible?

anilreddy commented 4 years ago

@vuhi and @rahulkedia1409 You can maintain multiple scenarios in one file and can run multiple scenarios at once or run each scenarios at once. Here, to run multiple you just need to run the feature file. But to run each scenario you need to add a tag to it

To know more about cucumber tag check this link: https://cucumber.io/docs/cucumber/api/#tags