test_1976402_dieseldispatch_com.py (996B)
1 import asyncio 2 3 import pytest 4 5 URL = "https://dieseldispatch.com/" 6 HERO_CSS = "a[href*=trackmyvehicle]" 7 SECTION_CSS = ".section-wrapper.ng-trigger-stats" 8 9 10 async def can_scroll(client): 11 await client.navigate(URL, wait="none") 12 hero = client.await_css(HERO_CSS, is_displayed=True) 13 await asyncio.sleep(1) 14 section = client.await_css(SECTION_CSS, is_displayed=True) 15 original_transform = client.execute_script( 16 "return arguments[0].style.transform", section 17 ) 18 await client.send_apz_scroll_gesture(-400, element=hero, offset=[40, 40]) 19 await asyncio.sleep(1) 20 final_transform = client.execute_script( 21 "return arguments[0].style.transform", section 22 ) 23 return original_transform != final_transform 24 25 26 # testing APZ scrolls doesn't work on Android right now, so skip testing there. 27 28 29 @pytest.mark.skip_platforms("android") 30 @pytest.mark.asyncio 31 @pytest.mark.without_interventions 32 async def test_regression(client): 33 assert await can_scroll(client)