rename authentik context json files

This commit is contained in:
Daniel 2023-11-30 12:22:19 +01:00
parent 641d89438b
commit 827827b962
2 changed files with 5 additions and 5 deletions

View file

@ -11,7 +11,7 @@ TIMEOUT = 5000
@pytest.fixture
def admin_context(context: BrowserContext, DIR: DirManager) -> BrowserContext:
state_file = DIR.STATES / "admin_state.json"
state_file = DIR.STATES / "authentik_admin_state.json"
storage_state = json.loads(state_file.read_bytes())
context.add_cookies(storage_state["cookies"])
context.set_default_timeout(TIMEOUT)
@ -30,7 +30,7 @@ def authentik_admin_page(admin_context: BrowserContext, DIR: DirManager) -> Page
@pytest.fixture
def user_context(context: BrowserContext, DIR: DirManager) -> BrowserContext:
state_file = DIR.STATES / "user_state.json"
state_file = DIR.STATES / "authentik_user_state.json"
storage_state = json.loads(state_file.read_bytes())
context.add_cookies(storage_state["cookies"])
context.set_default_timeout(TIMEOUT)

View file

@ -34,7 +34,7 @@ def test_create_admin_login(context: BrowserContext, dotenv_config: dict[str, st
expect(page.locator("ak-library")).to_be_visible()
# save state
context.storage_state(path=f"{DIR.STATES}/admin_state.json")
context.storage_state(path=f"{DIR.STATES}/authentik_admin_state.json")
def check_if_user_exists(admin_context: BrowserContext, dotenv_config: dict[str, str]):
@ -107,7 +107,7 @@ def test_create_user_session(context: BrowserContext, dotenv_config: dict[str, s
context.set_default_timeout(TIMEOUT)
# load admin cookies
state_file = DIR.STATES / "admin_state.json"
state_file = DIR.STATES / "authentik_admin_state.json"
storage_state = json.loads(state_file.read_bytes())
context.add_cookies(storage_state["cookies"])
@ -123,4 +123,4 @@ def test_create_user_session(context: BrowserContext, dotenv_config: dict[str, s
context.clear_cookies()
create_user(context, invite_link)
context.storage_state(path=f"{DIR.STATES}/user_state.json")
context.storage_state(path=f"{DIR.STATES}/authentik_user_state.json")