test_2000558_www_jal_co_jp.py (918B)
1 import pytest 2 3 URL = "https://www.jal.co.jp/jp/ja/jalmile/use/jal/inter/routemiles.html" 4 5 ACCORDION_CSS = "#ecoEast" 6 TABLE_CSS = "#ecoEast table" 7 8 9 async def is_table_fully_visible(client): 10 await client.navigate(URL, wait="none") 11 client.await_css(ACCORDION_CSS, is_displayed=True).click() 12 return client.execute_script( 13 """ 14 const table = arguments[0]; 15 const tableWidth = table.getBoundingClientRect().width; 16 const containerWidth = table.parentNode.getBoundingClientRect().width; 17 return tableWidth <= containerWidth; 18 """, 19 client.await_css(TABLE_CSS, is_displayed=True), 20 ) 21 22 23 @pytest.mark.asyncio 24 @pytest.mark.with_interventions 25 async def test_enabled(client): 26 assert await is_table_fully_visible(client) 27 28 29 @pytest.mark.asyncio 30 @pytest.mark.without_interventions 31 async def test_disabled(client): 32 assert not await is_table_fully_visible(client)