Examples of StaticSitePage


Examples of net.thucydides.core.pages.integration.StaticSitePage

    private static WebDriver driver;

    @BeforeClass
    public static void openDriver() {
        driver = new FirefoxDriver();
        page = new StaticSitePage(driver, 1000);
        page.open();
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    public void should_resize_chrome_automatically() {
        environmentVariables.setProperty("thucydides.browser.height", "200");
        environmentVariables.setProperty("thucydides.browser.width", "400");

        driver = factory.newInstanceOf(SupportedWebDriver.CHROME);
        page = new StaticSitePage(driver, 1000);
        page.open();

        int width = ((Long)(((JavascriptExecutor)driver).executeScript("return window.innerWidth"))).intValue();
        assertThat(width, allOf(lessThanOrEqualTo(400), greaterThan(380)));
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    public void should_resize_firefox_automatically() {
        environmentVariables.setProperty("thucydides.browser.height", "200");
        environmentVariables.setProperty("thucydides.browser.width", "400");

        driver = factory.newInstanceOf(SupportedWebDriver.FIREFOX);
        page = new StaticSitePage(driver, 1000);
        page.open();

        int width = ((Long)(((JavascriptExecutor)driver).executeScript("return window.innerWidth"))).intValue();
        assertThat(width, allOf(lessThanOrEqualTo(450), greaterThan(350)));
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    private static StaticSitePage staticPage;

    @BeforeClass
    public static void openBrowsers() {
        driver = new FirefoxDriver();
        staticPage = new StaticSitePage(driver, 1000);
        staticPage.open();
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    }

    @Test
    public void should_optionally_type_enter_after_entering_text() {

        StaticSitePage page = getFirefoxPage();
        page.getDriver().navigate().refresh();

        assertThat(page.firstName.getAttribute("value"), is("<enter first name>"));

        page.element(page.firstName).typeAndEnter("joe");

        assertThat(page.firstName.getAttribute("value"), is("joe"));
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    @Test
    public void should_optionally_type_tab_after_entering_text_on_linux() {

        if (runningOnLinux()) {
            StaticSitePage page = getChromePage();

            assertThat(page.firstName.getAttribute("value"), is("<enter first name>"));

            page.element(page.firstName).typeAndTab("joe");

            assertThat(page.element(page.lastName).hasFocus(), is(true));
        }
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

    @Test
    public void should_trigger_blur_event_when_focus_leaves_field_in_chrome() {
        // Not supported on Windows
        if (!OS.isFamilyWindows()) {
            StaticSitePage page = getChromePage();
            page.getDriver().navigate().refresh();

            assertThat(page.firstName.getAttribute("value"), is("<enter first name>"));

            assertThat(page.focusmessage.getText(), is(""));

            page.element(page.firstName).typeAndTab("joe");

            assertThat(page.focusmessage.getText(), is("focus left firstname"));
        }
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

        }
    }

    @Test
    public void should_be_able_to_build_composite_wait_until_enabled_clauses() throws InterruptedException {
        StaticSitePage page = getFirefoxPage();

        page.waitForCondition().until(page.firstAndLastNameAreEnabled());
    }
View Full Code Here

Examples of net.thucydides.core.pages.integration.StaticSitePage

        page.waitForCondition().until(page.firstAndLastNameAreEnabled());
    }

    @Test
    public void should_wait_for_elements_to_appear() {
        StaticSitePage page = getChromePage();
        page.waitForAnyRenderedElementOf(By.id("city"));
        assertThat(page.element(page.city).isCurrentlyVisible(), is(true));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.