001/*
002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Thomas Roger
018 */
019
020package org.nuxeo.functionaltests.fragment;
021
022import java.util.List;
023
024import org.openqa.selenium.By;
025import org.openqa.selenium.Dimension;
026import org.openqa.selenium.Point;
027import org.openqa.selenium.WebElement;
028
029/**
030 * @since 5.7.3
031 */
032public interface WebFragment {
033
034    // custom API
035
036    WebElement getElement();
037
038    void setElement(WebElement element);
039
040    String getId();
041
042    boolean containsText(String text);
043
044    void waitForTextToBePresent(String text);
045
046    void checkTextToBePresent(String text);
047
048    void checkTextToBeNotPresent(String text);
049
050    <T extends WebFragment> T getWebFragment(By by, Class<T> webFragmentClass);
051
052    <T extends WebFragment> T getWebFragment(WebElement element, Class<T> webFragmentClass);
053
054    // WebElement API
055
056    void click();
057
058    void submit();
059
060    void sendKeys(CharSequence... keysToSend);
061
062    void clear();
063
064    String getTagName();
065
066    String getAttribute(String name);
067
068    boolean isSelected();
069
070    boolean isEnabled();
071
072    String getText();
073
074    List<WebElement> findElements(By by);
075
076    WebElement findElement(By by);
077
078    boolean isDisplayed();
079
080    Point getLocation();
081
082    Dimension getSize();
083
084    String getCssValue(String propertyName);
085
086}