diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/webcompat/interventions/tests/test_1848711_vio_com.py | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/webcompat/interventions/tests/test_1848711_vio_com.py')
-rw-r--r-- | testing/webcompat/interventions/tests/test_1848711_vio_com.py | 43 |
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 |