tor-browser

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

test_1908636_ccccltd_cn.py (856B)


      1 import pytest
      2 from webdriver.error import UnexpectedAlertOpenException
      3 
      4 URL = "https://xmgl.ccccltd.cn/a/login"
      5 
      6 UNSUPPORTED_TEXT = "请使用基于Chrome内核52版本以上的浏览器访问本系统"
      7 LOGIN_CSS = "#login_form2"
      8 
      9 
     10 @pytest.mark.asyncio
     11 @pytest.mark.with_interventions
     12 async def test_enabled(client):
     13    await client.navigate(URL, wait="none")
     14    assert client.await_css(LOGIN_CSS, is_displayed=True, timeout=60)
     15    assert not client.find_text(UNSUPPORTED_TEXT, is_displayed=True)
     16 
     17 
     18 @pytest.mark.asyncio
     19 @pytest.mark.without_interventions
     20 async def test_disabled(client):
     21    try:
     22        await client.navigate(URL, wait="none")
     23        assert client.await_text(UNSUPPORTED_TEXT, is_displayed=True, timeout=60)
     24        assert not client.find_css(LOGIN_CSS, is_displayed=True)
     25    except UnexpectedAlertOpenException:
     26        assert True