tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_1943898_capital_gr.py (776B)


      1 import asyncio
      2 
      3 import pytest
      4 
      5 URL = "https://www.capital.gr/"
      6 
      7 
      8 async def is_reload_cycle_detected(client):
      9    await client.navigate(URL)
     10    client.await_css("#alwaysFetch")
     11    client.execute_script("location.reload()")
     12    await asyncio.sleep(1)
     13    try:
     14        await (await client.promise_navigation_begins(URL, timeout=3))
     15        return True
     16    except asyncio.exceptions.TimeoutError:
     17        return False
     18 
     19 
     20 @pytest.mark.only_platforms("android")
     21 @pytest.mark.asyncio
     22 @pytest.mark.with_interventions
     23 async def test_enabled(client):
     24    assert not await is_reload_cycle_detected(client)
     25 
     26 
     27 @pytest.mark.only_platforms("android")
     28 @pytest.mark.asyncio
     29 @pytest.mark.without_interventions
     30 async def test_disabled(client):
     31    assert await is_reload_cycle_detected(client)