cancel
Showing results for 
Search instead for 
Did you mean: 

Run Scenario when ends another other one (JAVA)

SOLVED
AlexEscri
New Contributor

Run Scenario when ends another other one (JAVA)

Hello!

I'm running in parallel some scenarios, but i need run one when other ends...

 

I don't know if it is possible... I don't want do a so long scenario in gherkin, i want to start the second when the first was ended.

 

My run file:

import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;
import org.testng.annotations.DataProvider;


@CucumberOptions(
features = {"src/main/resources/features"},
plugin = {
"pretty",
"json:target/cucumber-reports/cucumber.json",
"html:target/cucumber-reports/cucumber-pretty.html",
"rerun:target/cucumber-reports/rerun.txt",
"junit:target/cucumber-reports/cucumber.xml",
},
glue = {"steps"},
tags = "@a",
monochrome = true
)
//@RunWith(Cucumber.class)
public class runParallel extends AbstractTestNGCucumberTests {
@Override
@DataProvider(parallel = true)
public Object[][] scenarios() {
return super.scenarios();
}

}

Thanks for all! 

1 ACCEPTED SOLUTION

Accepted Solutions
AlexEscri
New Contributor

Re: Run Scenario when ends another other one (JAVA)

Finally i found a solution for my scenario.

 

With a boolean, loop wihle and wait for element i do it.

 

Thanks!

View solution in original post

2 REPLIES 2
aslakhellesoy
Moderator

Re: Run Scenario when ends another other one (JAVA)

It's not possible to have one scenario depend on another Scenario in Cucumber. This is a deliberate design decision since coupling scenarios relies on side-effects, and this is known to produce non-deterministic behaviour for scenarios. (They can no longer be run in isolation).

------
I'm the creator and lead developer of Cucumber Open.
AlexEscri
New Contributor

Re: Run Scenario when ends another other one (JAVA)

Finally i found a solution for my scenario.

 

With a boolean, loop wihle and wait for element i do it.

 

Thanks!

View solution in original post

New Here?
Join us and watch the welcome video: