test_1902412_esampark_wondercement_com.py (915B)
1 import pytest 2 from webdriver.bidi.error import UnknownErrorException 3 4 URL = "https://esampark.wondercement.com/" 5 6 UNSUPPORTED_ALERT = "Google Chrome" 7 LOGIN_CSS = "#UserName" 8 VPN_TEXT = "502 - Bad Gateway" 9 10 11 async def visit_site(client): 12 await client.navigate(URL, wait="none") 13 login, vpn = client.await_first_element_of( 14 [client.css(LOGIN_CSS), client.text(VPN_TEXT)], is_displayed=True, timeout=20 15 ) 16 if vpn: 17 pytest.skip("Region-locked, cannot test. Try using a VPN set to the USA.") 18 19 20 @pytest.mark.asyncio 21 @pytest.mark.with_interventions 22 async def test_enabled(client): 23 await visit_site(client) 24 assert not await client.find_alert(delay=3) 25 26 27 @pytest.mark.asyncio 28 @pytest.mark.without_interventions 29 async def test_disabled(client): 30 try: 31 await visit_site(client) 32 except UnknownErrorException: 33 pass 34 assert await client.await_alert(UNSUPPORTED_ALERT)