Package org.jboss.arquillian.drone.webdriver.factory

Examples of org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory


    @Test
    public void when_reusable_session_is_created_then_is_can_be_pulled_from_session_store() throws Exception {

        // having
        RemoteWebDriverFactory factory1 = new MockRemoteWebDriverFactory();
        injector.get().inject(factory1);

        when(configuration.getBrowser()).thenReturn("xyz");
        when(configuration.isRemoteReusable()).thenReturn(true);
        when(configuration.getCapabilities()).thenReturn(desiredCapabilities);
        when(configuration.getRemoteAddress()).thenReturn(hubUrl);

        // when
        fire(new BeforeSuite());

        RemoteWebDriver webdriver1 = factory1.createInstance(configuration);
        factory1.destroyInstance(webdriver1);
        webdriver1.quit();

        // then
        ReusedSession reusedSession = sessionStore.get().pull(initializationParameter);
        assertNotNull("reusedSession must be stored", reusedSession);
View Full Code Here


    @Test
    public void when_session_is_created_and_persisted_but_nonreusable_then_next_creation_should_remove_it_from_list_of_reusable_sessions()
            throws Exception {

        // having
        RemoteWebDriverFactory factory1 = new MockRemoteWebDriverFactory();
        RemoteWebDriverFactory factory2 = new MockRemoteWebDriverFactory();
        injector.get().inject(factory1);
        injector.get().inject(factory2);

        when(configuration.getBrowser()).thenReturn("xyz");
        when(configuration.isRemoteReusable()).thenReturn(true);
        when(configuration.getCapabilities()).thenReturn(desiredCapabilities);
        when(configuration.getRemoteAddress()).thenReturn(hubUrl);

        // when
        fire(new BeforeSuite());

        // creates new session
        RemoteWebDriver webdriver1 = factory1.createInstance(configuration);
        // persists session into store
        factory1.destroyInstance(webdriver1);
        // makes driver non-reusable
        webdriver1.quit();

        // new suite
        fire(new BeforeSuite());
        // pulls non-reusable session from store, so creates new session
        RemoteWebDriver webdriver2 = factory2.createInstance(configuration);
        // quit newly created session
        factory2.destroyInstance(webdriver2);
        webdriver2.quit();
        // persists available sessions (none should be available)
        // persistEvent.fire(new PersistReusedSessionsEvent());

        // new suite
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.drone.webdriver.factory.RemoteWebDriverFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.