summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1830813_onstove_com.py
blob: 626f71f92b346ce5eebd540226131d8ed07fb09c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pytest

URL = "https://page.onstove.com/epicseven/global/"
BANNER_CSS = ".gnb-alerts.gnb-old-browser"


async def get_banner_height(client):
    await client.navigate(URL)
    banner = client.await_css(BANNER_CSS)
    return client.execute_script(
        """
       return arguments[0].getBoundingClientRect().height;
    """,
        banner,
    )


@pytest.mark.skip_platforms("android")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    assert 0 == await get_banner_height(client)


@pytest.mark.skip_platforms("android")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    assert 0 < await get_banner_height(client)