Package ru.yandex.qatools.htmlelements.element

Examples of ru.yandex.qatools.htmlelements.element.HtmlElement


    private NamedHtmlElementListPage page = new NamedHtmlElementListPage();

    @Test
    public void htmlElementListItemsShouldHaveCorrectNames() {
        for (int i = 0; i < NamedHtmlElementListPage.getCompaniesNumber(); i++) {
            HtmlElement item = page.getPopularCompaniesList().get(i);
            String expectedName = String.format("%s [%d]", NamedHtmlElementListPage.getPopularCompaniesListName(), i);

            assertThat(String.format("Item should have name %s", expectedName),
                    item.getName(), is(expectedName));
        }
    }
View Full Code Here


     * @see #populateHtmlElement(HtmlElement, SearchContext)
     * @see #createPageObject(Class, WebDriver)
     */
    public static <T> void populate(T instance, WebDriver driver) {
        if (isHtmlElement(instance)) {
            HtmlElement htmlElement = (HtmlElement) instance;
            populateHtmlElement(htmlElement, driver);
        } else {
            // Otherwise consider instance as a page object
            populatePageObject(instance, driver);
        }
View Full Code Here

    private static final String TEXT = "text";
    private static final String ERROR_TEXT = "error text";

    @Test
    public void shouldSeeThatHasTextMatchersWorkTheSameWay() {
        HtmlElement element = mock(HtmlElement.class);
        WebElement wrappedElement = mock(WebElement.class);

        when(element.getText()).thenReturn(TEXT);
        when(element.getWrappedElement()).thenReturn(wrappedElement);
        when(wrappedElement.getText()).thenReturn(ERROR_TEXT);

        assertThat(element, WebElementMatchers.hasText(TEXT));
        assertThat(element, WrapsElementMatchers.hasText(TEXT));
    }
View Full Code Here

TOP

Related Classes of ru.yandex.qatools.htmlelements.element.HtmlElement

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.