test_2002012_bbs_colg_cn.py (999B)
1 import pytest 2 3 URL = "https://bbs.colg.cn/new" 4 5 HERO_CSS = ".home-page-right" 6 MOBILE_ERROR_TEXT = "Discuz! Mobile System Error" 7 8 9 async def check_content_is_all_onscreen(client): 10 await client.navigate(URL, wait="none") 11 client.await_css(HERO_CSS, is_displayed=True) 12 return client.execute_script( 13 "return document.scrollingElement.scrollWidth <= window.outerWidth" 14 ) 15 16 17 @pytest.mark.skip_platforms("android") 18 @pytest.mark.asyncio 19 @pytest.mark.with_interventions 20 async def test_enabled(client): 21 assert await check_content_is_all_onscreen(client) 22 23 24 @pytest.mark.skip_platforms("android") 25 @pytest.mark.asyncio 26 @pytest.mark.without_interventions 27 async def test_disabled(client): 28 assert not await check_content_is_all_onscreen(client) 29 30 31 @pytest.mark.only_platforms("android") 32 @pytest.mark.asyncio 33 @pytest.mark.with_interventions 34 async def test_regression(client): 35 await client.navigate(URL, wait="none") 36 assert client.await_text(MOBILE_ERROR_TEXT, is_displayed=True)