Package net.mindengine.galen.browser

Examples of net.mindengine.galen.browser.SeleniumGridBrowserFactory


        String gridUrl = leftovers.get(0);
       
        String pageUrl = command.get("page");
        String size = command.get("size");
       
        SeleniumGridBrowserFactory browserFactory = new SeleniumGridBrowserFactory(gridUrl)
            .withBrowser(command.get("browser"))
            .withBrowserVersion(command.get("version"))
            .withPlatform(readPlatform(command.get("platform")));
       
        for (String parameter : command.getParameterNames()) {
            if (parameter.startsWith("dc.")) {
                String desiredCapaibility = parameter.substring(3);
                browserFactory.withDesiredCapability(desiredCapaibility, command.get(parameter));
            }
        }
       
        return new GalenPageTest()
            .withUrl(pageUrl)
View Full Code Here


       
        return browser.getDriver();
    }
   
    public static WebDriver createGridDriver(String gridUrl, String browserName, String browserVersion, String platform, Map<String, String> desiredCapabilities, String size) {
        SeleniumGridBrowserFactory factory = new SeleniumGridBrowserFactory(gridUrl);
        factory.setBrowser(browserName);
        factory.setBrowserVersion(browserVersion);
       
        if (platform != null) {
            factory.setPlatform(Platform.valueOf(platform));
        }
       
        if (desiredCapabilities != null) {
            factory.setDesiredCapabilites(desiredCapabilities);
        }
       
        WebDriver driver = ((SeleniumBrowser)factory.openBrowser()).getDriver();
       
        GalenUtils.resizeDriver(driver, size);
        return driver;
    }
View Full Code Here

                   .withBrowserFactory(new SeleniumBrowserFactory(SeleniumBrowserFactory.CHROME))),
                  
           test("selenium grid http://mygrid:8080/wd/hub --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub"))),
                  
           test("selenium grid http://mygrid:8080/wd/hub --browser chrome --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                           .withBrowser("chrome"))),
                  
           test("selenium grid http://mygrid:8080/wd/hub --browser chrome --version 21.1 --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                           .withBrowser("chrome")
                           .withBrowserVersion("21.1"))),
                  
           test("selenium grid http://mygrid:8080/wd/hub --browser chrome --version 21.1 --platform XP --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                           .withBrowser("chrome")
                           .withBrowserVersion("21.1")
                           .withPlatform(Platform.XP))),
                  
           test("selenium grid http://mygrid:8080/wd/hub --browser chrome --version 21.1 --platform WIN8 --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                           .withBrowser("chrome")
                           .withBrowserVersion("21.1")
                           .withPlatform(Platform.WIN8))),
                          
           test("selenium grid http://mygrid:8080/wd/hub --dc.device-orientation portrait --dc.platform \"OS X 10.0\" --page http://example.org --size 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                       .withDesiredCapability("device-orientation", "portrait")
                       .withDesiredCapability("platform", "OS X 10.0"))),
                      
                      
           test("jsfactory script.js http://example.com 640x480", new GalenPageTest()
View Full Code Here

                assertThat(suite.getName(), is("Test using 2 layer tables in browser " + table[j][6] + " for type " + table[j][2]));
                assertThat("Amount of pages for 1st suite should be", suite.getPageTests().size(), is(1));
                // Checking page 1
               
                GalenPageTest page = suite.getPageTests().get(0);
                assertThat(page.getBrowserFactory(), is((BrowserFactory)new SeleniumGridBrowserFactory("http://mygrid:8080/wd/hub")
                                                          .withBrowser((String)table[j][5])
                                                          .withBrowserVersion((String)table[j][7])
                ));
                assertThat(page.getUrl(), is("http://example.com/" + table[j][4]));
                assertThat(page.getScreenSize(), is((Dimension)table[j][0]));
View Full Code Here

TOP

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

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.