summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py b/testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py
new file mode 100644
index 0000000000..d33bc01a76
--- /dev/null
+++ b/testing/webcompat/interventions/tests/test_1712807_www_dealnews_com.py
@@ -0,0 +1,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)