tor-browser

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

test_1902459_coupangplay_com.py (1012B)


      1 import pytest
      2 
      3 URL = "https://www.coupangplay.com/"
      4 LOGIN_CSS = "a[href*=login]"
      5 UNSUPPORTED_TEXT = "서비스 이용에 불편을 드려 죄송합니다"
      6 VPN_TEXT = "not available in your region"
      7 
      8 
      9 async def check_can_login(client):
     10    await client.make_preload_script("delete navigator.__proto__.webdriver")
     11    await client.navigate(URL)
     12    login, unsupported, need_vpn = client.await_first_element_of(
     13        [client.css(LOGIN_CSS), client.text(UNSUPPORTED_TEXT), client.text(VPN_TEXT)],
     14        is_displayed=True,
     15    )
     16    if need_vpn:
     17        pytest.skip("Region-locked, cannot test. Try using a VPN set to South Korea.")
     18        return False
     19    return login
     20 
     21 
     22 @pytest.mark.skip_platforms("android")
     23 @pytest.mark.asyncio
     24 @pytest.mark.with_interventions
     25 async def test_enabled(client):
     26    assert await check_can_login(client)
     27 
     28 
     29 @pytest.mark.skip_platforms("android")
     30 @pytest.mark.asyncio
     31 @pytest.mark.without_interventions
     32 async def test_disabled(client):
     33    assert not await check_can_login(client)