test_1901449_teikiyoyaku_tokyu_co_jp.py (1056B)
1 import pytest 2 3 URL = "https://teikiyoyaku.tokyu.co.jp/trw/input?kbn=1&languageCode=ja" 4 5 6 async def is_fastclick_active(client): 7 async with client.ensure_fastclick_activates(): 8 await client.navigate(URL) 9 # The service is down overnight, making it harder to test in other time zones, 10 # but we can just activate FastClick on our own select. 11 select = client.execute_script( 12 """ 13 const s = document.createElement("select"); 14 s.innerHTML = "<option>1</option>"; 15 document.body.appendChild(s); 16 FastClick.attach(document.body); 17 return s; 18 """ 19 ) 20 return client.test_for_fastclick(select) 21 22 23 @pytest.mark.only_platforms("android") 24 @pytest.mark.asyncio 25 @pytest.mark.with_interventions 26 async def test_enabled(client): 27 assert not await is_fastclick_active(client) 28 29 30 @pytest.mark.only_platforms("android") 31 @pytest.mark.asyncio 32 @pytest.mark.without_interventions 33 async def test_disabled(client): 34 assert await is_fastclick_active(client)