001/*
002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Thomas Roger
016 */
017
018package org.nuxeo.functionaltests.fragment;
019
020import java.util.List;
021
022import org.openqa.selenium.By;
023import org.openqa.selenium.Dimension;
024import org.openqa.selenium.Point;
025import org.openqa.selenium.WebElement;
026
027/**
028 * @since 5.7.3
029 */
030public interface WebFragment {
031
032    // custom API
033
034    WebElement getElement();
035
036    void setElement(WebElement element);
037
038    String getId();
039
040    boolean containsText(String text);
041
042    void waitForTextToBePresent(String text);
043
044    void checkTextToBePresent(String text);
045
046    void checkTextToBeNotPresent(String text);
047
048    <T extends WebFragment> T getWebFragment(By by, Class<T> webFragmentClass);
049
050    <T extends WebFragment> T getWebFragment(WebElement element, Class<T> webFragmentClass);
051
052    // WebElement API
053
054    void click();
055
056    void submit();
057
058    void sendKeys(CharSequence... keysToSend);
059
060    void clear();
061
062    String getTagName();
063
064    String getAttribute(String name);
065
066    boolean isSelected();
067
068    boolean isEnabled();
069
070    String getText();
071
072    List<WebElement> findElements(By by);
073
074    WebElement findElement(By by);
075
076    boolean isDisplayed();
077
078    Point getLocation();
079
080    Dimension getSize();
081
082    String getCssValue(String propertyName);
083
084}