Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to setup a feature with multiple scenarios? #67

Open
vuhi opened this issue Aug 7, 2019 · 2 comments
Open

How to setup a feature with multiple scenarios? #67

vuhi opened this issue Aug 7, 2019 · 2 comments

Comments

@vuhi
Copy link

vuhi commented Aug 7, 2019

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:

  • Will the step file run each scenario independently?
  • Is it possible to run each scenario independently in just one step file?
  • If not, how can I run each scenario independently (setup config, file)?
@rahulkedia1409
Copy link

@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
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants