use of com.seleniumtests.core.runner.SeleniumRobotTestPlan in project seleniumRobot by bhecquet.
the class TestSeleniumRobotTestPlan method testExecuteUftScriptFailure.
@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class, expectedExceptionsMessageRegExp = "UFT execution failed on script null")
public void testExecuteUftScriptFailure() throws Exception {
Map<String, String> params = new HashMap<>();
params.put("foo", "bar");
TestStep step = new TestStep("step", null, new ArrayList<String>(), false);
step.setFailed(true);
when(uft.executeScript(5, params)).thenReturn(Arrays.asList(step));
new SeleniumRobotTestPlan().executeUftScript(uft, 5, params);
}
use of com.seleniumtests.core.runner.SeleniumRobotTestPlan in project seleniumRobot by bhecquet.
the class TestSeleniumRobotTestPlan method testLoadUftScript.
@Test(groups = { "ut" })
public void testLoadUftScript() throws Exception {
PowerMockito.whenNew(Uft.class).withAnyArguments().thenReturn(uft);
Uft uftInstance = new SeleniumRobotTestPlan().loadUftScript("", "", "", "", "", "", false);
Assert.assertEquals(uftInstance, uft);
verify(uft).loadScript(false);
}
use of com.seleniumtests.core.runner.SeleniumRobotTestPlan in project seleniumRobot by bhecquet.
the class TestSeleniumRobotTestPlan method testExecuteUftScriptSuccess.
@Test(groups = { "ut" })
public void testExecuteUftScriptSuccess() throws Exception {
Map<String, String> params = new HashMap<>();
params.put("foo", "bar");
TestStep step = new TestStep("step", null, new ArrayList<String>(), false);
when(uft.executeScript(5, params)).thenReturn(Arrays.asList(step));
new SeleniumRobotTestPlan().executeUftScript(uft, 5, params);
verify(uft).executeScript(5, params);
// check test step is recorded
// 1 call before the step, 1 call after
PowerMockito.verifyStatic(TestStepManager.class, times(2));
TestStepManager.logTestStep(TestStepManager.getCurrentRootTestStep());
PowerMockito.verifyStatic(TestStepManager.class);
TestStepManager.setCurrentRootTestStep(step);
}
Aggregations