tor-browser

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

test_1944518_app_powerbi_com.py (1128B)


      1 import pytest
      2 from webdriver import NoSuchElementException
      3 
      4 URL = "https://app.powerbi.com/view?r=eyJrIjoiN2U3NGMyNWEtZTAxNS00MzVhLWExNmMtOThhZjdiYjQ4MWNkIiwidCI6IjEyNGU2OWRiLWVmNjUtNDk2Yi05NmE5LTVkNTZiZWMxZDI5MSIsImMiOjl9"
      5 
      6 HERO_CSS = "visual-modern"
      7 SCROLLBAR_CSS = ".scroll-element"
      8 SCROLL_CONTAINER_CSS = ".scrollbar-inner.scroll-content"
      9 
     10 
     11 async def is_scrollbar_added(client):
     12    await client.navigate(URL)
     13    client.await_css(HERO_CSS, is_displayed=True)
     14    try:
     15        assert client.await_css(SCROLLBAR_CSS, timeout=3)
     16    except NoSuchElementException:
     17        return False
     18 
     19    container = client.await_css(SCROLL_CONTAINER_CSS)
     20    return client.execute_script(
     21        """return arguments[0].clientWidth == arguments[0].parentNode.clientWidth""",
     22        container,
     23    )
     24 
     25 
     26 @pytest.mark.only_platforms("mac")
     27 @pytest.mark.asyncio
     28 @pytest.mark.with_interventions
     29 async def test_enabled(client):
     30    assert await is_scrollbar_added(client)
     31 
     32 
     33 @pytest.mark.only_platforms("mac")
     34 @pytest.mark.asyncio
     35 @pytest.mark.without_interventions
     36 async def test_disabled(client):
     37    assert not await is_scrollbar_added(client)