test_1922498_ilgeniodellapizza_com.py (865B)
1 import asyncio 2 3 import pytest 4 5 URL = "http://www.ilgeniodellapizza.com/le-nostre-pizze.html" 6 7 8 async def can_scroll_filters(client): 9 await client.navigate(URL) 10 body = client.await_css("body") 11 12 def get_top(): 13 return client.execute_script("return window.scrollY") 14 15 top = get_top() 16 for i in range(20): 17 await asyncio.sleep(0.1) 18 client.apz_scroll(body, dy=100) 19 new_top = get_top() 20 if new_top < top: 21 return False 22 top = new_top 23 return True 24 25 26 @pytest.mark.skip_platforms("android") 27 @pytest.mark.asyncio 28 @pytest.mark.with_interventions 29 async def test_enabled(client): 30 assert await can_scroll_filters(client) 31 32 33 @pytest.mark.skip_platforms("android") 34 @pytest.mark.asyncio 35 @pytest.mark.without_interventions 36 async def test_disabled(client): 37 assert not await can_scroll_filters(client)