Package net.mindengine.galen.browser

Examples of net.mindengine.galen.browser.SeleniumBrowser


        js.eval(scriptFileReader, javascriptPath);
    }
   
    private void provideWrappedWebDriver(GalenJsExecutor jsExecutor, Browser browser) {
        if (browser instanceof SeleniumBrowser) {
            SeleniumBrowser seleniumBrowser = (SeleniumBrowser) browser;
            WebDriverWrapper driver = new WebDriverWrapper(seleniumBrowser.getDriver());
            jsExecutor.putObject("driver", driver);
        }
       
    }
View Full Code Here


public class GalenPageActionRunJavascriptTest {
    private static final String TEST_URL = "file://" + GalenPageActionCheckTest.class.getResource("/html/page-for-js-check.html").getPath();
   
    @Test public void shouldRun_javascriptFile_andPerformActions_onBrowser() throws Exception {
        WebDriver driver = new FirefoxDriver();
        Browser browser = new SeleniumBrowser(driver);
        browser.load(TEST_URL);
       
        WebElement element = driver.findElement(By.id("search-query"));
        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

        driver.quit();
    }
   
    @Test
    public void performsValidation_forAll() throws Exception {
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        openDriverForNicePage();
       
        driver.manage().window().maximize();
       
View Full Code Here

   
    @Test
    public void performsValidation_forMobile_withTwoSections() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void shouldCheck_relativeToScreen() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void shouldCheck_relativeToViewport() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void shouldCheck_multipleObjects() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(1024, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void shouldCheck_text() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void shouldCheck_multiObjects() throws Exception {
        openDriverForNicePage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(1000, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
View Full Code Here

   
    @Test
    public void givesErrors_whenValidating_incorrectWebSite() throws Exception {
        openDriverForBadPage();
       
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResourceAsStream("/html/page.spec"));
       
        driver.manage().window().setSize(new Dimension(400, 1000));
       
        SeleniumPage page = new SeleniumPage(driver);
       
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.