use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testEqualsDifferentStep.
@Test(groups = { "ut" })
public void testEqualsDifferentStep() {
ErrorCause cause1 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", new TestStep("step1", null, new ArrayList<>(), true));
ErrorCause cause2 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", new TestStep("step2", null, new ArrayList<>(), true));
Assert.assertNotEquals(cause1, cause2);
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testEqualsNullDescription1.
@Test(groups = { "ut" })
public void testEqualsNullDescription1() {
ErrorCause cause1 = new ErrorCause(ErrorType.APPLICATION_CHANGED, null, new TestStep("step1", null, new ArrayList<>(), true));
ErrorCause cause2 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes2", new TestStep("step1", null, new ArrayList<>(), true));
Assert.assertNotEquals(cause1, cause2);
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testEqualsNullStep2.
@Test(groups = { "ut" })
public void testEqualsNullStep2() {
ErrorCause cause1 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", new TestStep("step2", null, new ArrayList<>(), true));
ErrorCause cause2 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", null);
Assert.assertNotEquals(cause1, cause2);
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCause method testEqualsNullDescription2.
@Test(groups = { "ut" })
public void testEqualsNullDescription2() {
ErrorCause cause1 = new ErrorCause(ErrorType.APPLICATION_CHANGED, "some changes", new TestStep("step1", null, new ArrayList<>(), true));
ErrorCause cause2 = new ErrorCause(ErrorType.APPLICATION_CHANGED, null, new TestStep("step1", null, new ArrayList<>(), true));
Assert.assertNotEquals(cause1, cause2);
}
use of com.seleniumtests.core.testanalysis.ErrorCause in project seleniumRobot by bhecquet.
the class TestErrorCauseFinder method testCompareStepInErrorWithReferenceNoIDForStep.
/**
* When step has not been stored on server, they have no ID. Check that without ID, no comparison performed, and no error is raised
* @throws Exception
*/
@Test(groups = { "ut" })
public void testCompareStepInErrorWithReferenceNoIDForStep() throws Exception {
step1.setStepResultId(null);
stepFailed.setStepResultId(null);
lastStep.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.assertFalse(TestNGResultUtils.isErrorCauseSearchedInReferencePicture(testResult));
}
Aggregations