summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py')
-rw-r--r--testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py b/testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py
new file mode 100644
index 0000000000..97901efe77
--- /dev/null
+++ b/testing/webcompat/interventions/tests/test_1830739_www_planet7casino_com.py
@@ -0,0 +1,34 @@
+import asyncio
+
+import pytest
+
+URL = "https://www.planet7casino.com/lobby/?play=alien-wins"
+IFRAME_CSS = "#gameiframe"
+GOOD_MSG = "GameViewModel"
+BAD_MSG = "UnsupportedDevice"
+DOWN_TEXT = "temporarily out of order"
+
+
+async def check_for_message(client, message):
+ await client.navigate(URL)
+ client.switch_to_frame(client.await_css(IFRAME_CSS))
+ down = client.async_await_element(client.text(DOWN_TEXT))
+ good = await client.promise_console_message_listener(message)
+ down, good = await asyncio.wait([down, good], return_when=asyncio.FIRST_COMPLETED)
+ if down:
+ pytest.skip("Cannot test: casino is 'temporarily out of order'")
+ return good
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.with_interventions
+async def test_enabled(client):
+ assert check_for_message(client, GOOD_MSG)
+
+
+@pytest.mark.only_platforms("android")
+@pytest.mark.asyncio
+@pytest.mark.without_interventions
+async def test_disabled(client):
+ assert check_for_message(client, BAD_MSG)