test_1886616_www_six-group_com.py (1550B)
1 import pytest 2 from webdriver.error import NoSuchElementException 3 4 URL = "https://www.six-group.com/en/market-data/etf/etf-explorer.html" 5 COOKIES_CSS = "#onetrust-consent-sdk" 6 SELECT_CSS = "select[name='Dropdown']:has(option[value='active'])" 7 8 9 async def select_value_is_visible(client): 10 try: 11 cookies = client.await_css(COOKIES_CSS, is_displayed=True, timeout=5) 12 client.remove_element(cookies) 13 except NoSuchElementException: 14 pass 15 16 select = client.await_css(SELECT_CSS, is_displayed=True) 17 assert select 18 # remove the border and background from the select, so only the text 19 # should influence the screenshot. 20 client.execute_script( 21 """ 22 arguments[0].style.border = 'none'; 23 arguments[0].style.background = '#fff'; 24 """, 25 select, 26 ) 27 return not client.is_one_solid_color(select) 28 29 30 @pytest.mark.asyncio 31 @pytest.mark.with_interventions 32 @pytest.mark.only_firefox_versions(max=142) 33 async def test_enabled(client): 34 await client.navigate(URL, wait="none") 35 assert await select_value_is_visible(client) 36 37 38 @pytest.mark.asyncio 39 @pytest.mark.without_interventions 40 @pytest.mark.only_firefox_versions(max=142) 41 async def test_disabled(client): 42 await client.navigate(URL, wait="none") 43 assert not await select_value_is_visible(client) 44 45 46 @pytest.mark.asyncio 47 @pytest.mark.without_interventions 48 @pytest.mark.only_firefox_versions(min=143) 49 async def test_regression(client): 50 await client.navigate(URL, wait="none") 51 assert await select_value_is_visible(client)