test_1946443_aliexpress_com.py (1102B)
1 import pytest 2 3 URL = "https://www.aliexpress.com/ssr/300000512/nn2024update?spm=a2g0n.home.3fornn.2.50c276dbeE1R1C&disableNav=YES&pha_manifest=ssr&_immersiveMode=true&productIds=1005006422500160&browser_id=b0b0e7b79568430794a11f7d8cab49c8&aff_trace_key=null&aff_platform=msite&m_page_id=drilnynmcabwbkwi194dba601458b8fe2231f53dc9&gclid=" 4 5 FIRST_ITEM_IMAGE_CSS = ".swiper .swiper-slide-active .AIC-MI-img.square" 6 7 8 async def are_any_product_images_too_big(client): 9 await client.navigate(URL, wait="none") 10 item = client.await_css(FIRST_ITEM_IMAGE_CSS, is_displayed=True) 11 return client.execute_script( 12 """ 13 return arguments[0].getBoundingClientRect().width > screen.width / 2; 14 """, 15 item, 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 are_any_product_images_too_big(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 are_any_product_images_too_big(client)