use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCauseFinder method testCompareStepInErrorWithReferenceNoIDForStep2.
/**
* Same thing as above but only the failed step has no ID
* In this case, we consider comparison has been performed because other steps have IDs
* @throws Exception
*/
@Test(groups = { "ut" })
public void testCompareStepInErrorWithReferenceNoIDForStep2() throws Exception {
stepFailed.setStepResultId(null);
ITestResult testResult = Reporter.getCurrentTestResult();
TestNGResultUtils.setSeleniumRobotTestContext(testResult, SeleniumTestsContextManager.getThreadContext());
SeleniumTestsContextManager.getThreadContext().getTestStepManager().setTestSteps(Arrays.asList(step1, stepFailed, lastStep));
PowerMockito.whenNew(StepReferenceComparator.class).withAnyArguments().thenReturn(stepReferenceComparatorStep2);
List<ErrorCause> causes = new ErrorCauseFinder(testResult).compareStepInErrorWithReference();
// no comparison done
PowerMockito.verifyNew(StepReferenceComparator.class, never()).withArguments(any(File.class), any(File.class));
;
Assert.assertEquals(causes.size(), 0);
Assert.assertTrue(TestNGResultUtils.isErrorCauseSearchedInReferencePicture(testResult));
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testToStringWithRootCauseNoDetails2.
@Test(groups = { "ut" })
public void testToStringWithRootCauseNoDetails2() {
TestStep step = new TestStep("step1", null, new ArrayList<>(), true, RootCause.DEPENDENCIES, null, false);
step.setFailed(true);
String desc = new ErrorCause(ErrorType.ERROR_MESSAGE, "some changes", step).toString();
Assert.assertEquals(desc, "Error message displayed: some changes on step 'step1'\n" + "Declared root Cause: DEPENDENCIES");
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testToStringWithRootCauseAndDetails2.
/**
* If error type is "UNKNOWN_PAGE", check RootCause is displayed
*/
@Test(groups = { "ut" })
public void testToStringWithRootCauseAndDetails2() {
TestStep step = new TestStep("step1", null, new ArrayList<>(), true, RootCause.DEPENDENCIES, "Error from system X", false);
step.setFailed(true);
String desc = new ErrorCause(ErrorType.UNKNOWN_PAGE, "some changes", step).toString();
Assert.assertEquals(desc, "This page has never been encountered: some changes on step 'step1'\n" + "Declared root Cause: DEPENDENCIES => Error from system X");
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testToStringWithRootCauseAndDetails3.
/**
* If error type is "APPLICATION_CHANGED", check RootCause is not displayed
*/
@Test(groups = { "ut" })
public void testToStringWithRootCauseAndDetails3() {
TestStep step = new TestStep("step1", null, new ArrayList<>(), true, RootCause.DEPENDENCIES, "Error from system X", false);
step.setFailed(true);
String desc = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", step).toString();
Assert.assertEquals(desc, "The application has been modified: some changes on step 'step1'");
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testToStringNoDescrition.
@Test(groups = { "ut" })
public void testToStringNoDescrition() {
String desc = new ErrorCause(ErrorType.APPLICATION_CHANGED, null, new TestStep("step1", null, new ArrayList<>(), true)).toString();
Assert.assertEquals(desc, "The application has been modified on step 'step1'");
}
Aggregations