tor-browser

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

test_1902450_hilokal_com.py (1137B)


      1 import pytest
      2 from webdriver import NoSuchElementException
      3 
      4 URL = "https://www.hilokal.com/"
      5 UNSUPPORTED_TEXT = "Chrome"
      6 HERO_CSS = "button.download-button"
      7 LISTEN_BUTTON_CSS = "button.home-main-listen-button-text"
      8 
      9 
     10 async def does_warning_appear(client):
     11    await client.navigate(URL)
     12    try:
     13        client.await_text(UNSUPPORTED_TEXT, is_displayed=True, timeout=3)
     14        return True
     15    except NoSuchElementException:
     16        return False
     17 
     18 
     19 @pytest.mark.skip_platforms("android")
     20 @pytest.mark.asyncio
     21 @pytest.mark.with_interventions
     22 async def test_enabled(client):
     23    assert not await does_warning_appear(client)
     24 
     25 
     26 @pytest.mark.skip_platforms("android")
     27 @pytest.mark.asyncio
     28 @pytest.mark.without_interventions
     29 async def test_disabled(client):
     30    assert await does_warning_appear(client)
     31 
     32 
     33 @pytest.mark.only_platforms("android")
     34 @pytest.mark.asyncio
     35 @pytest.mark.without_interventions
     36 async def test_missing_android_support(client):
     37    await client.navigate(URL, wait="none")
     38    assert client.await_css(HERO_CSS, is_displayed=True)
     39    await client.stall(1)
     40    assert not client.find_css(LISTEN_BUTTON_CSS, is_displayed=True)