test_1983538_incontrol_landrover_com.py (1091B)
1 import pytest 2 from webdriver.error import NoSuchElementException 3 4 URL = "https://incontrol.landrover.com/jlr-portal-owner-web/select-locale" 5 REGION_SELECT_CSS = "#s2id_select-new-continent" 6 FIRST_REGION_CSS = ( 7 ".select2-result:not(.select2-result-unselectable):not(.select2-disabled)" 8 ) 9 MARKET_SELECT_CSS = "#s2id_select-new-market" 10 MARKET_SELECT_DROPDOWN_CSS = ".select2-result" 11 12 13 async def do_dropdowns_work(client): 14 await client.navigate(URL) 15 client.await_css(REGION_SELECT_CSS, is_displayed=True).click() 16 client.await_css(FIRST_REGION_CSS, is_displayed=True).click() 17 client.await_css(MARKET_SELECT_CSS, is_displayed=True).click() 18 try: 19 client.await_css(MARKET_SELECT_DROPDOWN_CSS, is_displayed=True, timeout=2) 20 return True 21 except NoSuchElementException: 22 return False 23 24 25 @pytest.mark.asyncio 26 @pytest.mark.with_interventions 27 async def test_enabled(client): 28 assert await do_dropdowns_work(client) 29 30 31 @pytest.mark.asyncio 32 @pytest.mark.without_interventions 33 async def test_disabled(client): 34 assert not await do_dropdowns_work(client)