Search in sources :

Example 86 with TestStep

use of com.seleniumtests.reporter.logger.TestStep 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 87 with TestStep

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

the class TestTestStepManager method testGetNoLastStep.

/**
 * Check we get null if the "Test end" step does not exist
 */
@Test(groups = { "ut" })
public void testGetNoLastStep() {
    TestStep step1 = new TestStep("step", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    TestStepManager.logTestStep(step1);
    Assert.assertNull(TestStepManager.getInstance().getLastTestStep());
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 88 with TestStep

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

the class TestTestStepManager method testCurrentRootTestStepWithVideoTimeStamp.

@Test(groups = { "ut" })
public void testCurrentRootTestStepWithVideoTimeStamp() {
    TestStepManager.setVideoStartDate();
    // wait a bit so that step video timestamp is not 0
    WaitHelper.waitForSeconds(1);
    TestStep step1 = new TestStep("step 1", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    TestStepManager.setCurrentRootTestStep(step1);
    Assert.assertEquals(TestStepManager.getCurrentRootTestStep(), step1);
    Assert.assertTrue(step1.getVideoTimeStamp() > 0);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 89 with TestStep

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

the class TestTestStepManager method testGetLastStep.

/**
 * Check we get the "Test end" step if it exists
 */
@Test(groups = { "ut" })
public void testGetLastStep() {
    TestStep step1 = new TestStep("Test end", Reporter.getCurrentTestResult(), new ArrayList<>(), true);
    TestStepManager.logTestStep(step1);
    Assert.assertEquals(TestStepManager.getInstance().getLastTestStep(), step1);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 90 with TestStep

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

the class TestLogActions method testPassworkMasking2.

/**
 * Same as above but parameter name is 'pwd'
 */
@Test(groups = { "ut" })
public void testPassworkMasking2() {
    testPage._setPassword2("someText");
    TestStep step = SeleniumTestsContextManager.getThreadContext().getTestStepManager().getTestSteps().get(2);
    // all occurences of the password have been replaced
    Assert.assertFalse(step.toString().contains("someText"));
    Assert.assertEquals(StringUtils.countMatches(step.toString(), "******"), 2);
}
Also used : TestStep(com.seleniumtests.reporter.logger.TestStep) GenericDriverTest(com.seleniumtests.GenericDriverTest) 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