mirror of
https://github.com/nextcloud/docker.git
synced 2025-03-17 11:55:08 +01:00
Changed to TimeoutError; Updated selector
This commit is contained in:
parent
e6da52e9c3
commit
7ce555bae0
4 changed files with 16 additions and 16 deletions
|
@ -2,7 +2,7 @@ import contextlib
|
||||||
import sys
|
import sys
|
||||||
from time import sleep, time_ns
|
from time import sleep, time_ns
|
||||||
|
|
||||||
from playwright.sync_api import Playwright, sync_playwright
|
from playwright.sync_api import Playwright, sync_playwright, TimeoutError
|
||||||
|
|
||||||
def log_note(message: str) -> None:
|
def log_note(message: str) -> None:
|
||||||
timestamp = str(time_ns())[:16]
|
timestamp = str(time_ns())[:16]
|
||||||
|
@ -34,8 +34,8 @@ def run(playwright: Playwright, browser_name: str) -> None:
|
||||||
page.locator("#view7-input-file").press("Enter")
|
page.locator("#view7-input-file").press("Enter")
|
||||||
page.get_by_role("button", name="Create a new file with the selected template").click()
|
page.get_by_role("button", name="Create a new file with the selected template").click()
|
||||||
sleep(5)
|
sleep(5)
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
page.get_by_role("button", name="Close modal").click(timeout=15_000)
|
page.locator('button.first-run-wizard__close-button').click(timeout=15_000)
|
||||||
page.keyboard.press("Escape")
|
page.keyboard.press("Escape")
|
||||||
log_note("Share file with other user")
|
log_note("Share file with other user")
|
||||||
page.get_by_role("link", name="colab_meeting .md").get_by_role("link", name="Share").click()
|
page.get_by_role("link", name="colab_meeting .md").get_by_role("link", name="Share").click()
|
||||||
|
|
|
@ -2,7 +2,7 @@ import sys
|
||||||
import contextlib
|
import contextlib
|
||||||
from time import time_ns, sleep
|
from time import time_ns, sleep
|
||||||
|
|
||||||
from playwright.sync_api import Playwright, sync_playwright
|
from playwright.sync_api import Playwright, sync_playwright, TimeoutError
|
||||||
|
|
||||||
def log_note(message: str) -> None:
|
def log_note(message: str) -> None:
|
||||||
timestamp = str(time_ns())[:16]
|
timestamp = str(time_ns())[:16]
|
||||||
|
@ -31,8 +31,8 @@ def create_user(playwright: Playwright, browser_name: str, username: str, passwo
|
||||||
# Sleep to make sure the modal has time to appear before continuing navigation
|
# Sleep to make sure the modal has time to appear before continuing navigation
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
page.get_by_role("button", name="Close modal").click(timeout=15_000)
|
page.locator('button.first-run-wizard__close-button').click(timeout=15_000)
|
||||||
log_note("Create user")
|
log_note("Create user")
|
||||||
page.get_by_role("link", name="Open settings menu").click()
|
page.get_by_role("link", name="Open settings menu").click()
|
||||||
page.get_by_role("link", name="Users").first.click()
|
page.get_by_role("link", name="Users").first.click()
|
||||||
|
|
|
@ -4,7 +4,7 @@ import string
|
||||||
import sys
|
import sys
|
||||||
from time import time_ns, sleep
|
from time import time_ns, sleep
|
||||||
|
|
||||||
from playwright.sync_api import Playwright, sync_playwright, expect
|
from playwright.sync_api import Playwright, sync_playwright, expect, TimeoutError
|
||||||
|
|
||||||
|
|
||||||
def get_random_text() -> str:
|
def get_random_text() -> str:
|
||||||
|
@ -43,9 +43,9 @@ def collaborate(playwright: Playwright, browser_name: str) -> None:
|
||||||
login(admin_user, "Crash", "Override")
|
login(admin_user, "Crash", "Override")
|
||||||
login(docs_user, "docs_dude", "docsrule!12")
|
login(docs_user, "docs_dude", "docsrule!12")
|
||||||
log_note("Opening document with both users")
|
log_note("Opening document with both users")
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
sleep(5)
|
sleep(5)
|
||||||
docs_user.get_by_role("button", name="Close modal").click(timeout=15_000)
|
docs_user.locator('button.first-run-wizard__close-button').click(timeout=15_000)
|
||||||
admin_user.get_by_role("link", name="Files", exact=True).click()
|
admin_user.get_by_role("link", name="Files", exact=True).click()
|
||||||
docs_user.get_by_role("link", name="Files", exact=True).click()
|
docs_user.get_by_role("link", name="Files", exact=True).click()
|
||||||
admin_user.get_by_role("link", name="Shares", exact=True).click()
|
admin_user.get_by_role("link", name="Shares", exact=True).click()
|
||||||
|
|
|
@ -4,7 +4,7 @@ import string
|
||||||
import sys
|
import sys
|
||||||
from time import sleep, time_ns
|
from time import sleep, time_ns
|
||||||
|
|
||||||
from playwright.sync_api import Playwright, sync_playwright, expect
|
from playwright.sync_api import Playwright, sync_playwright, expect, TimeoutError
|
||||||
|
|
||||||
def log_note(message: str) -> None:
|
def log_note(message: str) -> None:
|
||||||
timestamp = str(time_ns())[:16]
|
timestamp = str(time_ns())[:16]
|
||||||
|
@ -43,21 +43,21 @@ def create_conversation(playwright: Playwright, browser_name: str) -> str:
|
||||||
|
|
||||||
# Wait for the modal to load. As it seems you can't close it while it is showing the opening animation.
|
# Wait for the modal to load. As it seems you can't close it while it is showing the opening animation.
|
||||||
log_note("Close first-time run popup")
|
log_note("Close first-time run popup")
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
sleep(5)
|
sleep(5)
|
||||||
page.get_by_role("button", name="Close modal").click(timeout=15_000)
|
page.locator('button.first-run-wizard__close-button').click(timeout=15_000)
|
||||||
|
|
||||||
log_note("Open Talk app")
|
log_note("Open Talk app")
|
||||||
page.locator('#header').get_by_role("link", name="Talk", exact=True).click()
|
page.locator('#header').get_by_role("link", name="Talk", exact=True).click()
|
||||||
page.wait_for_url("**/apps/spreed/")
|
page.wait_for_url("**/apps/spreed/")
|
||||||
|
|
||||||
# Second welcome screen?
|
# Second welcome screen?
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
page.get_by_role("button", name="Close modal").click(timeout=15_000)
|
page.locator('button.first-run-wizard__close-button').click(timeout=15_000)
|
||||||
|
|
||||||
# Headless browsers trigger a warning in Nextcloud, however they actually work fine
|
# Headless browsers trigger a warning in Nextcloud, however they actually work fine
|
||||||
log_note("Close headless warning")
|
log_note("Close headless warning")
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
page.wait_for_selector('.toast-close')
|
page.wait_for_selector('.toast-close')
|
||||||
page.click('.toast-close')
|
page.click('.toast-close')
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ def talk(playwright: Playwright, url: str, browser_name: str) -> None:
|
||||||
|
|
||||||
# Close toast messages for headless browsers
|
# Close toast messages for headless browsers
|
||||||
log_note("Close headless warning")
|
log_note("Close headless warning")
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(TimeoutError):
|
||||||
for page in pages:
|
for page in pages:
|
||||||
page.wait_for_selector('.toast-close').click()
|
page.wait_for_selector('.toast-close').click()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue