Package net.mindengine.galen.components.validation

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


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


       
        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();
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-1>\n" +
                "<SpecHeight menu-items-1>\n" +
                "</o menu-items-1>\n"));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-2>\n" +
                "<SpecHeight menu-items-2>\n" +
                "</o menu-items-2>\n"));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-3>\n" +
                "<SpecHeight menu-items-3>\n" +
                "</o menu-items-3>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-4>\n" +
                "<SpecHeight menu-items-4>\n" +
                "</o menu-items-4>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-5>\n" +
                "<SpecHeight menu-items-5>\n" +
                "</o menu-items-5>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-6>\n" +
                "<SpecHeight menu-items-6>\n" +
                "</o menu-items-6>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-7>\n" +
                "<SpecHeight menu-items-7>\n" +
                "</o menu-items-7>\n" ));
       
        assertThat("Invokations should contain", validationListener.getInvokations(), containsString(
                "<o menu-items-1>\n" +
                "<SpecNear menu-items-1>\n" +
                "</o menu-items-1>\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("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" +
                "<e><msg>\"header\" height is 140px which is not in range of 150 to 185px</msg></e>\n" +
                "</o header>\n" +
                "<o menu-item-home>\n" +
                "<SpecHorizontally menu-item-home>\n" +
View Full Code Here

        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();
       
        assertLines(validationListener.getInvokations(), lines(
                "<o user-profile-1>",
                "<o user-pic>",
                "<SpecWidth user-pic>",
                "<SpecHeight user-pic>",
                "<SpecInside user-pic>",
View Full Code Here

        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));
       
        SectionFilter sectionFilter = new SectionFilter(asList("all", "mobile"), asList("nomobile"));
       
        SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, sectionFilter), validationListener);
        List<ValidationError> errors = sectionValidation.check();
       
        assertLines(validationListener.getInvokations(), lines(
                "<o user-profile-1>",
                "<o user-pic>",
                "<SpecWidth user-pic>",
                "<SpecHeight user-pic>",
                "<SpecInside user-pic>",
View Full Code Here

    private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page1.html").getPath();

   

    @Test public void runsTestSuccessfully_inPredefinedBrowser() throws IOException {
        TestValidationListener validationListener = new TestValidationListener();
       
        WebDriver driver = new FirefoxDriver();
       
        GalenPageActionCheck action = new GalenPageActionCheck()
            .withIncludedTags(asList("mobile"))
            .withSpecs(asList("/html/page.spec"));
       
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
        browser.changeWindowSize(new Dimension(400, 800));
       
        action.execute(new TestReport(), browser, new GalenPageTest(), validationListener);
       
        driver.quit();
       
        assertThat("Invokations should be", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "<e><msg>\"header\" height is 140px which is not in range of 150 to 185px</msg></e>\n" +
                "</o header>\n" +
                "<o menu-item-home>\n" +
                "<SpecHorizontally menu-item-home>\n" +
View Full Code Here

                "</o menu-item-rss>\n"
                ));
    }
   
    @Test public void runsTestSuccessfully_andExlcudesSpecifiedTags() throws IOException {
        TestValidationListener validationListener = new TestValidationListener();
       
        WebDriver driver = new FirefoxDriver();
       
        GalenPageActionCheck action = new GalenPageActionCheck()
            .withIncludedTags(asList("mobile"))
            .withExcludedTags(asList("debug"))
            .withSpecs(asList("/html/page-exclusion.spec"));
   
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
        browser.changeWindowSize(new Dimension(400, 800));
       
        action.execute(new TestReport(), browser, new GalenPageTest(), validationListener);
        driver.quit();
       
        assertThat("Invokations should be", validationListener.getInvokations(), is("<o header>\n" +
                "<SpecHeight header>\n" +
                "<e><msg>\"header\" height is 140px which is not in range of 150 to 170px</msg></e>\n" +
                "</o header>\n" +
                "<o menu-item-home>\n" +
                "<SpecHorizontally menu-item-home>\n" +
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.