1
1
package dev .selenium .bidirectional .webdriver_bidi ;
2
2
3
3
import dev .selenium .BaseTest ;
4
+
5
+ import java .time .Duration ;
4
6
import java .util .List ;
5
7
import org .junit .jupiter .api .Assertions ;
6
8
import org .junit .jupiter .api .BeforeEach ;
20
22
import org .openqa .selenium .firefox .FirefoxOptions ;
21
23
import org .openqa .selenium .print .PrintOptions ;
22
24
import org .openqa .selenium .remote .RemoteWebElement ;
25
+ import org .openqa .selenium .support .ui .WebDriverWait ;
23
26
24
27
import static org .openqa .selenium .support .ui .ExpectedConditions .titleIs ;
25
28
import static org .openqa .selenium .support .ui .ExpectedConditions .visibilityOfElementLocated ;
@@ -31,6 +34,7 @@ public void setup() {
31
34
FirefoxOptions options = new FirefoxOptions ();
32
35
options .setCapability ("webSocketUrl" , true );
33
36
driver = new FirefoxDriver (options );
37
+ wait = new WebDriverWait (driver , Duration .ofSeconds (10 ));
34
38
}
35
39
36
40
@ Test
@@ -235,7 +239,7 @@ void textCaptureScreenshot() {
235
239
236
240
String screenshot = browsingContext .captureScreenshot ();
237
241
238
- Assertions .assertTrue (screenshot .length () > 0 );
242
+ Assertions .assertFalse (screenshot .isEmpty () );
239
243
}
240
244
241
245
@ Test
@@ -251,7 +255,7 @@ void textCaptureViewportScreenshot() {
251
255
browsingContext .captureBoxScreenshot (
252
256
elementRectangle .getX (), elementRectangle .getY (), 5 , 5 );
253
257
254
- Assertions .assertTrue (screenshot .length () > 0 );
258
+ Assertions .assertFalse (screenshot .isEmpty () );
255
259
}
256
260
257
261
@ Test
@@ -263,7 +267,7 @@ void textCaptureElementScreenshot() {
263
267
264
268
String screenshot = browsingContext .captureElementScreenshot (((RemoteWebElement ) element ).getId ());
265
269
266
- Assertions .assertTrue (screenshot .length () > 0 );
270
+ Assertions .assertFalse (screenshot .isEmpty () );
267
271
}
268
272
269
273
@ Test
@@ -305,11 +309,10 @@ void testPrintPage() {
305
309
306
310
String printPage = browsingContext .print (printOptions );
307
311
308
- Assertions .assertTrue (printPage .length () > 0 );
312
+ Assertions .assertFalse (printPage .isEmpty () );
309
313
}
310
314
311
315
@ Test
312
- @ Disabled ("Supported by Firefox Nightly 124" )
313
316
void testNavigateBackInTheBrowserHistory () {
314
317
BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
315
318
browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
@@ -322,7 +325,6 @@ void testNavigateBackInTheBrowserHistory() {
322
325
}
323
326
324
327
@ Test
325
- @ Disabled ("Supported by Firefox Nightly 124" )
326
328
void canNavigateForwardInTheBrowserHistory () {
327
329
BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
328
330
browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
@@ -338,7 +340,6 @@ void canNavigateForwardInTheBrowserHistory() {
338
340
}
339
341
340
342
@ Test
341
- @ Disabled ("Supported by Firefox Nightly 124" )
342
343
void canTraverseBrowserHistory () {
343
344
BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
344
345
browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
0 commit comments