tor-browser

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

test_1886591_la-vache-noire_com.py (658B)


      1 import pytest
      2 
      3 URL = "https://la-vache-noire.com/"
      4 
      5 COOKIES_CSS = "#cookie-bar"
      6 
      7 
      8 async def is_cookie_banner_visible(client):
      9    await client.navigate(URL, wait="none")
     10    cookies = client.await_css(COOKIES_CSS, is_displayed=True)
     11    return client.execute_script(
     12        """
     13        document.body.style.overflow = "hidden"; // hide scrollbars for consistency
     14        const b = arguments[0].getBoundingClientRect();
     15        return Math.abs(window.innerHeight - b.y - b.height) < 1;
     16    """,
     17        cookies,
     18    )
     19 
     20 
     21 @pytest.mark.asyncio
     22 @pytest.mark.without_interventions
     23 async def test_disabled(client):
     24    assert await is_cookie_banner_visible(client)