test_1741234_alphalabs.py (856B)
1 import pytest 2 3 URL = "https://patient.alphalabs.ca/Report/CovidReport" 4 5 CONTINUE_CSS = ".btnNormal[type='submit']" 6 FOOTER_CSS = "footer" 7 8 9 async def is_continue_above_footer(client): 10 await client.navigate(URL) 11 cont = client.find_css(CONTINUE_CSS) 12 assert cont 13 footer = client.find_css(FOOTER_CSS) 14 assert footer 15 return client.execute_script( 16 """ 17 const cont = arguments[0].getClientRects()[0]; 18 const footer = arguments[1].getClientRects()[0]; 19 return cont.bottom < footer.top; 20 """, 21 cont, 22 footer, 23 ) 24 25 26 @pytest.mark.asyncio 27 @pytest.mark.with_interventions 28 async def test_enabled(client): 29 assert await is_continue_above_footer(client) 30 31 32 @pytest.mark.asyncio 33 @pytest.mark.without_interventions 34 async def test_disabled(client): 35 assert not await is_continue_above_footer(client)