tor-browser

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

test_1911253_qq_com.py (1278B)


      1 import pytest
      2 
      3 URL = "https://www.qq.com/"
      4 
      5 LOGIN_CSS = "#qqcom-login .login-button"
      6 CHECKBOX_CSS = "[dt-eid=em_login_wx] + div svg#defaultbutton"
      7 QQ_BUTTON_CSS = "#QQ-face"
      8 IFRAME_CSS = "iframe[src*=login_qq_news_web]"
      9 WAIT_LOG_MSG = "load event end at"
     10 REPLACED_CSS = ".accredit_info_op li input[type=checkbox]"
     11 
     12 
     13 async def does_checkmark_appear(client):
     14    await client.navigate(URL, wait="none")
     15    client.hide_elements("#download-btn-wrapid")
     16    client.await_css(LOGIN_CSS, is_displayed=True).click()
     17    client.await_css(CHECKBOX_CSS, is_displayed=True).click()
     18    client.await_css(QQ_BUTTON_CSS, is_displayed=True).click()
     19    client.switch_to_frame(client.await_css(IFRAME_CSS))
     20    # by the time this console message is logged, the checkbox should be ready to check
     21    await (await client.promise_console_message_listener(WAIT_LOG_MSG))
     22    return not client.is_one_solid_color(client.await_css(REPLACED_CSS))
     23 
     24 
     25 @pytest.mark.skip_platforms("android")
     26 @pytest.mark.asyncio
     27 @pytest.mark.with_interventions
     28 async def test_enabled(client):
     29    assert await does_checkmark_appear(client)
     30 
     31 
     32 @pytest.mark.skip_platforms("android")
     33 @pytest.mark.asyncio
     34 @pytest.mark.without_interventions
     35 async def test_disabled(client):
     36    assert not await does_checkmark_appear(client)