1 package com.atlassian.webdriver.waiter.webdriver;
2
3 import com.atlassian.annotations.ExperimentalApi;
4 import org.openqa.selenium.NotFoundException;
5 import org.openqa.selenium.WebDriver;
6 import org.openqa.selenium.support.ui.Clock;
7 import org.openqa.selenium.support.ui.FluentWait;
8 import org.openqa.selenium.support.ui.Sleeper;
9 import org.openqa.selenium.support.ui.SystemClock;
10 import org.openqa.selenium.support.ui.WebDriverWait;
11
12 import java.util.concurrent.TimeUnit;
13
14
15
16
17
18
19
20
21
22
23 @ExperimentalApi
24 public class AtlassianWebDriverWait extends FluentWait<WebDriver>
25 {
26 public AtlassianWebDriverWait(WebDriver input, Clock clock, Sleeper sleeper)
27 {
28 super(input, clock, sleeper);
29 }
30
31
32
33
34
35
36 public AtlassianWebDriverWait(WebDriver driver, long timeOutInMilliSeconds) {
37 this(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMilliSeconds,
38 WebDriverWait.DEFAULT_SLEEP_TIMEOUT
39 );
40 }
41
42
43
44
45
46
47
48 public AtlassianWebDriverWait(WebDriver driver, long timeOutInMilliSeconds, long sleepInMillis) {
49 this(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInMilliSeconds, sleepInMillis);
50 }
51
52
53
54
55
56
57
58
59
60 protected AtlassianWebDriverWait(WebDriver driver, Clock clock, Sleeper sleeper,
61 long timeOutInMilliSeconds, long sleepTimeOut) {
62 super(driver, clock, sleeper);
63 withTimeout(timeOutInMilliSeconds, TimeUnit.MILLISECONDS);
64 pollingEvery(sleepTimeOut, TimeUnit.MILLISECONDS);
65 ignoring(NotFoundException.class);
66 }
67
68 }