test_1999770_configuraraparelhos_claro_com_br.py (1210B)
1 import pytest 2 3 URL = "https://configuraraparelhos.claro.com.br/sistema-operacional/samsung-android-15/como-ativar-ou-desativar-a-rede-5g" 4 5 PHONE_DESCRIPTION_TEXT_CSS = ".text-content-paragraphs" 6 7 8 async def are_phone_descriptions_visible(client): 9 await client.navigate(URL, wait="none") 10 return client.execute_script( 11 """ 12 const text = arguments[0]; 13 const textBottom = text.getBoundingClientRect().bottom; 14 const cardBottom = text.closest(".step-card").getBoundingClientRect().bottom; 15 return textBottom <= cardBottom; 16 """, 17 client.await_css(PHONE_DESCRIPTION_TEXT_CSS, is_displayed=True), 18 ) 19 20 21 @pytest.mark.skip_platforms("android") 22 @pytest.mark.asyncio 23 @pytest.mark.with_interventions 24 async def test_enabled(client): 25 assert await are_phone_descriptions_visible(client) 26 27 28 @pytest.mark.skip_platforms("android") 29 @pytest.mark.asyncio 30 @pytest.mark.without_interventions 31 async def test_disabled(client): 32 assert not await are_phone_descriptions_visible(client) 33 34 35 @pytest.mark.only_platforms("android") 36 @pytest.mark.asyncio 37 @pytest.mark.without_interventions 38 async def test_android(client): 39 assert await are_phone_descriptions_visible(client)