Package net.mindengine.galen.validation

Examples of net.mindengine.galen.validation.PageValidation


        } catch (IOException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
       
        SectionValidation sectionValidation = new SectionValidation(componentPageSpec.findSections(pageValidation.getSectionFilter()),
                new PageValidation(pageValidation.getBrowser(), objectContextPage, componentPageSpec, validationListener, pageValidation.getSectionFilter()),
                validationListener);
       
        List<ValidationError> errors = sectionValidation.check();
        if (errors != null && errors.size() > 0) {
            throw new ValidationErrorException("Child component spec contains " + errors.size() + " errors");
View Full Code Here


    private BufferedImage imageComparisonTestScreenshot = loadTestImage("/imgs/page-screenshot.png");
   
    @Test(dataProvider="provideGoodSamples")
    public void shouldPassValidation(Spec spec, MockedPage page) {
        PageSpec pageSpec = createMockedPageSpec(page);
        PageValidation validation = new PageValidation(null, page, pageSpec, null, null);
        ValidationError error = validation.check("object", spec);
       
        assertThat(error, is(nullValue()));
    }
View Full Code Here

    }

    @Test(dataProvider="provideBadSamples")
    public void shouldGiveError(ValidationError expectedError, Spec spec, MockedPage page) {
        PageSpec pageSpec = createMockedPageSpec(page);
        PageValidation validation = new PageValidation(null, page, pageSpec, null, null);
        ValidationError error = validation.check("object", spec);
       
        assertThat(error, is(notNullValue()));
        assertThat(error, is(expectedError));
    }
View Full Code Here

        MockedPage page = page(new HashMap<String, PageElement>() {{
            put("object", element(100, 90, 100, 40));
        }}, imageComparisonTestScreenshot);

        PageSpec pageSpec = createMockedPageSpec(page);
        PageValidation validation = new PageValidation(null, page, pageSpec, null, null);
        ValidationError error = validation.check("object", specImage(asList("/imgs/button-sample-incorrect.png"), 600, PIXEL_UNIT, 0, 10));


        assertThat("Comparison map should not be null", error.getImageComparison().getComparisonMap(), is(notNullValue()));
    }
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("all"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(1));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecContains header>\n" +
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("mobile"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(2));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "</o header>\n" +
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("screen-object-check"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(1));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecWidth header>\n" +
                "</o header>\n"
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("viewport-object-check"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(1));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o feedback>\n" +
                "<SpecInside feedback>\n" +
                "</o feedback>\n"
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("multiple-objects-check"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(1));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-home>\n" +
                "<SpecHeight menu-item-home>\n" +
View Full Code Here

        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("text-check"));
       
        assertThat("Filtered sections size should be", pageSections.size(), is(1));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, null), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertThat("Invokations should", validationListener.getInvokations(), is(
                "<o menu-item-home>\n" +
                "<SpecText menu-item-home>\n" +
View Full Code Here

TOP

Related Classes of net.mindengine.galen.validation.PageValidation

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.