Skip to content

Commit 1a5da2e

Browse files
committed
fix: Make unit tests compatible with Selenium 4.33.0+
1 parent 3e5f9e2 commit 1a5da2e

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

src/test/java/io/appium/java_client/pagefactory_tests/widget/tests/AbstractStubWebDriver.java

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.openqa.selenium.logging.Logs;
1212
import org.openqa.selenium.remote.Response;
1313

14+
import java.time.Duration;
1415
import java.util.HashSet;
1516
import java.util.List;
1617
import java.util.Map;
@@ -155,20 +156,75 @@ public Cookie getCookieNamed(String name) {
155156
@Override
156157
public Timeouts timeouts() {
157158
return new Timeouts() {
158-
@Override
159+
/**
160+
* Does nothing.
161+
*
162+
* @param time The amount of time to wait.
163+
* @param unit The unit of measure for {@code time}.
164+
* @return A self reference.
165+
* @deprecated Kept for the backward compatibility, should be removed when a minimum Selenium
166+
* version is bumped to 4.33.0 or higher.
167+
*/
168+
@Deprecated
159169
public Timeouts implicitlyWait(long time, TimeUnit unit) {
160170
return this;
161171
}
162172

163173
@Override
174+
public Timeouts implicitlyWait(Duration duration) {
175+
return this;
176+
}
177+
178+
/**
179+
* Does nothing.
180+
*
181+
* @param time The timeout value.
182+
* @param unit The unit of time.
183+
* @return A self reference.
184+
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
185+
* this method from its interface.
186+
*/
187+
@Deprecated
164188
public Timeouts setScriptTimeout(long time, TimeUnit unit) {
165189
return this;
166190
}
167191

192+
/**
193+
* Does nothing.
194+
*
195+
* @param duration The timeout value.
196+
* @return A self reference.
197+
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
198+
* this method from its interface.
199+
*/
200+
@Deprecated
201+
public Timeouts setScriptTimeout(Duration duration) {
202+
return this;
203+
}
204+
168205
@Override
206+
public Timeouts scriptTimeout(Duration duration) {
207+
return this;
208+
}
209+
210+
/**
211+
* Does nothing.
212+
*
213+
* @param time The timeout value.
214+
* @param unit The unit of time.
215+
* @return A self reference.
216+
* @deprecated Kept for the backward compatibility, should be removed when Selenium client removes
217+
* this method from its interface.
218+
*/
219+
@Deprecated
169220
public Timeouts pageLoadTimeout(long time, TimeUnit unit) {
170221
return this;
171222
}
223+
224+
@Override
225+
public Timeouts pageLoadTimeout(Duration duration) {
226+
return this;
227+
}
172228
};
173229
}
174230

0 commit comments

Comments
 (0)