Search in sources :

Example 1 with SeleniumOverridesForTest

use of org.webpieces.webserver.test.SeleniumOverridesForTest in project webpieces by deanhiller.

the class SeleniumBasicTest method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
    Asserts.assertWasCompiledWithParamNames("test");
    //you may want to create this server ONCE in a static method BUT if you do, also remember to clear out all your
    //mocks after every test AND you can no longer run multi-threaded(tradeoffs, tradeoffs)
    //This is however pretty fast to do in many systems...
    WebserverForTest webserver = new WebserverForTest(new SeleniumOverridesForTest(), new AppOverridesModule(), true, null);
    webserver.start();
    port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
Also used : WebserverForTest(org.webpieces.webserver.WebserverForTest) SeleniumOverridesForTest(org.webpieces.webserver.test.SeleniumOverridesForTest) Before(org.junit.Before)

Example 2 with SeleniumOverridesForTest

use of org.webpieces.webserver.test.SeleniumOverridesForTest in project webpieces by deanhiller.

the class TestLesson4WithSelenium method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
    driver = new FirefoxDriver();
    Asserts.assertWasCompiledWithParamNames("test");
    jdbc.dropAllTablesFromDatabase();
    //you may want to create this server ONCE in a static method BUT if you do, also remember to clear out all your
    //mocks after every test and NOT drop tables but clear and re-populate
    Server webserver = new Server(new SeleniumOverridesForTest(), new AppOverridesModule(), new ServerConfig(0, 0, pUnit));
    webserver.start();
    httpPort = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
    httpsPort = webserver.getUnderlyingHttpsChannel().getLocalAddress().getPort();
}
Also used : FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) SeleniumOverridesForTest(org.webpieces.webserver.test.SeleniumOverridesForTest) Before(org.junit.Before)

Example 3 with SeleniumOverridesForTest

use of org.webpieces.webserver.test.SeleniumOverridesForTest in project webpieces by deanhiller.

the class TestPRGSelenium method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
    Asserts.assertWasCompiledWithParamNames("test");
    VirtualFileClasspath metaFile = new VirtualFileClasspath("beansMeta.txt", WebserverForTest.class.getClassLoader());
    WebserverForTest webserver = new WebserverForTest(new SeleniumOverridesForTest(), new AppOverridesModule(), true, metaFile);
    webserver.start();
    port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
Also used : WebserverForTest(org.webpieces.webserver.WebserverForTest) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) SeleniumOverridesForTest(org.webpieces.webserver.test.SeleniumOverridesForTest) Before(org.junit.Before)

Example 4 with SeleniumOverridesForTest

use of org.webpieces.webserver.test.SeleniumOverridesForTest in project webpieces by deanhiller.

the class TestScopesSelenium method setUp.

@Ignore
@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
    Asserts.assertWasCompiledWithParamNames("test");
    VirtualFileClasspath metaFile = new VirtualFileClasspath("scopesMeta.txt", WebserverForTest.class.getClassLoader());
    WebserverForTest webserver = new WebserverForTest(new SeleniumOverridesForTest(), null, true, metaFile);
    webserver.start();
    port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
Also used : WebserverForTest(org.webpieces.webserver.WebserverForTest) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) SeleniumOverridesForTest(org.webpieces.webserver.test.SeleniumOverridesForTest) Before(org.junit.Before) Ignore(org.junit.Ignore)

Example 5 with SeleniumOverridesForTest

use of org.webpieces.webserver.test.SeleniumOverridesForTest in project webpieces by deanhiller.

the class TestStaticSelenium method setUp.

@Before
public void setUp() throws InterruptedException, ClassNotFoundException {
    Asserts.assertWasCompiledWithParamNames("test");
    VirtualFileClasspath metaFile = new VirtualFileClasspath("staticMeta.txt", WebserverForTest.class.getClassLoader());
    WebserverForTest webserver = new WebserverForTest(new SeleniumOverridesForTest(), null, true, metaFile);
    webserver.start();
    port = webserver.getUnderlyingHttpChannel().getLocalAddress().getPort();
}
Also used : WebserverForTest(org.webpieces.webserver.WebserverForTest) VirtualFileClasspath(org.webpieces.util.file.VirtualFileClasspath) SeleniumOverridesForTest(org.webpieces.webserver.test.SeleniumOverridesForTest) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)5 SeleniumOverridesForTest (org.webpieces.webserver.test.SeleniumOverridesForTest)5 WebserverForTest (org.webpieces.webserver.WebserverForTest)4 VirtualFileClasspath (org.webpieces.util.file.VirtualFileClasspath)3 Ignore (org.junit.Ignore)1 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)1