test_1941530_climate_rutgers_edu.py (686B)
1 import pytest 2 3 URL = "https://climate.rutgers.edu/snowcover/index.php" 4 IMG_CSS = ".u--svg-inside object" 5 6 7 async def is_image_correct_size(client): 8 await client.navigate(URL) 9 img = client.await_css(IMG_CSS, is_displayed=True) 10 return client.execute_script( 11 """ 12 const img = arguments[0]; 13 img.style.border = "none"; 14 return img.clientWidth > 0; 15 """, 16 img, 17 ) 18 19 20 @pytest.mark.asyncio 21 @pytest.mark.with_interventions 22 async def test_enabled(client): 23 assert await is_image_correct_size(client) 24 25 26 @pytest.mark.asyncio 27 @pytest.mark.without_interventions 28 async def test_disabled(client): 29 assert not await is_image_correct_size(client)