test_1902406_sp_hi_co_kr.py (1027B)
1 import pytest 2 3 URL = "https://sp.hi.co.kr" 4 5 SUPPORTED_URL = "websquare/websquare.html?w2xPath=/common/xml/Login.xml" 6 UNSUPPORTED_URL = "Wizvera/veraport/install20/install_sample.html" 7 UNSUPPORTED_ALERT_MSG = "Chrome" 8 9 # the site tends to timeout unless viewing it over a VPN. 10 VPN_MESSAGE = "Please try again using a VPN set to South Korea." 11 12 13 async def do_test(client, redirect_url, alert=None): 14 redirect = await client.promise_navigation_begins(url=redirect_url, timeout=10) 15 16 try: 17 await client.navigate(URL, timeout=10, no_skip=True) 18 except Exception: 19 pytest.skip(VPN_MESSAGE) 20 21 if alert: 22 assert await client.await_alert(alert) 23 24 assert await redirect 25 26 27 @pytest.mark.asyncio 28 @pytest.mark.with_interventions 29 async def test_enabled(client): 30 await do_test(client, SUPPORTED_URL) 31 assert not await client.find_alert() 32 33 34 @pytest.mark.asyncio 35 @pytest.mark.without_interventions 36 async def test_disabled(client): 37 await do_test(client, UNSUPPORTED_URL, alert=UNSUPPORTED_ALERT_MSG)