tor-browser

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

test_1934567_www_port8_fi.py (888B)


      1 import asyncio
      2 
      3 import pytest
      4 
      5 URL = "https://www.port8.fi/bokning/"
      6 
      7 
      8 async def check_if_scrolling_works(client):
      9    await client.navigate(URL)
     10    body = client.await_css("body")
     11    expected_pos = client.execute_script("return window.scrollY")
     12    client.apz_scroll(body, dy=100000)
     13    await asyncio.sleep(0.2)
     14    final_pos = client.execute_script("return window.scrollY")
     15    return expected_pos != final_pos
     16 
     17 
     18 @pytest.mark.only_platforms("android")
     19 @pytest.mark.actual_platform_required
     20 @pytest.mark.asyncio
     21 @pytest.mark.with_interventions
     22 async def test_enabled(client, in_headless_mode):
     23    assert await check_if_scrolling_works(client)
     24 
     25 
     26 @pytest.mark.only_platforms("android")
     27 @pytest.mark.actual_platform_required
     28 @pytest.mark.asyncio
     29 @pytest.mark.without_interventions
     30 async def test_disabled(client, in_headless_mode):
     31    assert not await check_if_scrolling_works(client)