@@ -389,18 +389,20 @@ async def test_retrieve_cookies(widget, probe, on_load):
389389 assert cookie .expires is None
390390
391391
392+ @pytest .mark .flaky (retries = 5 , delay = 1 )
392393async def test_on_navigation_starting_sync_no_handler (widget , probe , on_load ):
393394 # This test is required for full coverage because on android, setting
394395 # the URL does not trigger shouldOverrideUrlLoading()
395396 await widget .evaluate_javascript ('window.location.assign("https://beeware.org/")' )
396- await asyncio .sleep (2 )
397+ await asyncio .sleep (5 )
397398 await widget .evaluate_javascript (
398399 'window.location.assign("https://beeware.org/docs/")'
399400 )
400- await asyncio .sleep (2 )
401+ await asyncio .sleep (5 )
401402 assert widget .url == "https://beeware.org/docs/"
402403
403404
405+ @pytest .mark .flaky (retries = 5 , delay = 1 )
404406async def test_on_navigation_starting_sync (widget , probe , on_load ):
405407 if not getattr (widget ._impl , "SUPPORTS_ON_NAVIGATION_STARTING" , True ):
406408 pytest .skip ("Platform doesn't support on_navigation_starting" )
@@ -441,17 +443,18 @@ def handler(widget, url, **kwargs):
441443 await widget .evaluate_javascript (
442444 'window.location.assign("https://github.com/beeware/toga/")'
443445 )
444- await probe .redraw ("Attempt to navigate to forbidden URL" , delay = 1 )
446+ await probe .redraw ("Attempt to navigate to forbidden URL" , delay = 5 )
445447
446448 assert widget .url == "https://github.com/beeware/"
447449 # simulate browser navigation to allowed url
448450 await widget .evaluate_javascript (
449451 'window.location.assign("https://beeware.org/docs/")'
450452 )
451- await probe .redraw ("Attempt to navigate to allowed URL" , delay = 1 )
453+ await probe .redraw ("Attempt to navigate to allowed URL" , delay = 5 )
452454 assert widget .url == "https://beeware.org/docs/"
453455
454456
457+ @pytest .mark .flaky (retries = 5 , delay = 1 )
455458async def test_on_navigation_starting_async (widget , probe , on_load ):
456459 if not getattr (widget ._impl , "SUPPORTS_ON_NAVIGATION_STARTING" , True ):
457460 pytest .skip ("Platform doesn't support on_navigation_starting" )
@@ -492,12 +495,12 @@ async def handler(widget, url, **kwargs):
492495 await widget .evaluate_javascript (
493496 'window.location.assign("https://github.com/beeware/toga/")'
494497 )
495- await probe .redraw ("Attempt to navigate to denied URL" , delay = 1 )
498+ await probe .redraw ("Attempt to navigate to denied URL" , delay = 5 )
496499 assert widget .url == "https://github.com/beeware/"
497500
498501 # simulate browser navigation to allowed url
499502 await widget .evaluate_javascript (
500503 'window.location.assign("https://beeware.org/docs/")'
501504 )
502- await probe .redraw ("Attempt to navigate to allowed URL" , delay = 1 )
505+ await probe .redraw ("Attempt to navigate to allowed URL" , delay = 5 )
503506 assert widget .url == "https://beeware.org/docs/"
0 commit comments