Search in sources :

Example 21 with TestAction

use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.

the class StubTestClassForEncoding method testWithException.

@Test(groups = "stub")
public void testWithException() {
    TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    step1.addAction(new TestAction("click button", false, new ArrayList<>()));
    TestStepManager.logTestStep(step1);
    throw new DriverExceptions("& some exception \"with \" <strong><a href='http://someurl/link' style='background-color: red;'>HTML to encode</a></strong>");
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) DriverExceptions(com.seleniumtests.customexception.DriverExceptions) ArrayList(java.util.ArrayList) TestAction(com.seleniumtests.reporter.logger.TestAction) Test(org.testng.annotations.Test)

Example 22 with TestAction

use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.

the class StubTestClassForEncoding method testAndSubActions.

@Test(groups = "stub", description = "a test with steps")
public void testAndSubActions() throws IOException {
    TestStep step1 = new TestStep("step 1 <>\"'&/", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    step1.addAction(new TestAction("click button  <>\"'&", false, new ArrayList<>()));
    step1.addMessage(new TestMessage("a message <>\"'&", MessageType.LOG));
    TestStepManager.logTestStep(step1);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) ArrayList(java.util.ArrayList) TestMessage(com.seleniumtests.reporter.logger.TestMessage) TestAction(com.seleniumtests.reporter.logger.TestAction) Test(org.testng.annotations.Test)

Example 23 with TestAction

use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.

the class StubTestClassforTestDescription method testNoDescription.

@Test(groups = "stub")
public void testNoDescription() throws IOException {
    TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    step1.addAction(new TestAction("click button", false, new ArrayList<>()));
    step1.addAction(new TestAction("sendKeys to text field", false, new ArrayList<>()));
    TestStepManager.logTestStep(step1);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) ArrayList(java.util.ArrayList) TestAction(com.seleniumtests.reporter.logger.TestAction) Test(org.testng.annotations.Test)

Example 24 with TestAction

use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.

the class StubTestClassforTestDescription method testWithParamCreatedInTest.

@Test(groups = "stub", description = "a test on ${client} account ${account}")
public void testWithParamCreatedInTest() throws IOException {
    TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    step1.addAction(new TestAction("click button", false, new ArrayList<>()));
    step1.addAction(new TestAction("sendKeys to text field", true, new ArrayList<>()));
    TestStepManager.logTestStep(step1);
    createOrUpdateLocalParam("account", "account-12345");
    createOrUpdateParam("client", "Bob");
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) ArrayList(java.util.ArrayList) TestAction(com.seleniumtests.reporter.logger.TestAction) Test(org.testng.annotations.Test)

Example 25 with TestAction

use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.

the class Uft method readAction.

/**
 * Read an action element
 * <p>
 * // * @param parentStep
 *
 * @param actionElement
 * @throws DataConversionException
 */
private TestStep readAction(Element actionElement) throws DataConversionException {
    TestStep actionStep = new TestStep("UFT: " + actionElement.getChildText("AName").trim(), Reporter.getCurrentTestResult(), new ArrayList<>(), false);
    Element summary = actionElement.getChild("Summary");
    if (summary != null && summary.getAttribute("failed").getIntValue() != 0) {
        actionStep.setFailed(true);
    }
    for (Element element : actionElement.getChildren()) {
        if ("Action".equals(element.getName())) {
            TestStep readStep = readAction(element);
            actionStep.addStep(readStep);
        } else if ("Step".equals(element.getName())) {
            TestAction readAction = readStep(element);
            actionStep.addAction(readAction);
        }
    }
    return actionStep;
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Element(org.jdom2.Element) TestAction(com.seleniumtests.reporter.logger.TestAction)

Aggregations

TestAction (com.seleniumtests.reporter.logger.TestAction)56 TestStep (com.seleniumtests.reporter.logger.TestStep)47 Test (org.testng.annotations.Test)44 ArrayList (java.util.ArrayList)38 GenericTest (com.seleniumtests.GenericTest)24 TestMessage (com.seleniumtests.reporter.logger.TestMessage)12 DriverExceptions (com.seleniumtests.customexception.DriverExceptions)8 ScreenShot (com.seleniumtests.driver.screenshots.ScreenShot)5 Snapshot (com.seleniumtests.reporter.logger.Snapshot)5 File (java.io.File)5 HashMap (java.util.HashMap)5 GenericFile (com.seleniumtests.reporter.logger.GenericFile)3 Element (org.jdom2.Element)3 WebDriverException (org.openqa.selenium.WebDriverException)3 HarCapture (com.seleniumtests.reporter.logger.HarCapture)2 PageObject (com.seleniumtests.uipage.PageObject)2 Instant (java.time.Instant)2 Har (net.lightbody.bmp.core.har.Har)2 HarLog (net.lightbody.bmp.core.har.HarLog)2 HarPage (net.lightbody.bmp.core.har.HarPage)2