test_1998101_vegan-store_eu.py (686B)
1 import pytest 2 3 URL = "https://vegan-store.eu/collections/vegan-fashion-mens" 4 WRAPPER_CSS = ".media-wrapper :has(img.motion-reduce)" 5 6 7 async def are_product_images_visible(client): 8 await client.navigate(URL, wait="none") 9 wrapper = client.await_css(WRAPPER_CSS, is_displayed=True) 10 return client.execute_script( 11 "return arguments[0].getBoundingClientRect().width > 0", wrapper 12 ) 13 14 15 @pytest.mark.asyncio 16 @pytest.mark.with_interventions 17 async def test_enabled(client): 18 assert await are_product_images_visible(client) 19 20 21 @pytest.mark.asyncio 22 @pytest.mark.without_interventions 23 async def test_disabled(client): 24 assert not await are_product_images_visible(client)