serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Serenity-Cucumber, serenity.restart.browser.for.each = NEVER property is not working as expected #76

Closed kamit78 closed 7 years ago

kamit78 commented 7 years ago

Hi,

I'm using serenity with cucumber but currently serenity start new browser session after each feature

To avoid this behavior, I put serenity.restart.browser.for.each = NEVER in serenity.properties file but still browser restart after each feature.

Please help on it.

kamit78 commented 7 years ago

Anyone to help on it .... ?

wakaleo commented 7 years ago

How have you configured your test runner classes?

wakaleo commented 7 years ago

There will be one browser per test runner class. Also, if you are running tests in parallel, there will be one browser per thread.

kamit78 commented 7 years ago

Hi , Following is the test runner class. Two features are exist in separate files I want same browser session for both features

@RunWith(CucumberWithSerenity.class) @CucumberOptions( monochrome = true, features = "src/test/resources/glofeatures", //glue = "com.learn.cucumber.glo.features.steps", glue = "com.serenity.features.featuresteps", format = {"pretty", "html:target/cucumber-reports", "json:target/cucumber-reports/cucumber.json"} ) public class TestRunner {}

wakaleo commented 7 years ago

That configuration looks correct, there must be something else at play. Could you post your Serenity properties/config file?

kamit78 commented 7 years ago

Following are content of serenity properties file

jira.url=https://velocity-staging.globallogic.com/jira jira.project=VA jira.username= jira.password= jira.custom.field.1=Acceptance criteria serenity.take.screenshots=AFTER_EACH_STEP webdriver.timeouts.implicitlywait = 5000 serenity.restart.browser.for.each = NEVER webdriver.driver = provided webdriver.provided.type = mydriver webdriver.provided.mydriver = com.serenity.features.runner.DriveRunner serenity.driver.capabilities = mydriver serenity.use.unique.browser = true

wakaleo commented 7 years ago

Could you try without the custom driver?

kamit78 commented 7 years ago

Hi ,

Problem remains the same without custom driver. I have removed following properties from file

webdriver.driver = provided webdriver.provided.type = mydriver webdriver.provided.mydriver = com.serenity.features.runner.DriveRunner serenity.driver.capabilities = mydriver

and add webdriver.driver=chrome

running using mvn verify

but still browser session restart after each feature.

Let me know in case of any more details

kamit78 commented 7 years ago

Following are serenity related depencies in pom.xml file

<dependency>

net.serenity-bdd
        <artifactId>serenity-cucumber</artifactId>
        <version>1.1.23</version>

</dependency>

<dependency>

net.serenity-bdd
        <artifactId>serenity-junit</artifactId>
        <version>1.2.3-rc.3</version>

</dependency>

<dependency>

net.serenity-bdd
        <artifactId>serenity-jira-plugin</artifactId>
        <version>1.1.3-rc.2</version>

</dependency>

wakaleo commented 7 years ago

I can't reproduce this issue here. Could you provide a sample project that reproduces the issue?

kamit78 commented 7 years ago

Cucumber-Serenity.zip

kamit78 commented 7 years ago

Hi,

I have attached sample project in which I'm facing this problem.

kamit78 commented 7 years ago

Hi,

did you get chance to look into it

kamit78 commented 7 years ago

is it a bug in serenity ?

wakaleo commented 7 years ago

Hi.

You seem to value quick turn-around time for issues raised here. As this is an open source project, there is no SLA on issues raised (unless you fix them yourself ;-) ). If you need a consistently fast turn-around time, perhaps you would be interested in one of our support contracts?

kamit78 commented 7 years ago

Hi,

I'm sorry for hurry .... but I need help because I'm working on some initiative ....

Please take your time

Thank you very much

kamit78 commented 7 years ago

Hi,

It would be great help if I get your guidance to resolve it :)

Thanks

wakaleo commented 7 years ago

This is hard to fix at this stage; cucumber appears to run a feature in a new thread, and when the NEVER option will close the browser when the thread terminates. So this may not be solvable.

jeromevdl commented 7 years ago

You answered to me in #72 to look for #73 and to use serenity.restart.browser.for.each option, and here I see that cucumber does not care about it. So I don't understand : is it possible to avoid closing browser on each scenario ? I would like to close it after each feature, so i tried serenity.restart.browser.for.each=feature but it does not work.