summaryrefslogtreecommitdiffstats
path: root/testing/webcompat/interventions/tests/test_1855071_121197_www_meteoam_it.py
blob: 1a5a3c37ffa19b072638df3eae378737095f5f7e (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
30
31
32
33
34
35
36
import time

import pytest

URL = "https://www.meteoam.it/it/home"
IFRAME_CSS = "#iframe_map"
SEARCH_CSS = "#mobile_rightpanel .barbtnsearch"
INPUT_CSS = "#search_bar_txt"


def getWindowHeight(client):
    return client.execute_script("return window.outerHeight")


async def doesHeightChange(client):
    await client.navigate(URL)
    client.switch_to_frame(client.await_css(IFRAME_CSS))
    initialHeight = getWindowHeight(client)
    client.await_css(SEARCH_CSS).click()
    client.await_css(INPUT_CSS, is_displayed=True).click()
    time.sleep(2)
    return getWindowHeight(client) != initialHeight


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.with_interventions
async def test_enabled(client):
    assert await doesHeightChange(client)


@pytest.mark.only_platforms("android")
@pytest.mark.asyncio
@pytest.mark.without_interventions
async def test_disabled(client):
    assert not await doesHeightChange(client)