tor-browser

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

test_1982880_yoshinoya-mini-web_starboss_biz.py (969B)


      1 import pytest
      2 
      3 URL = "https://yoshinoya-mini-web.starboss.biz/main"
      4 SUPPORTED_CSS = ".search-form"
      5 UNSUPPORTED_CSS = ".not-support-title"
      6 VPN_TEXT = "403 Forbidden"
      7 
      8 
      9 async def check_site(client, expected_css):
     10    await client.navigate(URL, wait="none")
     11    expected, vpn = client.await_first_element_of(
     12        [client.css(expected_css), client.text(VPN_TEXT)],
     13        is_displayed=True,
     14    )
     15    if vpn:
     16        pytest.skip("Region-locked, cannot test. Try using a VPN set to Japan.")
     17 
     18 
     19 @pytest.mark.only_platforms("android")
     20 @pytest.mark.asyncio
     21 @pytest.mark.with_interventions
     22 async def test_enabled(client):
     23    await check_site(client, SUPPORTED_CSS)
     24    assert not client.find_css(UNSUPPORTED_CSS, 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    await check_site(client, UNSUPPORTED_CSS)
     32    assert not client.find_css(SUPPORTED_CSS, is_displayed=True)