diff options
Diffstat (limited to 'testing/webcompat/interventions/tests/test_1830747_babbel_com.py')
-rw-r--r-- | testing/webcompat/interventions/tests/test_1830747_babbel_com.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/webcompat/interventions/tests/test_1830747_babbel_com.py b/testing/webcompat/interventions/tests/test_1830747_babbel_com.py new file mode 100644 index 0000000000..cfefe31412 --- /dev/null +++ b/testing/webcompat/interventions/tests/test_1830747_babbel_com.py @@ -0,0 +1,35 @@ +import pytest +from webdriver.error import NoSuchElementException + +URL = "https://my.babbel.com/en/welcome/1?bsc=engmag-rus&btp=default&learn_lang=RUS" +COOKIES_CSS = "#onetrust-accept-btn-handler" +BUTTON_CSS = "button.button[type=submit]" + + +async def button_visible(client): + await client.navigate(URL) + try: + client.soft_click(client.await_css(COOKIES_CSS, timeout=3)) + except NoSuchElementException: + pass + btn = client.await_css(BUTTON_CSS) + return client.execute_script( + """ + return window.innerHeight > arguments[0].getBoundingClientRect().bottom; + """, + btn, + ) + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.with_interventions +async def test_enabled(client): + assert await button_visible(client) + + +@pytest.mark.only_platforms("android") +@pytest.mark.asyncio +@pytest.mark.without_interventions +async def test_disabled(client): + assert not await button_visible(client) |