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

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


    public void imageSpec_shouldAlsoGenerate_imageComparisonMap() {
        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


        driver.quit();
    }
   
    @Test
    public void performsValidation_forAll() throws Exception {
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        openDriverForNicePage();
       
        driver.manage().window().maximize();
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void performsValidation_forMobile_withTwoSections() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void shouldCheck_relativeToScreen() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void shouldCheck_relativeToViewport() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void shouldCheck_multipleObjects() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(1024, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void shouldCheck_text() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
    @Test
    public void shouldCheck_multiObjects() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(1000, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.findSections(asList("multi-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();
View Full Code Here

   
    @Test
    public void givesErrors_whenValidating_incorrectWebSite() throws Exception {
        openDriverForBadPage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        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();
View Full Code Here

   
   
    @Test
    public void performsValidations_ofComponentSpecs() throws IOException {
        openDriverForPage("page-for-component-specs.html");
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResource("/specs/components/spec-for-component-test-main.spec").getFile());

        driver.manage().window().setSize(new Dimension(1000, 800));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.getSections();
        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();
       
View Full Code Here

TOP

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

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.