Package net.mindengine.galen.specs.reader.page

Examples of net.mindengine.galen.specs.reader.page.PageSpecReader



    public static LayoutReport checkLayout(Browser browser, List<String> specPaths,
                                           List<String> includedTags, List<String> excludedTags,
                                           Properties properties, ValidationListener validationListener) throws IOException {
        PageSpecReader reader = new PageSpecReader(properties, browser);

        List<PageSpec> specs = new LinkedList<PageSpec>();

        for (String specPath : specPaths) {
            specs.add(reader.read(specPath));
        }

        return checkLayout(browser, specs, includedTags, excludedTags, validationListener);
    }
View Full Code Here


    public static void dumpPage(Browser browser, String pageName, String specPath, String pageDumpPath, Integer maxWidth, Integer maxHeight) throws IOException {
        dumpPage(browser, pageName, specPath, pageDumpPath, maxWidth, maxHeight, new Properties());
    }
    public static void dumpPage(Browser browser, String pageName, String specPath, String pageDumpPath, Integer maxWidth, Integer maxHeight, Properties properties) throws IOException {
        PageSpecReader reader = new PageSpecReader(properties, browser);
        PageSpec pageSpec = reader.read(specPath);
        dumpPage(browser, pageName, pageSpec, new File(pageDumpPath), maxWidth, maxHeight);
    }
View Full Code Here

        Locator mainObjectLocator = pageValidation.getPageSpec().getObjectLocator(objectName);
        Page objectContextPage = page.createObjectContextPage(mainObjectLocator);
       
        ValidationListener validationListener = pageValidation.getValidationListener();

        PageSpecReader pageSpecReader = new PageSpecReader(spec.getProperties(), pageValidation.getBrowser());

        PageSpec componentPageSpec;
        try {
            componentPageSpec = pageSpecReader.read(spec.getSpecPath());
        } catch (IOException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
       
        SectionValidation sectionValidation = new SectionValidation(componentPageSpec.findSections(pageValidation.getSectionFilter()),
View Full Code Here

    PageSpecReader pageSpecReader = new PageSpecReader(EMPTY_PROPERTIES, NO_BROWSER);
    PageSpec pageSpec;
   
    @Test
    public void shouldBePossible_toReadSpec_fromInputStream() throws IOException {
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, NO_BROWSER).read(getClass().getResourceAsStream("/specs.txt"));
        assertThat(pageSpec, is(notNullValue()));
    }
View Full Code Here

    }
   
    @Test
    public void shouldBePossible_toReadSpec_fromFile() throws IOException {

        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, NO_BROWSER).read(getClass().getResource("/specs.txt").getFile());
        assertThat(pageSpec, is(notNullValue()));
    }
View Full Code Here

    @Test
    public void shouldAllow_toCountObject_byIvoking_JavascriptFunction() throws IOException {
        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/count-via-js-page.json");
        PageSpecReader pageSpecReader = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver));
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/count-via-js.spec").getFile());

        List<ObjectSpecs> objectSpecs = pageSpec.getSections().get(0).getObjects();

        assertThat(objectSpecs.size(), is(3));
        assertThat(objectSpecs.get(0).getObjectName(), is("menu-item-1"));
View Full Code Here

     */
    @Test
    public void should_countObjects_evenWhenUsing_emptyImports() throws IOException {
        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/count-via-js-page.json");
        PageSpecReader pageSpecReader = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver));
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/count-bug-134.spec").getFile());

        List<ObjectSpecs> objectSpecs = pageSpec.getSections().get(0).getObjects();
        assertThat(objectSpecs.get(0).getSpecs().get(0).getOriginalText(), is("text is: A count is 4"));
    }
View Full Code Here

     */
    @Test
    public void should_countObject_insideSecondarySpec() throws IOException {
        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/count-via-js-page.json");
        PageSpecReader pageSpecReader = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver));
        PageSpec pageSpec = pageSpecReader.read(getClass().getResource("/specs/count/main.spec").getFile());

        List<ObjectSpecs> objectSpecs = pageSpec.getSections().get(0).getObjects();
        assertThat(objectSpecs.get(0).getSpecs().get(0).getOriginalText(), is("text is: A count is 4"));
    }
View Full Code Here

        assertThat((SpecAbsent) specs.get(0), is(new SpecAbsent()));
    }
   
    @Test
    public void shouldRead_andProcess_bashTemplateExpressions() throws IOException {
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, NO_BROWSER).read(getClass().getResourceAsStream("/specs/spec-bash-template.spec"));
        assertThat(pageSpec, is(notNullValue()));
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(1));
       
View Full Code Here

        assertThat(objects.get(2).getObjectName(), is("obj-3"));
    }
   
    @Test
    public void shouldRead_sectionsNames_withTags() throws IOException {
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, NO_BROWSER).read(getClass().getResourceAsStream("/specs/spec-sections-advanced.spec"));
        assertThat(pageSpec, is(notNullValue()));
       
        List<PageSection> sections = pageSpec.getSections();
        assertThat(sections.size(), is(7));
       
View Full Code Here

TOP

Related Classes of net.mindengine.galen.specs.reader.page.PageSpecReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.