Source code

Revision control

Copy as Markdown

Other Tools

import pytest
FIRST_ITEM_IMAGE_CSS = ".swiper .swiper-slide-active .AIC-MI-img.square"
async def are_any_product_images_too_big(client):
await client.navigate(URL, wait="none")
item = client.await_css(FIRST_ITEM_IMAGE_CSS, is_displayed=True)
return client.execute_script(
"""
return arguments[0].getBoundingClientRect().width > screen.width / 2;
""",
item,
)
@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
assert not await are_any_product_images_too_big(client)
@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
assert await are_any_product_images_too_big(client)