test_1899930_africanews_com.py (896B)
1 import pytest 2 from webdriver import NoSuchElementException 3 4 URL = "https://africanews.com/" 5 6 POPUP_CSS = "#didomi-notice-agree-button" 7 UNSUPPORTED_TEXT = "upgrade your browser" 8 9 10 @pytest.mark.only_platforms("android") 11 @pytest.mark.asyncio 12 @pytest.mark.with_interventions 13 async def test_enabled(client): 14 await client.navigate(URL, wait="none") 15 try: 16 client.await_css(POPUP_CSS, is_displayed=True).click() 17 except NoSuchElementException: 18 pass 19 assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True) 20 21 22 @pytest.mark.only_platforms("android") 23 @pytest.mark.asyncio 24 @pytest.mark.without_interventions 25 async def test_disabled(client): 26 await client.navigate(URL, wait="none") 27 try: 28 client.await_css(POPUP_CSS, is_displayed=True).click() 29 except NoSuchElementException: 30 pass 31 assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True)