tor-browser

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

test_1927984_modules_sms-timing_com.py (880B)


      1 import pytest
      2 
      3 URL = "https://modules.sms-timing.com/livetiming/?key=Zm9ybXVsYS1udWVybmJlcmc6OTUyN2Q1ODAtZmNkMi00NTZjLWI0YmQtZDY5OGQ5OWVhNWZl&locale=GER"
      4 
      5 SUPPORTED_CSS = "#timingTable td"
      6 UNSUPPORTED_CSS = "a[href*=browserchoice]"
      7 NO_RACES_TEXT = "Keine laufenden Rennen"
      8 
      9 
     10 @pytest.mark.asyncio
     11 @pytest.mark.with_interventions
     12 async def test_enabled(client):
     13    await client.navigate(URL)
     14    races, no_races = client.await_first_element_of(
     15        [client.css(SUPPORTED_CSS), client.text(NO_RACES_TEXT)], is_displayed=True
     16    )
     17    assert races or no_races
     18    assert not client.find_css(UNSUPPORTED_CSS, is_displayed=True)
     19 
     20 
     21 @pytest.mark.asyncio
     22 @pytest.mark.without_interventions
     23 async def test_disabled(client):
     24    await client.navigate(URL)
     25    assert client.await_css(UNSUPPORTED_CSS, is_displayed=True)
     26    assert not client.find_css(SUPPORTED_CSS, is_displayed=True)