summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1836103_autostar_novoross_ru.py
blob: d63fd666fe5340423bdb083194957ef2e0829c1c (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://autostar-novoross.ru/"
IFRAME_CSS = "iframe[src*='google.com/maps']"


async def map_is_correct_height(client):
    await client.navigate(URL)
    iframe = client.await_css(IFRAME_CSS)
    assert iframe
    return client.execute_script(
        """
       const iframe = arguments[0];
       return iframe.clientHeight == iframe.parentNode.clientHeight;
    """,
        iframe,
    )


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


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