use of com.seleniumtests.reporter.logger.TestStep in project seleniumRobot by bhecquet.
the class TestUft method testReadReport.
/**
* Check report file is correctly read
*
* @throws IOException
*/
@Test(groups = { "ut" })
public void testReadReport() throws IOException {
String report = GenericTest.readResourceToString("tu/uftReport.xml");
Uft uft = new Uft("[QualityCenter]Subject\\Tools\\Tests\\test1");
List<TestStep> stepList = uft.readXmlResult(report);
// check all content has been read
Assert.assertEquals(stepList.get(0).getName(), "UFT: IP_Config_Poste_W10 [IP_Config_Poste_W10]");
// check all content has been read
Assert.assertEquals(stepList.size(), 1);
// check the while content
Assert.assertEquals(stepList.get(0).toString(), "Step UFT: IP_Config_Poste_W10 [IP_Config_Poste_W10]");
}
use of com.seleniumtests.reporter.logger.TestStep in project seleniumRobot by bhecquet.
the class StubTestClass method testOk.
@Test(groups = "stub")
public void testOk() throws IOException {
TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), maskPassword);
step1.addAction(new TestAction("click button", false, new ArrayList<>()));
step1.addAction(new TestAction("sendKeys to text field", false, new ArrayList<>()));
TestStepManager.logTestStep(step1);
}
use of com.seleniumtests.reporter.logger.TestStep in project seleniumRobot by bhecquet.
the class StubTestClass method testWithExceptionOnFirstExec.
/**
* Test which fails only on first execution
*/
@Test(groups = "stub")
public void testWithExceptionOnFirstExec() {
TestStep step1 = new TestStep("step 10", Reporter.getCurrentTestResult(), new ArrayList<>(), maskPassword);
step1.addAction(new TestAction(String.format("played %d times", count), false, new ArrayList<>()));
step1.addAction(new TestAction("click button", false, new ArrayList<>()));
TestStepManager.logTestStep(step1);
if (!failed) {
failed = true;
throw new DriverExceptions("some exception");
}
}
use of com.seleniumtests.reporter.logger.TestStep in project seleniumRobot by bhecquet.
the class StubTestClass method testWithExceptionAndMaxRetryIncreased.
/**
* Increase max retry
*/
@Test(groups = "stub")
public void testWithExceptionAndMaxRetryIncreased() {
count++;
TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), maskPassword);
step1.addAction(new TestAction(String.format("played %d times", count), false, new ArrayList<>()));
step1.addAction(new TestAction("click button", false, new ArrayList<>()));
TestStepManager.logTestStep(step1);
try {
throw new DriverExceptions("some exception");
} finally {
if (count < 3) {
increaseMaxRetry();
}
}
}
use of com.seleniumtests.reporter.logger.TestStep in project seleniumRobot by bhecquet.
the class StubTestClass method testWithExceptionAndDataProvider.
@Test(groups = "stub", dataProvider = "data")
public void testWithExceptionAndDataProvider(String data) {
count++;
TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), maskPassword);
step1.addAction(new TestAction(String.format("played %d times", count), false, new ArrayList<>()));
step1.addAction(new TestAction("click button", false, new ArrayList<>()));
TestStepManager.logTestStep(step1);
throw new DriverExceptions("some exception");
}
Aggregations