test_1966389_boots_com.py (1193B)
1 import pytest 2 3 URL = "https://www.boots.com/opticiansappointments" 4 FRAME_CSS = "#boots-opticians" 5 ELEMS_CSS = ".Address input, .RebookAddress input, .Age select, .AppointmentType select" 6 7 8 async def are_key_elements_same_width(client): 9 client.set_screen_size(1224, 500) 10 await client.navigate(URL, wait="none") 11 client.switch_to_frame(client.await_css(FRAME_CSS, is_displayed=True)) 12 elems = client.await_css(ELEMS_CSS, is_displayed=True, all=True) 13 unique_widths = client.execute_script( 14 "return arguments[0].map(e => e.getBoundingClientRect().width)", elems 15 ) 16 return len(list(set(unique_widths))) == 1 17 18 19 @pytest.mark.enable_webkit_fill_available 20 @pytest.mark.asyncio 21 @pytest.mark.with_interventions 22 async def test_enabled(client): 23 assert await are_key_elements_same_width(client) 24 25 26 @pytest.mark.disable_webkit_fill_available 27 @pytest.mark.asyncio 28 @pytest.mark.with_interventions 29 async def test_enabled2(client): 30 assert await are_key_elements_same_width(client) 31 32 33 @pytest.mark.disable_webkit_fill_available 34 @pytest.mark.asyncio 35 @pytest.mark.without_interventions 36 async def test_disabled(client): 37 assert not await are_key_elements_same_width(client)