11package dev .selenium .bidirectional .webdriver_bidi ;
22
33import dev .selenium .BaseTest ;
4+
5+ import java .time .Duration ;
46import java .util .List ;
57import org .junit .jupiter .api .Assertions ;
68import org .junit .jupiter .api .BeforeEach ;
2022import org .openqa .selenium .firefox .FirefoxOptions ;
2123import org .openqa .selenium .print .PrintOptions ;
2224import org .openqa .selenium .remote .RemoteWebElement ;
25+ import org .openqa .selenium .support .ui .WebDriverWait ;
2326
2427import static org .openqa .selenium .support .ui .ExpectedConditions .titleIs ;
2528import static org .openqa .selenium .support .ui .ExpectedConditions .visibilityOfElementLocated ;
@@ -31,6 +34,7 @@ public void setup() {
3134 FirefoxOptions options = new FirefoxOptions ();
3235 options .setCapability ("webSocketUrl" , true );
3336 driver = new FirefoxDriver (options );
37+ wait = new WebDriverWait (driver , Duration .ofSeconds (10 ));
3438 }
3539
3640 @ Test
@@ -235,7 +239,7 @@ void textCaptureScreenshot() {
235239
236240 String screenshot = browsingContext .captureScreenshot ();
237241
238- Assertions .assertTrue (screenshot .length () > 0 );
242+ Assertions .assertFalse (screenshot .isEmpty () );
239243 }
240244
241245 @ Test
@@ -251,7 +255,7 @@ void textCaptureViewportScreenshot() {
251255 browsingContext .captureBoxScreenshot (
252256 elementRectangle .getX (), elementRectangle .getY (), 5 , 5 );
253257
254- Assertions .assertTrue (screenshot .length () > 0 );
258+ Assertions .assertFalse (screenshot .isEmpty () );
255259 }
256260
257261 @ Test
@@ -263,7 +267,7 @@ void textCaptureElementScreenshot() {
263267
264268 String screenshot = browsingContext .captureElementScreenshot (((RemoteWebElement ) element ).getId ());
265269
266- Assertions .assertTrue (screenshot .length () > 0 );
270+ Assertions .assertFalse (screenshot .isEmpty () );
267271 }
268272
269273 @ Test
@@ -305,11 +309,10 @@ void testPrintPage() {
305309
306310 String printPage = browsingContext .print (printOptions );
307311
308- Assertions .assertTrue (printPage .length () > 0 );
312+ Assertions .assertFalse (printPage .isEmpty () );
309313 }
310314
311315 @ Test
312- @ Disabled ("Supported by Firefox Nightly 124" )
313316 void testNavigateBackInTheBrowserHistory () {
314317 BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
315318 browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
@@ -322,7 +325,6 @@ void testNavigateBackInTheBrowserHistory() {
322325 }
323326
324327 @ Test
325- @ Disabled ("Supported by Firefox Nightly 124" )
326328 void canNavigateForwardInTheBrowserHistory () {
327329 BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
328330 browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
@@ -338,7 +340,6 @@ void canNavigateForwardInTheBrowserHistory() {
338340 }
339341
340342 @ Test
341- @ Disabled ("Supported by Firefox Nightly 124" )
342343 void canTraverseBrowserHistory () {
343344 BrowsingContext browsingContext = new BrowsingContext (driver , driver .getWindowHandle ());
344345 browsingContext .navigate ("https://www.selenium.dev/selenium/web/formPage.html" , ReadinessState .COMPLETE );
0 commit comments