implement env manager (#6)

* add EnvManager class

* holds all functions that are env file related

* integrates runner dependency resolution

* add integration and unit tests for EnvManager

Reviewed-on: local-it-infrastructure/e2e_tests#6
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-12-04 17:09:01 +01:00 committed by dan
parent d3dc0f942a
commit 3fa10aaa69
18 changed files with 264 additions and 198 deletions

View file

@ -1,25 +1,17 @@
import pytest
from playwright.sync_api import BrowserContext, expect
import os
# todo: what is this test for, why is it a fixture? -> ignore for now
from playwright.sync_api import Page
@pytest.fixture(scope="session", autouse=True)
def delete_nextcloud_user(admin_context: BrowserContext):
def delete_nextcloud_user(authentik_admin_page: Page):
"""Delete Nextcloud User"""
yield
context = setup_context(browser, f"{STATES}/admin_state.json")
page = context.new_page()
page.goto(CONFIG["domain"])
with page.expect_popup() as nextcloud_info:
page.get_by_role("link", name="Nextcloud").click()
with authentik_admin_page.expect_popup() as nextcloud_info:
authentik_admin_page.get_by_role("link", name="Nextcloud").click()
nextcloud = nextcloud_info.value
nextcloud.get_by_role("link", name="Open settings menu").click()
nextcloud.get_by_role("link", name="Users").click()
nextcloud.locator("#app-content div").filter(has_text=testuser["username"]).get_by_role(
nextcloud.locator("#app-content div").filter(has_text=os.environ["NEXTCLOUD_USER"]).get_by_role(
"button", name="Toggle user actions menu"
).click()
nextcloud.get_by_role("button", name="Delete user").click()
nextcloud.get_by_role("button", name=f"Delete authentik-{testuser['username']}'s account").click()
context.tracing.stop(path=f"{RECORDS}/nextcloud_delete_user.zip")
context.close()
nextcloud.get_by_role("button", name=f"Delete authentik-{os.environ["NEXTCLOUD_USER"]}'s account").click()