use of org.cerberus.crud.entity.TestCaseStepExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlElementNotVisibleWhenPropertyNull.
// @Ignore
// @Test
// public void testDoControlElementNotPresentWhenWebDriverException() {
// 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("verifyElementNotPresent");
// 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());
// }
// @Ignore
// @Test
// public void testDoControlElementNotVisibleWhenSuccess() {
// String property = "id=test";
// String value = "null";
// String msg = "Element '" + property + "' is present and not visible on the page.";
// 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)).thenReturn(true);
// when(webdriverService.isElementNotVisible(session, identifier)).thenReturn(true);
//
// this.controlService.doControl(tcsace);
//
// Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
// Assert.assertEquals("OK", tcsace.getReturnCode());
// }
//
// @Ignore
// @Test
// public void testDoControlElementNotVisibleWhenFail() {
// String property = "id=test";
// String value = "null";
// String msg = "Element '" + property + "' is visible on the page.";
// 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)).thenReturn(true);
// when(webdriverService.isElementNotVisible(session, identifier)).thenReturn(false);
//
// this.controlService.doControl(tcsace);
//
// Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
// Assert.assertEquals("KO", tcsace.getReturnCode());
// Assert.assertEquals("Y", tcsace.getFatal());
// }
@Test
public void testDoControlElementNotVisibleWhenPropertyNull() {
String property = "null";
String value = "id=test";
String msg = "Object is 'null'. This is mandatory in order to perform the control verify element not visible";
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);
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.TestCaseStepExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerGreaterWhenSuccess.
@Test
public void testDoControlIntegerGreaterWhenSuccess() {
String property = "10";
String value = "5";
String msg = "'" + property + "' is greater than '" + value + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyNumericGreater");
tcsace.setValue1(property);
tcsace.setValue2(value);
TestCaseStepExecution tcse = new TestCaseStepExecution();
tcse.settCExecution(tCExecution);
TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
tcsae.setTestCaseStepExecution(tcse);
tcsace.setTestCaseStepActionExecution(tcsae);
this.controlService.doControl(tcsace);
Assert.assertEquals("OK", tcsace.getReturnCode());
}
use of org.cerberus.crud.entity.TestCaseStepExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlStringDifferentWhenSuccess.
@Test
public void testDoControlStringDifferentWhenSuccess() {
String property = "test";
String value = "test success";
String msg = "'" + property + "' is different from '" + value + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyStringDifferent");
tcsace.setValue1(property);
tcsace.setValue2(value);
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("OK", tcsace.getReturnCode());
}
use of org.cerberus.crud.entity.TestCaseStepExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlIntegerDifferentWhenFail.
@Test
public void testDoControlIntegerDifferentWhenFail() {
String property = "5";
String value = "5";
String msg = "'" + property + "' is not different from '" + value + "'.";
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.TestCaseStepExecution in project cerberus-source by cerberustesting.
the class ControlServiceTest method testDoControlStringEqualWhenFail.
@Test
public void testDoControlStringEqualWhenFail() {
String property = "test";
String value = "test fail";
String msg = "'" + property + "' is not equal to '" + value + "'.";
TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
tcsace.setControl("verifyStringEqual");
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());
}
Aggregations