Package net.mindengine.galen.components.validation

Examples of net.mindengine.galen.components.validation.TestValidationListener


       
        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();
       
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecContains header>\n" +
                "<SpecNear header>\n" +
                "<SpecWidth header>\n" +
                "<SpecHeight header>\n" +
                "</o header>\n" +
View Full Code Here


       
        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();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "</o header>\n" +
                "<o menu-item-home>\n" +
                "<SpecHorizontally menu-item-home>\n" +
                "</o menu-item-home>\n" +
View Full Code Here

       
        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();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecWidth header>\n" +
                "</o header>\n"
                ));
        assertThat("Errors should be empty", errors.size(), is(0));
    }
View Full Code Here

       
        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();
       
        assertThat("Invokations should", validationListener.getInvokations(), is("<o feedback>\n" +
                "<SpecInside feedback>\n" +
                "</o feedback>\n"
                ));
        assertThat("Errors should be empty", errors.size(), is(0));
    }
View Full Code Here

            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" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n" +
                "<o button-1>\n" +
                "<SpecAbove button-1>\n" +
                "</o button-1>\n" +
                "<o button-2>\n" +
                "<SpecBelow button-2>\n" +
                "</o button-2>\n"
        , validationListener.getInvokations());
    }
View Full Code Here

       
        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();
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-home>\n" +
                "<SpecHeight menu-item-home>\n" +
                "</o menu-item-home>\n"));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-categories>\n" +
                "<SpecHeight menu-item-categories>\n" +
                "</o menu-item-categories>\n"));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-blog>\n" +
                "<SpecHeight menu-item-blog>\n" +
                "</o menu-item-blog>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-rss>\n" +
                "<SpecHeight menu-item-rss>\n" +
                "</o menu-item-rss>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-about>\n" +
                "<SpecHeight menu-item-about>\n" +
                "</o menu-item-about>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-contacts>\n" +
                "<SpecHeight menu-item-contacts>\n" +
                "</o menu-item-contacts>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-item-help>\n" +
                "<SpecHeight menu-item-help>\n" +
                "</o menu-item-help>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o header-text-1>\n" +
                "<SpecWidth header-text-1>\n" +
                "</o header-text-1>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o header-text-2>\n" +
                "<SpecWidth header-text-2>\n" +
                "</o header-text-2>\n"));
       
        assertThat("Errors should be empty", errors.size(), is(0));
View Full Code Here

            put("button-1", new MockedPageElement(0, 0, 200, 100));
            put("button-2", new MockedPageElement(0, 100, 200, 10));
        }}));
       
       
        TestValidationListener validationListener = new TestValidationListener();
        check.execute(new TestReport(), mockedBrowser, new GalenPageTest(), validationListener);
       
        Assert.assertEquals(
                "<o textfield>\n" +
                "<SpecHeight textfield>\n" +
                "</o textfield>\n" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n"
        , validationListener.getInvokations());
    }
View Full Code Here

            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));

       
        TestValidationListener validationListener = new TestValidationListener();
        check.execute(new TestReport(), mockedBrowser, new GalenPageTest(), validationListener);
       
        Assert.assertEquals(
                "<o textfield>\n" +
                "<SpecHeight textfield>\n" +
                "</o textfield>\n" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n" +
                "<o button-1>\n" +
                "<SpecAbove button-1>\n" +
                "<e><msg>\"button-1\" is not visible on page</msg></e>\n" +
                "</o button-1>\n" +
                "<o button-2>\n" +
                "<SpecBelow button-2>\n" +
                "<e><msg>\"button-2\" is not visible on page</msg></e>\n" +
                "</o button-2>\n"
        , validationListener.getInvokations());
    }
View Full Code Here

            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));

       
        TestValidationListener validationListener = new TestValidationListener();
        check.execute(new TestReport(), mockedBrowser, new GalenPageTest(), validationListener);
       
        Assert.assertEquals(
                "<o textfield>\n" +
                "<SpecHeight textfield>\n" +
                "</o textfield>\n" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n"
        , validationListener.getInvokations());
    }
View Full Code Here

            put("button-1", new MockedInvisiblePageElement(0, 0, 100, 100));
            put("button-2", new MockedInvisiblePageElement(0, 0, 100, 100));
        }}));

       
        TestValidationListener validationListener = new TestValidationListener();
        check.execute(new TestReport(), mockedBrowser, new GalenPageTest(), validationListener);
       
        Assert.assertEquals(
                "<o textfield>\n" +
                "<SpecHeight textfield>\n" +
                "</o textfield>\n" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n" +
                "<o textfield>\n" +
                "<SpecWidth textfield>\n" +
                "</o textfield>\n"
        , validationListener.getInvokations());
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.components.validation.TestValidationListener

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.