fix nextcloud setup
This commit is contained in:
parent
8118aac5a8
commit
c02af669fe
1 changed files with 50 additions and 31 deletions
|
|
@ -1,35 +1,54 @@
|
||||||
import pytest
|
from playwright.sync_api import Page, expect
|
||||||
|
|
||||||
|
from src.dir_manager import DirManager
|
||||||
|
|
||||||
|
# url dashboard
|
||||||
|
# https://files.test.dev.local-it.cloud/apps/dashboard/
|
||||||
|
# url files
|
||||||
|
# https://files.test.dev.local-it.cloud/apps/files/
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session", autouse=True)
|
def setup_nextcloud_admin_session(authentik_admin_page: Page, DIR: DirManager):
|
||||||
def nc_login(browser: Browser):
|
"""visit nextcloud from authentik with admin_session to create wordpress_admin_session"""
|
||||||
"""Nextcloud Login"""
|
with authentik_admin_page.expect_popup() as event_context:
|
||||||
context = setup_context(browser, f"{STATES}/user_state.json")
|
authentik_admin_page.get_by_role("link", name="Nextcloud").click()
|
||||||
page = context.new_page()
|
page_nextcloud = event_context.value
|
||||||
page.goto(CONFIG["domain"])
|
context = page_nextcloud.context
|
||||||
with page.expect_popup() as nextcloud_info:
|
|
||||||
link = page.get_by_role("link", name="Nextcloud")
|
context.storage_state(path=f"{DIR.STATES}/nextcloud_admin_state.json")
|
||||||
CONFIG["nc_domain"] = link.get_attribute("href")
|
page_nextcloud.goto("/apps/files")
|
||||||
link.click()
|
expect(page_nextcloud.get_by_role("link", name="Name")).to_be_visible()
|
||||||
nextcloud = nextcloud_info.value
|
|
||||||
check_for(nextcloud.get_by_role("link", name="Name"))
|
|
||||||
if nextcloud.query_selector(".close-icon"):
|
|
||||||
close_button = nextcloud.get_by_role("button", name="Close modal")
|
|
||||||
close_button.click()
|
|
||||||
expect(close_button).to_be_hidden()
|
|
||||||
nextcloud.wait_for_timeout(2000)
|
|
||||||
context.storage_state(path=f"{STATES}/nc_user_state.json")
|
|
||||||
context.tracing.stop(path=f"{RECORDS}/nextcloud_login_user.zip")
|
|
||||||
context.close()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
# @pytest.fixture(scope="session", autouse=True)
|
||||||
def nc_session(browser: Browser):
|
# def nc_login(browser: Browser):
|
||||||
"""Reuse Nextcloud User Session"""
|
# """Nextcloud Login"""
|
||||||
context = setup_context(browser, f"{STATES}/nc_user_state.json")
|
# context = setup_context(browser, f"{STATES}/user_state.json")
|
||||||
page = context.new_page()
|
# page = context.new_page()
|
||||||
page.goto(CONFIG["nc_domain"])
|
# page.goto(CONFIG["domain"])
|
||||||
if page.query_selector(".close-icon"):
|
# with page.expect_popup() as nextcloud_info:
|
||||||
page.get_by_role("button", name="Close modal").click()
|
# link = page.get_by_role("link", name="Nextcloud")
|
||||||
yield context, page
|
# CONFIG["nc_domain"] = link.get_attribute("href")
|
||||||
context.close()
|
# link.click()
|
||||||
|
# nextcloud = nextcloud_info.value
|
||||||
|
# check_for(nextcloud.get_by_role("link", name="Name"))
|
||||||
|
# if nextcloud.query_selector(".close-icon"):
|
||||||
|
# close_button = nextcloud.get_by_role("button", name="Close modal")
|
||||||
|
# close_button.click()
|
||||||
|
# expect(close_button).to_be_hidden()
|
||||||
|
# nextcloud.wait_for_timeout(2000)
|
||||||
|
# context.storage_state(path=f"{STATES}/nc_user_state.json")
|
||||||
|
# context.tracing.stop(path=f"{RECORDS}/nextcloud_login_user.zip")
|
||||||
|
# context.close()
|
||||||
|
|
||||||
|
|
||||||
|
# @pytest.fixture
|
||||||
|
# def nc_session(browser: Browser):
|
||||||
|
# """Reuse Nextcloud User Session"""
|
||||||
|
# context = setup_context(browser, f"{STATES}/nc_user_state.json")
|
||||||
|
# page = context.new_page()
|
||||||
|
# page.goto(CONFIG["nc_domain"])
|
||||||
|
# if page.query_selector(".close-icon"):
|
||||||
|
# page.get_by_role("button", name="Close modal").click()
|
||||||
|
# yield context, page
|
||||||
|
# context.close()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue