summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1830761_91mobiles_com.py
blob: 4f83c371b717989e3bbf413a8d33eadd7fcd5935 (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
import pytest

URL = "https://www.91mobiles.com/compare/realme/9+SE+5G/vs/Moto/G72-amp"
CONTENT_CSS = "#fixed-table tr td .cmp-summary-box"


async def content_has_height(client):
    await client.navigate(URL)
    elem = client.await_css(CONTENT_CSS)
    return client.execute_script(
        """
      return arguments[0].getBoundingClientRect().height > 0;
    """,
        elem,
    )


@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    assert await content_has_height(client)


@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    assert not await content_has_height(client)