Search in sources :

Example 6 with LoadingTimes

use of com.hribol.automation.core.utils.LoadingTimes in project selenium_java by sergueik.

the class ReplayBrowserTest method replayInvokesExecutionExecuteMethod.

@Test
public void replayInvokesExecutionExecuteMethod() throws InterruptedException, IOException, URISyntaxException {
    ApplicationActionFactory applicationActionFactory = Mockito.mock(ApplicationActionFactory.class);
    TestScenario testScenario = Mockito.mock(TestScenario.class);
    WebDriverActionExecution webDriverActionExecution = Mockito.mock(WebDriverActionExecution.class);
    LoadingTimes loadingTimes = Mockito.mock(LoadingTimes.class);
    Mockito.when(webDriverActionExecution.getLoadingTimes()).thenReturn(loadingTimes);
    ReplayBrowser replayBrowser = new ReplayBrowser(applicationActionFactory);
    replayBrowser.replay(testScenario, webDriverActionExecution);
    Mockito.verify(webDriverActionExecution).execute(testScenario);
}
Also used : ApplicationActionFactory(com.hribol.automation.core.execution.application.ApplicationActionFactory) TestScenario(com.hribol.automation.core.execution.executor.TestScenario) WebDriverActionExecution(com.hribol.automation.replay.WebDriverActionExecution) LoadingTimes(com.hribol.automation.core.utils.LoadingTimes) ReplayBrowser(com.hribol.automation.replay.ReplayBrowser) Test(org.junit.Test)

Example 7 with LoadingTimes

use of com.hribol.automation.core.utils.LoadingTimes in project selenium_java by sergueik.

the class ReplayBrowserTest method replayFromFileInvokesExecutionExecuteMethod.

@Test
public void replayFromFileInvokesExecutionExecuteMethod() throws InterruptedException, IOException, URISyntaxException {
    ApplicationActionFactory applicationActionFactory = Mockito.mock(ApplicationActionFactory.class);
    TestScenario testScenario = Mockito.mock(TestScenario.class);
    WebDriverActionExecution webDriverActionExecution = Mockito.mock(WebDriverActionExecution.class);
    LoadingTimes loadingTimes = Mockito.mock(LoadingTimes.class);
    Mockito.when(webDriverActionExecution.getLoadingTimes()).thenReturn(loadingTimes);
    TestScenarioFactory testScenarioFactory = Mockito.mock(TestScenarioFactory.class);
    String pathToSerializedTest = "testcase.json";
    Mockito.when(testScenarioFactory.createFromFile(applicationActionFactory, pathToSerializedTest)).thenReturn(testScenario);
    ReplayBrowser replayBrowser = new ReplayBrowser(applicationActionFactory, testScenarioFactory);
    replayBrowser.replay(pathToSerializedTest, webDriverActionExecution);
    Mockito.verify(webDriverActionExecution).execute(testScenario);
}
Also used : ApplicationActionFactory(com.hribol.automation.core.execution.application.ApplicationActionFactory) TestScenario(com.hribol.automation.core.execution.executor.TestScenario) WebDriverActionExecution(com.hribol.automation.replay.WebDriverActionExecution) LoadingTimes(com.hribol.automation.core.utils.LoadingTimes) TestScenarioFactory(com.hribol.automation.core.execution.executor.TestScenarioFactory) ReplayBrowser(com.hribol.automation.replay.ReplayBrowser) Test(org.junit.Test)

Aggregations

LoadingTimes (com.hribol.automation.core.utils.LoadingTimes)7 Test (org.junit.Test)5 ApplicationActionFactory (com.hribol.automation.core.execution.application.ApplicationActionFactory)4 TestScenario (com.hribol.automation.core.execution.executor.TestScenario)4 ReplayBrowser (com.hribol.automation.replay.ReplayBrowser)4 WebDriverActionExecution (com.hribol.automation.replay.WebDriverActionExecution)4 TestScenarioFactory (com.hribol.automation.core.execution.executor.TestScenarioFactory)2 WebDriverAction (com.hribol.automation.core.actions.WebDriverAction)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 TimeoutException (org.openqa.selenium.TimeoutException)1