use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlElementInElementWhenValueIsNull.
// @Ignore
// @Test
// public void testDoControlElementNotVisibleWhenWebDriverException() {
// String property = "id=test";
// String value = "null";
// String msg = "The test case is canceled due to lost connection to Selenium Server! Detailed error : .*";
// Identifier identifier = new Identifier();
// identifier.setIdentifier("id");
// identifier.setLocator("test");
//
// TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
// tcsace.setControl("verifyElementNotVisible");
// tcsace.setValue1(property);
// tcsace.setValue2(value);
// tcsace.setFatal("Y");
// TestCaseStepExecution tcse = new TestCaseStepExecution();
// tcse.settCExecution(tCExecution);
// TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
// tcsae.setTestCaseStepExecution(tcse);
// tcsace.setTestCaseStepActionExecution(tcsae);
//
// when(webdriverService.isElementPresent(session, identifier)).thenThrow(new WebDriverException());
//
// this.controlService.doControl(tcsace);
//
// Assert.assertTrue(tcsace.getControlResultMessage().getDescription().matches(msg));
// Assert.assertEquals("CA", tcsace.getReturnCode());
// Assert.assertEquals("Y", tcsace.getFatal());
// }
@Test
public void testDoControlElementInElementWhenValueIsNull() {
String property = "id=test";
String value = "null";
String msg = "Element '" + value + "' is not child of element '" + property + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyElementInElement");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlElementInElementWhenPropertyIsNull.
@Test
public void testDoControlElementInElementWhenPropertyIsNull() {
String property = "null";
String value = "id=test";
String msg = "Element '" + value + "' is not child of element '" + property + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyElementInElement");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerDifferentWhenValueNotNumeric.
@Test
public void testDoControlIntegerDifferentWhenValueNotNumeric() {
String property = "10";
String value = "five";
String msg = "At least one of the Properties is not numeric, can not compare properties!";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericDifferent");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerEqualsWhenValueNotNumeric.
@Test
public void testDoControlIntegerEqualsWhenValueNotNumeric() {
String property = "10";
String value = "five";
String msg = "At least one of the Properties is not numeric, can not compare properties!";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericEquals");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerDifferentWhenPropertyNotNumeric.
@Test
public void testDoControlIntegerDifferentWhenPropertyNotNumeric() {
String property = "five";
String value = "5";
String msg = "At least one of the Properties is not numeric, can not compare properties!";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericDifferent");
tcsace.setValue1(property);
tcsace.setValue2(value);
tcsace.setFatal("Y");
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("KO", tcsace.getReturnCode());
Assert.assertEquals("Y", tcsace.getFatal());
}
Aggregations