|
11 | 11 | import org.openqa.selenium.logging.Logs; |
12 | 12 | import org.openqa.selenium.remote.Response; |
13 | 13 |
|
| 14 | +import java.time.Duration; |
14 | 15 | import java.util.HashSet; |
15 | 16 | import java.util.List; |
16 | 17 | import java.util.Map; |
@@ -155,20 +156,72 @@ public Cookie getCookieNamed(String name) { |
155 | 156 | @Override |
156 | 157 | public Timeouts timeouts() { |
157 | 158 | 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 |
159 | 169 | public Timeouts implicitlyWait(long time, TimeUnit unit) { |
160 | 170 | return this; |
161 | 171 | } |
162 | 172 |
|
163 | | - @Override |
| 173 | + public Timeouts implicitlyWait(Duration duration) { |
| 174 | + return this; |
| 175 | + } |
| 176 | + |
| 177 | + /** |
| 178 | + * Does nothing. |
| 179 | + * |
| 180 | + * @param time The timeout value. |
| 181 | + * @param unit The unit of time. |
| 182 | + * @return A self reference. |
| 183 | + * @deprecated Kept for the backward compatibility, should be removed when Selenium client removes |
| 184 | + * this method from its interface. |
| 185 | + */ |
| 186 | + @Deprecated |
164 | 187 | public Timeouts setScriptTimeout(long time, TimeUnit unit) { |
165 | 188 | return this; |
166 | 189 | } |
167 | 190 |
|
168 | | - @Override |
| 191 | + /** |
| 192 | + * Does nothing. |
| 193 | + * |
| 194 | + * @param duration The timeout value. |
| 195 | + * @return A self reference. |
| 196 | + * @deprecated Kept for the backward compatibility, should be removed when Selenium client removes |
| 197 | + * this method from its interface. |
| 198 | + */ |
| 199 | + @Deprecated |
| 200 | + public Timeouts setScriptTimeout(Duration duration) { |
| 201 | + return this; |
| 202 | + } |
| 203 | + |
| 204 | + public Timeouts scriptTimeout(Duration duration) { |
| 205 | + return this; |
| 206 | + } |
| 207 | + |
| 208 | + /** |
| 209 | + * Does nothing. |
| 210 | + * |
| 211 | + * @param time The timeout value. |
| 212 | + * @param unit The unit of time. |
| 213 | + * @return A self reference. |
| 214 | + * @deprecated Kept for the backward compatibility, should be removed when Selenium client removes |
| 215 | + * this method from its interface. |
| 216 | + */ |
| 217 | + @Deprecated |
169 | 218 | public Timeouts pageLoadTimeout(long time, TimeUnit unit) { |
170 | 219 | return this; |
171 | 220 | } |
| 221 | + |
| 222 | + public Timeouts pageLoadTimeout(Duration duration) { |
| 223 | + return this; |
| 224 | + } |
172 | 225 | }; |
173 | 226 | } |
174 | 227 |
|
|
0 commit comments