summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1848711_vio_com.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/webcompat/interventions/tests/test_1848711_vio_com.py')
-rw-r--r--testing/webcompat/interventions/tests/test_1848711_vio_com.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/testing/webcompat/interventions/tests/test_1848711_vio_com.py b/testing/webcompat/interventions/tests/test_1848711_vio_com.py
new file mode 100644
index 0000000000..7d571887d8
--- /dev/null
+++ b/testing/webcompat/interventions/tests/test_1848711_vio_com.py
@@ -0,0 +1,43 @@
+import time
+from datetime import datetime, timedelta
+
+import pytest
+
+today = datetime.now()
+three_months = today + timedelta(days=90)
+plus_week = three_months + timedelta(days=7)
+formatted_start = three_months.strftime("%Y-%m-%d")
+formatted_end = plus_week.strftime("%Y-%m-%d")
+
+URL = f"https://www.vio.com/Hotel/Search?hotelId=17293575&checkIn={formatted_start}&checkOut={formatted_end}&rooms=2&homeSearch=1&userSearch=1&layout=map"
+MAP_CSS = ".mapboxgl-map"
+MIN_HEIGHT = 100
+
+
+def get_elem_height(client):
+ elem = client.await_css(MAP_CSS, is_displayed=True)
+ assert elem
+ return client.execute_script(
+ """
+ return arguments[0].getBoundingClientRect().height;
+ """,
+ elem,
+ )
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ time.sleep(3)
+ await client.navigate(URL)
+ assert get_elem_height(client) > MIN_HEIGHT
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ time.sleep(3)
+ await client.navigate(URL)
+ assert get_elem_height(client) < MIN_HEIGHT