mirror of
https://github.com/nextcloud/docker.git
synced 2025-03-15 19:05:09 +01:00
Docs collaboration - MVP
This commit is contained in:
parent
7e556304d4
commit
b46c954d12
3 changed files with 42 additions and 18 deletions
|
@ -15,10 +15,9 @@ def run(playwright: Playwright) -> None:
|
||||||
page.get_by_role("link", name="New file/folder menu").click()
|
page.get_by_role("link", name="New file/folder menu").click()
|
||||||
page.get_by_role("link", name="New text file").click()
|
page.get_by_role("link", name="New text file").click()
|
||||||
page.locator("#view9-input-file").fill("colab_meeting.md")
|
page.locator("#view9-input-file").fill("colab_meeting.md")
|
||||||
page.get_by_role("button", name="Submit").click()
|
page.locator("#view9-input-file").press("Enter")
|
||||||
page.get_by_role("listitem").filter(has_text="Meeting notes").locator("img").click()
|
|
||||||
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()
|
||||||
page.get_by_text("# Meeting notes📅 15 January 2021, via Nextcloud Talk 👥 Julius, Vanessa, Jan, …").press("Escape")
|
page.get_by_role("button", name="Close modal").click()
|
||||||
page.get_by_role("link", name="Not favorited colab_meeting .md Share Actions").get_by_role("link", name="Share").click()
|
page.get_by_role("link", name="Not favorited colab_meeting .md Share Actions").get_by_role("link", name="Share").click()
|
||||||
page.get_by_placeholder("Name, email, or Federated Cloud ID …").click()
|
page.get_by_placeholder("Name, email, or Federated Cloud ID …").click()
|
||||||
page.get_by_placeholder("Name, email, or Federated Cloud ID …").fill("docs")
|
page.get_by_placeholder("Name, email, or Federated Cloud ID …").fill("docs")
|
||||||
|
|
|
@ -1,26 +1,50 @@
|
||||||
from playwright.sync_api import Playwright, sync_playwright, expect
|
from playwright.sync_api import Playwright, sync_playwright, expect
|
||||||
|
|
||||||
|
def collaborate(playwright: Playwright) -> None:
|
||||||
def run(playwright: Playwright) -> None:
|
|
||||||
browser = playwright.chromium.launch(headless=True)
|
browser = playwright.chromium.launch(headless=True)
|
||||||
context = browser.new_context()
|
context = browser.new_context()
|
||||||
page = context.new_page()
|
admin_user = context.new_page()
|
||||||
page.goto("http://nc/login")
|
|
||||||
page.get_by_label("Account name or email").click()
|
browser_two = playwright.chromium.launch(headless=True)
|
||||||
page.get_by_label("Account name or email").fill("docs_dude")
|
context_two = browser_two.new_context()
|
||||||
page.get_by_label("Account name or email").press("Tab")
|
docs_user = context_two.new_page()
|
||||||
page.get_by_label("Password", exact=True).fill("docsrule!12")
|
|
||||||
page.get_by_label("Password", exact=True).press("Enter")
|
# Login and open the file for both users
|
||||||
page.get_by_role("button", name="Close modal").click(timeout=15_000)
|
login(admin_user, "Crash", "Override")
|
||||||
page.get_by_role("link", name="Files").click()
|
login(docs_user, "docs_dude", "docsrule!12")
|
||||||
page.get_by_role("link", name="Shares").click()
|
docs_user.get_by_role("button", name="Close modal").click(timeout=15_000)
|
||||||
page.get_by_role("link", name="colab_meeting .md Shared by Crash Shared by Crash Actions").click()
|
admin_user.get_by_role("link", name="Files").click()
|
||||||
page.close()
|
docs_user.get_by_role("link", name="Files").click()
|
||||||
|
admin_user.get_by_role("link", name="Shares").click()
|
||||||
|
docs_user.get_by_role("link", name="Shares").click()
|
||||||
|
admin_user.get_by_role("link", name="colab_meeting .md").click()
|
||||||
|
docs_user.get_by_role("link", name="colab_meeting .md").click()
|
||||||
|
|
||||||
|
# Write the first message and assert it's visible for the other user
|
||||||
|
first_message = "FIRST_TEST_MESSAGE"
|
||||||
|
admin_user.get_by_role("dialog", name="colab_meeting.md").get_by_role("document").locator("div").first.type(first_message)
|
||||||
|
expect(docs_user.get_by_text(first_message)).to_be_visible()
|
||||||
|
|
||||||
|
second_message = " some other text"
|
||||||
|
docs_user.get_by_role("dialog", name="colab_meeting.md").get_by_role("document").locator("div").first.type(second_message)
|
||||||
|
expect(admin_user.get_by_text(second_message)).to_be_visible()
|
||||||
|
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
admin_user.close()
|
||||||
|
docs_user.close()
|
||||||
context.close()
|
context.close()
|
||||||
|
context_two.close()
|
||||||
browser.close()
|
browser.close()
|
||||||
|
browser_two.close()
|
||||||
|
|
||||||
|
def login(page, username, password):
|
||||||
|
page.goto("http://nc/login")
|
||||||
|
page.get_by_label("Account name or email").click()
|
||||||
|
page.get_by_label("Account name or email").fill(username)
|
||||||
|
page.get_by_label("Account name or email").press("Tab")
|
||||||
|
page.get_by_label("Password", exact=True).fill(password)
|
||||||
|
page.get_by_label("Password", exact=True).press("Enter")
|
||||||
|
|
||||||
|
|
||||||
with sync_playwright() as playwright:
|
with sync_playwright() as playwright:
|
||||||
run(playwright)
|
collaborate(playwright)
|
||||||
|
|
|
@ -18,6 +18,7 @@ def main():
|
||||||
|
|
||||||
# 2. Install all Apps
|
# 2. Install all Apps
|
||||||
install_selector = '.button-vue--vue-primary'
|
install_selector = '.button-vue--vue-primary'
|
||||||
|
page.wait_for_selector(install_selector)
|
||||||
page.click(install_selector)
|
page.click(install_selector)
|
||||||
|
|
||||||
# 3. Dashboard
|
# 3. Dashboard
|
||||||
|
|
Loading…
Add table
Reference in a new issue