test_1906630_watch_foxtel_com_au.py (958B)
1 import pytest 2 3 URL = "https://watch.foxtel.com.au/app/#/live/fs1" 4 SUPPORTED_CSS = ".login-page" 5 UNSUPPORTED_CSS = ".ua-barrier" 6 NEED_VPN_TEXT = "Access Denied" 7 8 9 async def visit_site(client, expected): 10 await client.navigate(URL) 11 expected, vpn = client.await_first_element_of( 12 [client.css(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.skip_platforms("android") 20 @pytest.mark.asyncio 21 @pytest.mark.with_interventions 22 async def test_enabled(client): 23 assert await visit_site(client, SUPPORTED_CSS) 24 assert not client.find_css(UNSUPPORTED_CSS, is_displayed=True) 25 26 27 @pytest.mark.skip_platforms("android") 28 @pytest.mark.asyncio 29 @pytest.mark.without_interventions 30 async def test_disabled(client): 31 assert await visit_site(client, UNSUPPORTED_CSS) 32 assert not client.find_css(SUPPORTED_CSS)