prashant-ramcharan / courgette-jvm-spring-example

Courgette-JVM with Cucumber Spring Example
3 stars 1 forks source link

Is is possible when setting runlevel to FEATURE, every feature only open browser once #1

Closed shellphxiao closed 4 years ago

shellphxiao commented 4 years ago

hi @prashant-ramcharan may I ask you a question? currently, I set the runLevel = CourgetteRunLevel.FEATURE There are many scenarios for each feature I found that, every Scenario will open the browser, I think for one feature just need to open browser once, my features file has more than 30 scenarios, so the script spends a lot of time opening the browser and logging in portal Is is possible every feature only open browser once and run all scenarios with this browser?

prashant-ramcharan commented 4 years ago

Hi @shellphxiao,

For each scenario in the feature file, Courgette creates a new JVM to run the test so it wont be possible to share a single driver / browser across multiple JVMs.

It's often best practice to start tests from a clean state (i.e. have the scenario open its own browser) instead of having to cleanup / reset the state of the browser before each scenario executes.

shellphxiao commented 4 years ago

thanks @prashant-ramcharan I seem to understand.