test_2003019_jw_org.py (826B)
1 import pytest 2 3 URL = "https://www.jw.org/en/library/bible/kingdom-interlinear-greek-translation/books/revelation/22/" 4 5 ARTICLE_CSS = "#bibleText" 6 7 8 async def does_text_wrap(client): 9 await client.navigate(URL, wait="none") 10 text = client.await_css(ARTICLE_CSS, is_displayed=True) 11 return client.execute_script( 12 """ 13 const container = arguments[0]; 14 const verse = container.querySelector(":scope > .verse"); 15 return verse.getBoundingClientRect().width <= container.getBoundingClientRect().width; 16 """, 17 text, 18 ) 19 20 21 @pytest.mark.asyncio 22 @pytest.mark.with_interventions 23 async def test_enabled(client): 24 assert await does_text_wrap(client) 25 26 27 @pytest.mark.asyncio 28 @pytest.mark.without_interventions 29 async def test_disabled(client): 30 assert not await does_text_wrap(client)