1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.test.ui

File XWikiWebDriver.java

 
testMail: Timed out after 10 seconds waiting for org.xwiki.test.ui....
testUploadImageAfterPreview: Timed out after 10 seconds waiting for org.xwiki.test.ui....
 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

16
173
86
1
888
587
108
0.62
2.01
86
1.26

Classes

Class Line # Actions
XWikiWebDriver 58 173 0% 108 62
0.7745454377.5%
 

Contributing tests

This file is covered by 575 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.test.ui;
21   
22    import java.util.List;
23    import java.util.Set;
24    import java.util.concurrent.TimeUnit;
25    import java.util.logging.Level;
26   
27    import org.apache.commons.lang3.StringUtils;
28    import org.openqa.selenium.By;
29    import org.openqa.selenium.Capabilities;
30    import org.openqa.selenium.Keys;
31    import org.openqa.selenium.NoSuchElementException;
32    import org.openqa.selenium.NotFoundException;
33    import org.openqa.selenium.OutputType;
34    import org.openqa.selenium.StaleElementReferenceException;
35    import org.openqa.selenium.WebDriver;
36    import org.openqa.selenium.WebDriverException;
37    import org.openqa.selenium.WebElement;
38    import org.openqa.selenium.interactions.Keyboard;
39    import org.openqa.selenium.interactions.Mouse;
40    import org.openqa.selenium.remote.CommandExecutor;
41    import org.openqa.selenium.remote.ErrorHandler;
42    import org.openqa.selenium.remote.FileDetector;
43    import org.openqa.selenium.remote.RemoteStatus;
44    import org.openqa.selenium.remote.RemoteWebDriver;
45    import org.openqa.selenium.remote.SessionId;
46    import org.openqa.selenium.support.ui.ExpectedCondition;
47    import org.openqa.selenium.support.ui.Wait;
48    import org.openqa.selenium.support.ui.WebDriverWait;
49    import org.slf4j.Logger;
50    import org.slf4j.LoggerFactory;
51   
52    /**
53    * Wraps a {@link org.openqa.selenium.WebDriver} instance and adds new APIs useful for XWiki tests.
54    *
55    * @version $Id: 7bf9dcc5ed104091976e5b1e4fa9ab7856d7004b $
56    * @since 7.0M2
57    */
 
58    public class XWikiWebDriver extends RemoteWebDriver
59    {
60    private final static Logger LOGGER = LoggerFactory.getLogger(XWikiWebDriver.class);
61   
62    private RemoteWebDriver wrappedDriver;
63   
64    /**
65    * How long to wait (in seconds) before failing a test because an element cannot be found. Can be overridden with
66    * setTimeout.
67    */
68    private int timeout = 10;
69   
 
70  32 toggle public XWikiWebDriver(RemoteWebDriver wrappedDriver)
71    {
72  32 this.wrappedDriver = wrappedDriver;
73   
74    // Wait when trying to find elements till the timeout expires
75  32 setDriverImplicitWait();
76    }
77   
78    // XWiki-specific APIs
79   
 
80  4200 toggle public WebElement findElementWithoutWaiting(By by)
81    {