test_1998361_doctolib_de.py (1564B)
1 import pytest 2 from webdriver import NoSuchElementException 3 4 URL = "https://www.doctolib.de/appointments/eyJfcmFpbHMiOnsibWVzc2FnZSI6Ik56TXdNRFV3TlRFeU1RPT0iLCJleHAiOm51bGwsInB1ciI6ImFwcG9pbnRtZW50In19--8828380aa4726a4c5e5f887a55ae459629f24c25e979d14373b22c722b2de264/telehealth_diagnostic" 5 COOKIES_CSS = "#didomi-notice-agree-button" 6 APP_RECOMMENDATION_CSS = "[aria-label='Weiter mit Firefox']" 7 ENTRY_BUTTON_CSS = ".dl-button-primary" 8 SUPPORTED_TEXT = "Mikrofon" 9 UNSUPPORTED_TEXT = "Inkompatibler Browser" 10 11 12 @pytest.mark.only_platforms("android") 13 @pytest.mark.asyncio 14 @pytest.mark.with_interventions 15 async def test_enabled(client): 16 await client.navigate(URL, wait="none") 17 try: 18 client.await_css(COOKIES_CSS, is_displayed=True).click() 19 except NoSuchElementException: 20 pass 21 client.await_css(ENTRY_BUTTON_CSS, is_displayed=True).click() 22 assert client.await_text(SUPPORTED_TEXT, is_displayed=True) 23 assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True) 24 25 26 @pytest.mark.only_platforms("android") 27 @pytest.mark.asyncio 28 @pytest.mark.without_interventions 29 async def test_disabled(client): 30 await client.navigate(URL, wait="none") 31 try: 32 client.await_css(COOKIES_CSS, is_displayed=True).click() 33 except NoSuchElementException: 34 pass 35 client.await_css(APP_RECOMMENDATION_CSS, is_displayed=True).click() 36 client.await_css(ENTRY_BUTTON_CSS, is_displayed=True).click() 37 assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True) 38 assert not client.find_text(SUPPORTED_TEXT, is_displayed=True)