CheckTextWebAction extends WebSymbolAction { public String getValue() { return value; } CheckTextWebAction(); @Override ExecuteResult execute(WebSiteConnector connector); String getValue(); @JsonIgnore @Transient String getValueWithVariableValues(); void setValue(String value); boolean isRegexp(); void setRegexp(boolean regexp); WebElementLocator getNode(); void setNode(WebElementLocator node);  }
@Test public void testJSON() throws IOException { String json = mapper.writeValueAsString(checkText); CheckTextWebAction c2 = (CheckTextWebAction) mapper.readValue(json, SymbolAction.class); assertEquals(checkText.getValue(), c2.getValue()); }
@Test public void testJSONFile() throws IOException, URISyntaxException { File file = new File(getClass().getResource("/actions/websymbolactions/CheckTextTestData.json").toURI()); SymbolAction obj = mapper.readValue(file, SymbolAction.class); assertTrue(obj instanceof CheckTextWebAction); CheckTextWebAction c = (CheckTextWebAction) obj; assertEquals("Lorem Ipsum", c.getValue()); }
@Test public void shouldReturnOKIfTextWasFoundWithoutRegexp() { given(webSiteConnector.getDriver().getPageSource()).willReturn(checkText.getValue()); assertTrue(checkText.executeAction(connectors).isSuccess()); }