tor-browser

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

test_1905607_10play_com_au.py (1032B)


      1 import pytest
      2 
      3 URL = "https://10play.com.au/masterchef/episodes/season-16"
      4 SUPPORTED_TEXT = "Sign in to watch this video"
      5 UNSUPPORTED_TEXT = "Your mobile browser is not supported"
      6 NEED_VPN_TEXT = "not available in your region"
      7 
      8 
      9 async def visit_site(client, expected):
     10    await client.navigate(URL)
     11    expected, vpn = client.await_first_element_of(
     12        [client.text(expected), client.text(NEED_VPN_TEXT)], is_displayed=True
     13    )
     14    if vpn:
     15        pytest.skip("Region-locked, cannot test. Try using a VPN set to Australia.")
     16    return expected
     17 
     18 
     19 @pytest.mark.only_platforms("android")
     20 @pytest.mark.asyncio
     21 @pytest.mark.with_interventions
     22 async def test_enabled(client):
     23    assert await visit_site(client, SUPPORTED_TEXT)
     24    assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True)
     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 visit_site(client, UNSUPPORTED_TEXT)
     32    assert not client.find_text(SUPPORTED_TEXT)