cleanup
This commit is contained in:
parent
ec748398fb
commit
c9cb39d375
1 changed files with 4 additions and 11 deletions
|
|
@ -6,32 +6,25 @@ from src.dirmanager import DirManager
|
|||
|
||||
@pytest.mark.xfail(reason="wordpress sso login has not been generated")
|
||||
def test_visit_from_domain(authentik_admin_context: BrowserContext, dotenv_config: dict[str, str]):
|
||||
"""visit wordpress directly with admin_session, expect not to be logged in"""
|
||||
page = authentik_admin_context.new_page()
|
||||
url = "https://" + dotenv_config["DOMAIN"]
|
||||
page.goto(url)
|
||||
|
||||
# look for content wrapper
|
||||
expect(page.locator("#wpcontent")).to_be_visible(timeout=3_000)
|
||||
|
||||
# look for admin bar
|
||||
expect(page.locator("#wpadminbar")).to_be_visible(timeout=3_000)
|
||||
|
||||
|
||||
def test_visit_from_authentik(authentik_admin_page: Page, DIR: DirManager):
|
||||
def setup_wordpress_admin_session(authentik_admin_page: Page, DIR: DirManager):
|
||||
"""visit wordpress from authentik with admin_session to create wordpress_admin_session"""
|
||||
with authentik_admin_page.expect_popup() as event_context:
|
||||
authentik_admin_page.get_by_role("link", name="Wordpress").click()
|
||||
page_wordpress = event_context.value
|
||||
|
||||
# look for content wrapper
|
||||
expect(page_wordpress.locator("#wpcontent")).to_be_visible()
|
||||
|
||||
# look for admin bar
|
||||
expect(page_wordpress.locator("#wpadminbar")).to_be_visible()
|
||||
|
||||
# save session
|
||||
context = page_wordpress.context
|
||||
|
||||
context.storage_state(path=f"{DIR.STATES}/wordpress_admin_state.json")
|
||||
|
||||
|
||||
def setup_something():
|
||||
assert False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue