Package net.mindengine.galen.browser

Examples of net.mindengine.galen.browser.SeleniumBrowser


   
   
    @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);
       
View Full Code Here


   
    @Test
    public void performsValidations_ofComponentSpecs_withFilteredChildSections() 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);
View Full Code Here

public class GalenPageActionInjectJavascriptTest {
    private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page1.html").getPath();
   
    @Test public void shouldInject_javascript() throws IOException {
        WebDriver driver = new FirefoxDriver();
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
       
        GalenPageActionInjectJavascript action = new GalenPageActionInjectJavascript("/scripts/to-inject-1.js");
        action.execute(new TestReport(), browser, new GalenPageTest(), null);
       
        WebElement element = driver.findElement(By.xpath("//body/injected-tag"));
       
        assertThat("Inject tags text should be", element.getText(), is("Some injected content"));
        browser.quit();
    }
View Full Code Here

    @Test
    public void shouldProvide_webDriver_withJsFactory() {
        JsBrowserFactory browserFactory = new JsBrowserFactory(getClass().getResource("/browser/js-driver-init.js").getFile(), new String[]{"http://example.com", "640x480"});
       
        SeleniumBrowser browser = (SeleniumBrowser)browserFactory.openBrowser();
       
        DummyDriver driver = (DummyDriver)browser.getDriver();
       
        Assert.assertEquals("http://example.com", driver.getCurrentUrl());
    }
View Full Code Here

       
        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();
       
View Full Code Here

        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" +
View Full Code Here

        WebDriver driver = new MockedDriver();
        driver.get("/mocks/pages/galen4j-pagedump.json");

        GalenPageAction pageAction = new GalenPageActionDumpPage("Test page", "/specs/galen4j/pagedump.spec", pageDumpPath);

        pageAction.execute(null, new SeleniumBrowser(driver), null, null);



        assertFileExists(pageDumpPath + "/page.json");
        assertFileExists(pageDumpPath + "/page.html");
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.