public class GalenPageActionCheckTest {
@SuppressWarnings("serial")
@Test public void shouldTest_conditionalBlocks_simple_whenConditionPasses() throws IOException {
GalenPageActionCheck check = new GalenPageActionCheck();
check.setSpecs(Arrays.asList(getClass().getResource("/specs/spec-conditional-simple.spec").getFile()));
MockedBrowser mockedBrowser = new MockedBrowser("http://galenframework.com", new Dimension(640, 480));
mockedBrowser.setMockedPage(new MockedPage(new HashMap<String, PageElement>(){{
put("textfield", new MockedPageElement(0, 0, 100, 100));
put("button-1", new MockedPageElement(0, 0, 200, 100));
put("button-2", new MockedPageElement(0, 100, 200, 10));
}}));
TestValidationListener validationListener = new TestValidationListener();
TestReport report = new TestReport();
check.execute(report, mockedBrowser, new GalenPageTest(), validationListener);
Assert.assertEquals(
"<o textfield>\n" +
"<SpecHeight textfield>\n" +
"</o textfield>\n" +