test_1943920_add_org.py (702B)
1 import pytest 2 3 URL = "https://add.org/adhd-facts/" 4 5 MENU_CSS = "nav.mobile-menu-container.mobile-effect" 6 7 8 async def is_menu_visible(client): 9 await client.navigate(URL) 10 menu = client.await_css(MENU_CSS) 11 return client.execute_script( 12 """ 13 return arguments[0].getBoundingClientRect().x < window.innerWidth 14 """, 15 menu, 16 ) 17 18 19 @pytest.mark.only_platforms("android") 20 @pytest.mark.asyncio 21 @pytest.mark.with_interventions 22 async def test_enabled(client): 23 assert not await is_menu_visible(client) 24 25 26 @pytest.mark.only_platforms("android") 27 @pytest.mark.asyncio 28 @pytest.mark.without_interventions 29 async def test_disabled(client): 30 assert await is_menu_visible(client)