testing/webcompat/interventions/tests/test_1830739_1964350_bonusblitz_com.py
author Serban Stanca <sstanca@mozilla.com>
Thu, 17 Jul 2025 20:21:32 +0300 (11 hours ago)
changeset 797003 7ec5a911287f51bc177058928bb102163a3b656e
parent 787385 35f9d4823b3ed98a25185c5e626da524eba7be12
permissions -rw-r--r--
Revert "Bug 1977690 - Remove unused AppRequestInterceptor in androidTests r=aaronmt" for causing fenix-debug failures. This reverts commit bc9dc5f4296482e17560627acaacd2797e462211.
import pytest

URL = "https://bonusblitz.com/game/caesars-empire"
PRACTICE_FIRST_GAME_CSS = "button.cta.practice"
GAME_IFRAME_CSS = "iframe#game"
UNSUPPORTED_CSS = ".unsupported-device-box"
SUPPORTED_CSS = "#game_main"


async def get_to_page(client):
    await client.navigate(URL)
    client.switch_frame(client.await_css(GAME_IFRAME_CSS))


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    await get_to_page(client)
    assert client.await_css(SUPPORTED_CSS, timeout=30)


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    await get_to_page(client)
    assert client.await_css(UNSUPPORTED_CSS, timeout=30)