Package net.mindengine.galen.suite

Examples of net.mindengine.galen.suite.GalenPageTest


        List<GalenTest> galenTests = new LinkedList<GalenTest>();
       
        for (String pageSpecPath : arguments.getPaths()) {
            GalenBasicTest test = new GalenBasicTest();
            test.setName(pageSpecPath);
            test.setPageTests(asList(new GalenPageTest()
                .withTitle("Simple check")
                .withUrl(arguments.getUrl())
                .withSize(arguments.getScreenSize())
                .withBrowserFactory(new SeleniumBrowserFactory(SeleniumBrowserFactory.FIREFOX))
                .withActions(asList((GalenPageAction)new GalenPageActionCheck()
View Full Code Here


    }
    private static GalenPageTest jsBrowserFactory(String title, String[] args) {
        if (args.length < 2) {
            throw new SyntaxException("Missing script path");
        }
        return new GalenPageTest()
            .withBrowserFactory(new JsBrowserFactory(args[1], stripFirst(2, args)))
            .withTitle(title);
    }
View Full Code Here

                String desiredCapaibility = parameter.substring(3);
                browserFactory.withDesiredCapability(desiredCapaibility, command.get(parameter));
            }
        }
       
        return new GalenPageTest()
            .withUrl(pageUrl)
            .withSize(readSize(size))
            .withBrowserFactory(browserFactory);
    }
View Full Code Here

    }
    private static GalenPageTest seleniumSimpleGalenPageTest(String title, String browser, String url, String screenSize) {
        if (url.equals("-")) {
            url = null;
        }
        return new GalenPageTest()
            .withTitle(title)
            .withUrl(url)
            .withSize(GalenUtils.readSize(screenSize))
            .withBrowserFactory(new SeleniumBrowserFactory(browser));
    }
View Full Code Here

       
        if (url.equals("-")) {
            url = null;
        }
       
        return new GalenPageTest()
            .withTitle(title)
            .withUrl(url)
            .withSize(GalenUtils.readSize(sizeText))
            .withBrowserFactory(new SeleniumBrowserFactory());
    }
View Full Code Here

        return actionNode;
    }

    @Override
    public GalenPageTest build(VarsContext context) {
        GalenPageTest pageTest;
        try {
            pageTest = GalenPageTestReader.readFrom(context.process(getArguments()));
        }
        catch (SyntaxException e) {
            e.setLine(getLine());
            throw e;
        }
       
        List<GalenPageAction> actions = new LinkedList<GalenPageAction>();
        pageTest.setActions(actions);
       
       
        for (Node<?> childNode : getChildNodes()) {
            if (childNode instanceof ActionNode) {
                ActionNode actionNode = (ActionNode)childNode;
View Full Code Here

       
        assertThat("Amount of suites should be", galenSuites.size(), is(4));
       
        for (int i = 0; i < 4; i++) {
            assertThat(galenSuites.get(i).getName(), is("Suite " + (i+1)));
            GalenPageTest pageTest = galenSuites.get(i).getPageTests().get(0);
            assertThat(pageTest.getUrl(), is(nullValue()));
        }
       
        assertThat(galenSuites.get(0).getPageTests().get(0).getScreenSize(), is(new Dimension(640, 480)));
        assertThat(galenSuites.get(1).getPageTests().get(0).getScreenSize(), is(nullValue()));
        assertThat(galenSuites.get(2).getPageTests().get(0).getScreenSize(), is(new Dimension(320, 240)));
View Full Code Here

        assertThat("Search input should not contain any text yet", element.getAttribute("value"), is(""));
       
        GalenPageActionRunJavascript action = new GalenPageActionRunJavascript(getClass().getResource("/scripts/to-run-1.js").getFile());
        action.setJsonArguments("{prefix: 'This was'}");
       
        action.execute(new TestReport(), browser, new GalenPageTest(), null);
       
        assertThat("Search input should contain text", element.getAttribute("value"), is("This was typed by a selenium from javascript text from imported script"));
        browser.quit();
    }
View Full Code Here

public class GalenPageTestParserTest {

   
    @Test(dataProvider="provideGoodSamples") public void shouldParse_galenPageTest_successfully(String text, GalenPageTest expected) {
        GalenPageTest real = GalenPageTestReader.readFrom(text);
        assertThat(real, is(expected));
    }
View Full Code Here

    }
   
   
    @DataProvider public Object[][] provideGoodSamples() {
        return new Object[][]{
           test("http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory())),
          
           test("selenium firefox http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory())),
          
           test("selenium chrome http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory(SeleniumBrowserFactory.CHROME))),
          
           test("selenium ie http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory(SeleniumBrowserFactory.IE))),
                  
           test("selenium whatever_other_browser http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory("whatever_other_browser"))),
                  
           test("Selenium Chrome http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .withBrowserFactory(new SeleniumBrowserFactory(SeleniumBrowserFactory.CHROME))),
                  
           test("SELENIUM CHROME http://example.org 640x480", new GalenPageTest()
                   .withUrl("http://example.org")
                   .withSize(640, 480)
                   .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()
                   .withBrowserFactory(new JsBrowserFactory("script.js", new String[]{"http://example.com", "640x480"})))
        };
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.suite.GalenPageTest

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.