use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.
the class TestTestStep method testPasswordMaskingMainStep.
/**
* Check that if main step contains masking, they are reported in messages /
* action / step below
*/
@Test(groups = { "ut" })
public void testPasswordMaskingMainStep() {
TestStep step = new TestStep("step1 with args: (bar, passwd)", null, Arrays.asList("passwd"), true);
TestAction action = new TestAction("action in step1 with args: (foo, passwd)", false, new ArrayList<>());
TestMessage message = new TestMessage("everything OK on passwd", MessageType.INFO);
TestStep substep = new TestStep("substep with args: (passwd)", null, new ArrayList<>(), true);
step.addAction(action);
step.addMessage(message);
step.addStep(substep);
Assert.assertEquals(step.getName(), "step1 with args: (bar, ******)");
Assert.assertEquals(action.getName(), "action in step1 with args: (foo, ******)");
Assert.assertEquals(message.getName(), "everything OK on ******");
Assert.assertEquals(substep.getName(), "substep with args: (******)");
Assert.assertEquals(step.toString(), "Step step1 with args: (bar, ******)\n" + " - action in step1 with args: (foo, ******)\n" + " - everything OK on ******\n" + " - Step substep with args: (******)");
}
use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.
the class TestTestStep method testPasswordMaskingHtmlEncodedMainStep.
@Test(groups = { "ut" })
public void testPasswordMaskingHtmlEncodedMainStep() {
TestStep step = new TestStep("step1 with args: (bar, passwd)", null, Arrays.asList("passwd"), true);
TestAction action = new TestAction("action in step1 with args: (foo, passwd)", false, new ArrayList<>());
TestMessage message = new TestMessage("everything OK on passwd", MessageType.INFO);
TestStep substep = new TestStep("substep with args: (passwd)", null, new ArrayList<>(), true);
step.addAction(action);
step.addMessage(message);
step.addStep(substep);
Assert.assertEquals(step.encode("html").getName(), "step1 with args: (bar, ******)");
Assert.assertEquals(action.encode("html").getName(), "action in step1 with args: (foo, ******)");
Assert.assertEquals(message.encode("html").getName(), "everything OK on ******");
Assert.assertEquals(substep.encode("html").getName(), "substep with args: (******)");
Assert.assertEquals(step.encode("html").toString(), "Step step1 with args: (bar, ******)\n" + " - action in step1 with args: (foo, ******)\n" + " - everything OK on ******\n" + " - Step substep with args: (******)");
}
use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.
the class TestTestStep method testPasswordMaskingXmlEncodedMainStepWithSpecialCharacters.
@Test(groups = { "ut" })
public void testPasswordMaskingXmlEncodedMainStepWithSpecialCharacters() {
TestStep step = new TestStep("step1 with args: (bar, passwd§~$µ)", null, Arrays.asList("passwd§~$µ"), true);
TestAction action = new TestAction("action in step1 with args: (foo, passwd§~$µ)", false, new ArrayList<>());
TestMessage message = new TestMessage("everything OK on passwd§~$µ", MessageType.INFO);
TestStep substep = new TestStep("substep with args: (passwd§~$µ)", null, new ArrayList<>(), true);
step.addAction(action);
step.addMessage(message);
step.addStep(substep);
Assert.assertEquals(step.encode("xml").getName(), "step1 with args: (bar, ******)");
Assert.assertEquals(action.encode("xml").getName(), "action in step1 with args: (foo, ******)");
Assert.assertEquals(message.encode("xml").getName(), "everything OK on ******");
Assert.assertEquals(substep.encode("xml").getName(), "substep with args: (******)");
Assert.assertEquals(step.encode("xml").toString(), "Step step1 with args: (bar, ******)\n" + " - action in step1 with args: (foo, ******)\n" + " - everything OK on ******\n" + " - Step substep with args: (******)");
}
use of com.seleniumtests.reporter.logger.TestAction in project seleniumRobot by bhecquet.
the class TestTestStep method testTestActionEncodeXmlExceptionKept.
@Test(groups = { "ut" })
public void testTestActionEncodeXmlExceptionKept() {
TestAction action = new TestAction("action2 \"'<>&", false, new ArrayList<>());
action.setActionException(new Throwable("foo"));
TestAction encodedAction = action.encode("xml");
Assert.assertNotNull(encodedAction.getActionException());
Assert.assertEquals(encodedAction.getActionExceptionMessage(), "class java.lang.Throwable: foo");
}
use of com.seleniumtests.reporter.logger.TestAction 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);
}
Aggregations