test_1899929_selecionases_saude_pe_gov_br.py (1117B)
1 import pytest 2 from webdriver.error import NoSuchElementException 3 4 URL = "https://selecionases.saude.pe.gov.br/SelecionaSES/login" 5 6 SUPPORTED_CSS = "#login" 7 UNSUPPORTED_CSS = "img[alt='Google Chrome']" 8 9 # This site seems to stall indefinitely when connecting via VPN on a 10 # desktop release in automated tests, but not on mobile, and not when 11 # manually testing, curiously enough. 12 VPN_MESSAGE = "Please try again using a VPN set to Brazil, or test this site manually on this platform." 13 14 15 async def do_check(client, whichCSS, whichNotCSS): 16 try: 17 await client.navigate(URL, wait="none", timeout=10) 18 client.await_css(whichCSS, is_displayed=True) 19 assert not client.find_css(whichNotCSS, is_displayed=True) 20 except (ConnectionRefusedError, NoSuchElementException): 21 pytest.skip(VPN_MESSAGE) 22 23 24 @pytest.mark.asyncio 25 @pytest.mark.with_interventions 26 async def test_enabled(client): 27 await do_check(client, SUPPORTED_CSS, UNSUPPORTED_CSS) 28 29 30 @pytest.mark.asyncio 31 @pytest.mark.without_interventions 32 async def test_disabled(client): 33 await do_check(client, UNSUPPORTED_CSS, SUPPORTED_CSS)