summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py
blob: d33bc01a76e7c2057426f184d6ff0b059f9ade22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pytest

URL = "https://www.dealnews.com/"


# The page sets the style.width of images too wide on
# Firefox, making the page wider than the viewport


def is_wider_than_window(client):
    return client.execute_script(
        """
        return document.body.scrollWidth > document.body.clientWidth;
    """
    )


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    await client.navigate(URL)
    assert not is_wider_than_window(client)


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    await client.navigate(URL)
    assert is_wider_than_window(client)