add comments

This commit is contained in:
Daniel 2023-11-22 15:34:54 +01:00
parent aa913445f6
commit ee1acebf3d

View file

@ -1,4 +1,11 @@
## this file will not be used later
## split into
# -> setup.setup_authentic.py
# and
# -> tests
import pytest import pytest
from icecream import ic
from playwright.sync_api import Browser, Locator, expect from playwright.sync_api import Browser, Locator, expect
# playwright = sync_playwright().start() # playwright = sync_playwright().start()
@ -29,10 +36,13 @@ def setup_context(browser, state_file=None):
@pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
def admin_login(browser: Browser, dotenv_config, STATES): def admin_login(browser: Browser, dotenv_config, STATES):
# ic(dotenv_config)
CONFIG = dotenv_config CONFIG = dotenv_config
context = setup_context(browser) context = setup_context(browser)
page = context.new_page() page = context.new_page()
page.goto(CONFIG["domain"]) url = "https://" + CONFIG["DOMAIN"]
ic(url)
page.goto(url)
welcome_message = CONFIG.get("welcome_message") welcome_message = CONFIG.get("welcome_message")
if welcome_message: if welcome_message:
check_for(page.get_by_text(welcome_message)) check_for(page.get_by_text(welcome_message))
@ -163,3 +173,7 @@ def user_session(browser: Browser, dotenv_config, STATES):
page.goto(CONFIG["domain"]) page.goto(CONFIG["domain"])
yield context, page yield context, page
context.close() context.close()
def test_true():
assert 1 + 1 == 2