tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_1933929_toei-anim_co_jp.py (915B)


      1 import pytest
      2 from webdriver.error import NoSuchElementException
      3 
      4 URL = "https://www.toei-anim.co.jp/"
      5 
      6 SUCCESS_CSS = ".splide__list"
      7 ERROR_TEXT = "a client-side exception has occurred"
      8 
      9 
     10 @pytest.mark.asyncio
     11 @pytest.mark.with_interventions
     12 async def test_enabled(client):
     13    for _ in range(5):
     14        await client.navigate(URL)
     15        assert client.await_css(SUCCESS_CSS, is_displayed=True, timeout=4)
     16        assert not client.find_text(ERROR_TEXT, is_displayed=True)
     17 
     18 
     19 @pytest.mark.asyncio
     20 @pytest.mark.without_interventions
     21 async def test_disabled(client):
     22    saw_failure = False
     23    for _ in range(5):
     24        await client.navigate(URL)
     25        try:
     26            assert client.await_text(ERROR_TEXT, is_displayed=True, timeout=4)
     27        except NoSuchElementException:
     28            continue
     29        saw_failure = True
     30        assert not client.find_css(SUCCESS_CSS, is_displayed=True)
     31    assert saw_failure