test_1925508_developer_apple_com.py (1272B)
1 import pytest 2 3 URL = "https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/AdoptingOpenGLES3/AdoptingOpenGLES3.html" 4 5 TOC_CSS = "#tocContainer" 6 7 8 async def check_toc_fits_on_screen(client): 9 await client.navigate(URL) 10 toc = client.await_css(TOC_CSS, is_displayed=True) 11 return client.execute_script( 12 """ 13 bb = arguments[0].getBoundingClientRect(); 14 return bb.left >= window.scrollX && bb.left <= window.innerWidth + window.scrollX && 15 bb.top >= window.scrollY && bb.top <= window.innerHeight + window.scrollY 16 """, 17 toc, 18 ) 19 20 21 @pytest.mark.only_platforms("android") 22 @pytest.mark.asyncio 23 @pytest.mark.disable_moztransform 24 @pytest.mark.with_interventions 25 async def test_enabled(client): 26 assert await check_toc_fits_on_screen(client) 27 28 29 @pytest.mark.only_platforms("android") 30 @pytest.mark.asyncio 31 @pytest.mark.enable_moztransform 32 @pytest.mark.with_interventions 33 async def test_enabled2(client): 34 assert await check_toc_fits_on_screen(client) 35 36 37 @pytest.mark.only_platforms("android") 38 @pytest.mark.asyncio 39 @pytest.mark.enable_moztransform 40 @pytest.mark.without_interventions 41 async def test_disabled(client): 42 assert not await check_toc_fits_on_screen(client)