Package net.mindengine.galen.browser

Examples of net.mindengine.galen.browser.SeleniumBrowser


    @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));
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

    @Test
    public void shouldAllowTo_usePageObjectValues_inJsExpressions() throws IOException {
        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/object-values-in-js.json");
        PageSpecReader specReader = new PageSpecReader(new Properties(), new SeleniumBrowser(driver));
        PageSpec pageSpec = specReader.read(getClass().getResource("/specs/spec-with-object-values-in-js.spec").getFile());
        assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(0).getOriginalText(), is("near: menu-item-4 20px left"));
        assertThat(pageSpec.getSections().get(0).getObjects().get(0).getSpecs().get(1).getOriginalText(), is("above: menu-item-4 30px"));
    }
View Full Code Here

    }

    public static LayoutReport checkLayout(WebDriver driver, List<String> specPath,
                                           List<String> includedTags, List<String> excludedTags,
                                           Properties properties, ValidationListener validationListener) throws IOException {
        return checkLayout(new SeleniumBrowser(driver), specPath, includedTags, excludedTags, properties, validationListener);
    }
View Full Code Here

    }

    public static LayoutReport checkLayout(WebDriver driver, String specPath,
                                           List<String> includedTags, List<String> excludedTags,
                                           Properties properties, ValidationListener validationListener) throws IOException {
        return checkLayout(new SeleniumBrowser(driver), asList(specPath), includedTags, excludedTags, properties, validationListener);
    }
View Full Code Here

    public static void dumpPage(WebDriver driver, String pageName, String specPath, String pageDumpPath) throws IOException {
        dumpPage(driver, pageName, specPath, pageDumpPath, null, null);
    }

    public static void dumpPage(WebDriver driver, String pageName, String specPath, String pageDumpPath, Integer maxWidth, Integer maxHeight) throws IOException {
        dumpPage(new SeleniumBrowser(driver), pageName, specPath, pageDumpPath, maxWidth, maxHeight);
    }
View Full Code Here

    public static WebDriver createDriver(String browserType, String url, String size) {
        if (browserType == null) {
            browserType = GalenConfig.getConfig().getDefaultBrowser();
        }
       
        SeleniumBrowser browser = (SeleniumBrowser) new SeleniumBrowserFactory(browserType).openBrowser();
       
        if (url != null && !url.trim().isEmpty()) {
            browser.load(url);   
        }
       
        if (size != null && !size.trim().isEmpty()) {
            browser.changeWindowSize(GalenUtils.readSize(size));
        }
       
        return browser.getDriver();
    }
View Full Code Here

            throw new UnregisteredTestSession("Cannot check layout as there was no TestSession created");
        }

        TestReport report = session.getReport();
        CompleteListener listener = session.getListener();
        action.execute(report, new SeleniumBrowser(driver), null, listener);
    }
View Full Code Here

    }

    @Override
    public File createScreenshot() {
        if (this.cachedScreenshotFile == null) {
            cachedScreenshotFile = new SeleniumBrowser(driver).createScreenshot();
        }

        return this.cachedScreenshotFile;
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.browser.SeleniumBrowser

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.