Search in sources :

Example 6 with ApplicationActionFactory

use of com.hribol.automation.core.execution.application.ApplicationActionFactory 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 ApplicationActionFactory

use of com.hribol.automation.core.execution.application.ApplicationActionFactory 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

ApplicationActionFactory (com.hribol.automation.core.execution.application.ApplicationActionFactory)7 Test (org.junit.Test)7 TestScenario (com.hribol.automation.core.execution.executor.TestScenario)5 LoadingTimes (com.hribol.automation.core.utils.LoadingTimes)4 ReplayBrowser (com.hribol.automation.replay.ReplayBrowser)4 WebDriverActionExecution (com.hribol.automation.replay.WebDriverActionExecution)4 TestScenarioFactory (com.hribol.automation.core.execution.executor.TestScenarioFactory)3 ApplicationConfiguration (com.hribol.automation.core.config.ApplicationConfiguration)2 ApplicationAction (com.hribol.automation.core.execution.application.ApplicationAction)2 DefaultApplicationActionFactory (com.hribol.automation.core.execution.application.DefaultApplicationActionFactory)2 WebDriverAction (com.hribol.automation.core.actions.WebDriverAction)1 ApplicationActionConfiguration (com.hribol.automation.core.config.ApplicationActionConfiguration)1 TestCaseToApplicationActionConverter (com.hribol.automation.core.execution.application.TestCaseToApplicationActionConverter)1 TestScenarioFactoryImpl (com.hribol.automation.core.execution.executor.TestScenarioFactoryImpl)1 WebDriverActionFactory (com.hribol.automation.core.execution.factory.WebDriverActionFactory)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1