Search in sources :

Example 56 with TestStep

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

the class TestTestStep method testIsTestEndStep2.

@Test(groups = { "ut" })
public void testIsTestEndStep2() {
    TestStep step = new TestStep("Test end", null, new ArrayList<>(), true);
    Assert.assertTrue(step.isTestEndStep());
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 57 with TestStep

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

the class TestTestStep method testTestSubCapturePositionAndParent.

@Test(groups = { "ut" })
public void testTestSubCapturePositionAndParent() throws IOException {
    TestStep step = new TestStep("step1", null, new ArrayList<>(), true);
    TestStep subStep = new TestStep("subStep1", null, new ArrayList<>(), true);
    step.addStep(subStep);
    Har har = new Har(new HarLog());
    har.getLog().addPage(new HarPage("title", "a title"));
    HarCapture capture = new HarCapture(har, "main");
    step.addNetworkCapture(capture);
    Assert.assertEquals(capture.getPosition(), 1);
    Assert.assertEquals(capture.getParent(), step);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) HarLog(net.lightbody.bmp.core.har.HarLog) Har(net.lightbody.bmp.core.har.Har) HarCapture(com.seleniumtests.reporter.logger.HarCapture) HarPage(net.lightbody.bmp.core.har.HarPage) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 58 with TestStep

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

the class TestTestStep method testTestStepNoreencodeXml.

/**
 * check we do not re-encode an already encoded message
 */
@Test(groups = { "ut" })
public void testTestStepNoreencodeXml() {
    TestStep step = new TestStep("step1 \"'<>&", null, new ArrayList<>(), true);
    TestStep encodedTestStep = step.encode("xml");
    TestStep encodedTestStep2 = encodedTestStep.encode("xml");
    Assert.assertEquals(encodedTestStep2.toString(), "Step step1 &quot;&apos;&lt;&gt;&amp;");
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 59 with TestStep

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

the class TestTestStep method testPasswordMaskingWithEmptyPassword.

/**
 * Check that password masking does not work with empty strings
 */
@Test(groups = { "ut" })
public void testPasswordMaskingWithEmptyPassword() {
    List<String> toReplace = new ArrayList<>();
    toReplace.add("");
    TestStep step = new TestStep("step1 with args: (bar, to)", null, toReplace, true);
    Assert.assertEquals(step.getName(), "step1 with args: (bar, to)");
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) ArrayList(java.util.ArrayList) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 60 with TestStep

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

the class TestTestStep method testTestSubActionPositionAndParent.

@Test(groups = { "ut" })
public void testTestSubActionPositionAndParent() {
    TestStep step = new TestStep("step1", null, new ArrayList<>(), true);
    TestStep subStep = new TestStep("subStep1", null, new ArrayList<>(), true);
    step.addStep(subStep);
    TestAction action = new TestAction("subStep2", null, new ArrayList<>());
    step.addAction(action);
    Assert.assertEquals(action.getPosition(), 1);
    Assert.assertEquals(action.getParent(), step);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) TestAction(com.seleniumtests.reporter.logger.TestAction) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Aggregations

TestStep (com.seleniumtests.reporter.logger.TestStep)190 Test (org.testng.annotations.Test)148 GenericTest (com.seleniumtests.GenericTest)120 ArrayList (java.util.ArrayList)80 TestAction (com.seleniumtests.reporter.logger.TestAction)47 File (java.io.File)37 ScreenShot (com.seleniumtests.driver.screenshots.ScreenShot)25 Snapshot (com.seleniumtests.reporter.logger.Snapshot)24 ErrorCause (com.seleniumtests.core.testanalysis.ErrorCause)19 TestMessage (com.seleniumtests.reporter.logger.TestMessage)16 GenericFile (com.seleniumtests.reporter.logger.GenericFile)15 MockitoTest (com.seleniumtests.MockitoTest)12 HashMap (java.util.HashMap)12 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)12 ITestResult (org.testng.ITestResult)10 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 Uft (com.seleniumtests.connectors.extools.Uft)8 DriverExceptions (com.seleniumtests.customexception.DriverExceptions)8 ConfigurationException (com.seleniumtests.customexception.ConfigurationException)7 SeleniumRobotServerException (com.seleniumtests.customexception.SeleniumRobotServerException)6