test_1981995_mygeha_com.py (1037B)
1 import pytest 2 3 URL = "https://www.mygeha.com/tpa-ap-web/?navDeepDive=ProvDirPublicGEHADental&viewDefaultLayout=false" 4 CITY_OR_ZIPCODE_CSS = "#zipCode" 5 STATE_CSS = "select#state" 6 7 8 async def is_state_beside_zip(client): 9 await client.navigate(URL, wait="none") 10 city = client.await_css(CITY_OR_ZIPCODE_CSS, is_displayed=True) 11 state = client.await_css(STATE_CSS, is_displayed=True) 12 return client.execute_script( 13 """ 14 const [city, state] = [...arguments].map(arg => arg.getBoundingClientRect()); 15 return city.width > 100 && state.width > 100 && city.right < state.left && Math.abs(state.top - city.top) < 2; 16 """, 17 city, 18 state, 19 ) 20 21 22 @pytest.mark.skip_platforms("android") 23 @pytest.mark.asyncio 24 @pytest.mark.with_interventions 25 async def test_enabled(client): 26 assert await is_state_beside_zip(client) 27 28 29 @pytest.mark.skip_platforms("android") 30 @pytest.mark.asyncio 31 @pytest.mark.without_interventions 32 async def test_disabled(client): 33 assert not await is_state_beside_zip(client)