Browser closes after each test

213 views
Skip to first unread message

martin...@gmail.com

unread,
Dec 30, 2016, 3:23:00 AM12/30/16
to Serenity BDD Users Group
Some time ago you introduced ClearCookiesPolicy.never thtat con be used together with uniqueSession = true: @Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.Never).

This worked perfectly in the version 1.1.29-rc.1. Unfortunately you broke it in your latest version 1.2.2-rc.4. That is, the browser closes after each single test (not test class).


John Smart

unread,
Dec 30, 2016, 3:26:56 AM12/30/16
to martin...@gmail.com, Serenity BDD Users Group
Could you provide a sample project reproducing the issue?

On 30 December 2016 at 08:22, <martin...@gmail.com> wrote:
Some time ago you introduced ClearCookiesPolicy.never thtat con be used together with uniqueSession = true: @Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.Never).

This worked perfectly in the version 1.1.29-rc.1. Unfortunately you broke it in your latest version 1.2.2-rc.4. That is, the browser closes after each single test (not test class).


--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.
___________________________________________________

martin...@gmail.com

unread,
Dec 30, 2016, 4:09:52 AM12/30/16
to Serenity BDD Users Group, martin...@gmail.com
Of course:

import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;

import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.ClearCookiesPolicy;
import net.thucydides.core.annotations.Managed;

@RunWith(SerenityRunner.class)
public class MyTest {

   
   
@Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.Never)

   
private WebDriver webDriver;
   
   
@Test
   
public void test1(){
        webDriver
.navigate().to("http://www.google.com");
   
}
   
   
@Test
   
public void test2(){
        webDriver
.navigate().to("http://www.google.com");
   
}

}




Am Freitag, 30. Dezember 2016 09:26:56 UTC+1 schrieb John Smart:
Could you provide a sample project reproducing the issue?
On 30 December 2016 at 08:22, <martin...@gmail.com> wrote:
Some time ago you introduced ClearCookiesPolicy.never thtat con be used together with uniqueSession = true: @Managed(uniqueSession = true, clearCookies = ClearCookiesPolicy.Never).

This worked perfectly in the version 1.1.29-rc.1. Unfortunately you broke it in your latest version 1.2.2-rc.4. That is, the browser closes after each single test (not test class).


--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

martin...@gmail.com

unread,
Dec 30, 2016, 4:43:15 AM12/30/16
to Serenity BDD Users Group
By the way, in class FailureDetectingStepListener you initialize the attribtue private List<String> failureMessages = = Lists.newArrayList(); where Lists is in fact com.beust.jcommander.internal.Lists. I guess you wanted to use the Lists class of the guava package.
Message has been deleted
Message has been deleted
Message has been deleted

martin...@gmail.com

unread,
Jan 2, 2017, 6:48:20 AM1/2/17
to Serenity BDD Users Group
The problem still occurs using version 1.2.2-rc.5.

martin...@gmail.com

unread,
Jan 2, 2017, 8:13:26 AM1/2/17
to Serenity BDD Users Group
I found out one can use the property serenity.restart.browser.for.each with the values NEVER, FEATURE, STORY, SCENARIO, EXAMPLE in order to control whether when the browser should be closed. I really like this undocumented feature!!!!
You should make it public at http://www.thucydides.info/docs/serenity/.




Am Freitag, 30. Dezember 2016 09:23:00 UTC+1 schrieb martin...@gmail.com:

John Smart

unread,
Jan 2, 2017, 9:44:35 AM1/2/17
to Serenity BDD Users Group, martin...@gmail.com
Yeah, this feature is still under development, but works pretty well for never/feature/story and scenario - still a few quirks with the example mode. Documentation in the pipeline too ;-)

Reply all
Reply to author
Forward
0 new messages