loading of admin cookies works now
This commit is contained in:
parent
b4ad3a84ac
commit
1088235518
1 changed files with 8 additions and 5 deletions
|
|
@ -2,7 +2,7 @@ import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from icecream import ic
|
from icecream import ic
|
||||||
from playwright.sync_api import Browser, BrowserContext, expect
|
from playwright.sync_api import BrowserContext, expect
|
||||||
|
|
||||||
cred_file = Path("credentials.json")
|
cred_file = Path("credentials.json")
|
||||||
with open(cred_file, "r") as f:
|
with open(cred_file, "r") as f:
|
||||||
|
|
@ -89,11 +89,14 @@ def create_user(context: BrowserContext, invitelink, STATES: Path):
|
||||||
|
|
||||||
|
|
||||||
def test_create_user_session_one_context(context: BrowserContext, dotenv_config: dict[str, str], STATES: Path):
|
def test_create_user_session_one_context(context: BrowserContext, dotenv_config: dict[str, str], STATES: Path):
|
||||||
# create invite_link
|
|
||||||
context.set_default_timeout(TIMEOUT)
|
context.set_default_timeout(TIMEOUT)
|
||||||
storage_state = json.loads(f"{STATES}/admin_state.json")
|
|
||||||
# admin_context = browser.new_context(storage_state=f"{STATES}/admin_state.json")
|
# load admin cookies
|
||||||
context.add_cookies(*storage_state["cookies"])
|
state_file = STATES / "admin_state.json"
|
||||||
|
storage_state = json.loads(state_file.read_bytes())
|
||||||
|
context.add_cookies(storage_state["cookies"])
|
||||||
|
|
||||||
|
# create invite_link
|
||||||
invite_link = create_invite_link(context, dotenv_config)
|
invite_link = create_invite_link(context, dotenv_config)
|
||||||
|
|
||||||
# create user
|
# create user
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue