mirror of
https://github.com/nextcloud/docker.git
synced 2025-03-14 18:35:08 +01:00
Talk - WIP
This commit is contained in:
parent
3fd1cd6dcd
commit
c9c5a59acc
7 changed files with 93 additions and 3 deletions
|
@ -12,5 +12,6 @@ RUN pip install playwright
|
|||
|
||||
# Set up Playwright dependencies for Chromium, Firefox and Webkit
|
||||
RUN playwright install
|
||||
RUN playwright install-deps
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
|
|
@ -17,7 +17,7 @@ services:
|
|||
- MYSQL_DATABASE=nextcloud
|
||||
- MYSQL_USER=nextcloud
|
||||
|
||||
app:
|
||||
nc:
|
||||
image: nextcloud:26.0.1
|
||||
restart: always
|
||||
ports:
|
||||
|
|
35
create_chat.py
Normal file
35
create_chat.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
from playwright.sync_api import Playwright, sync_playwright, expect
|
||||
|
||||
|
||||
def run(playwright: Playwright) -> None:
|
||||
browser = playwright.chromium.launch(headless=False)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto("http://localhost:8080/login")
|
||||
page.get_by_label("Account name or email").click()
|
||||
page.get_by_label("Account name or email").fill("Crash")
|
||||
page.get_by_label("Account name or email").press("Tab")
|
||||
page.get_by_label("Password", exact=True).fill("Override")
|
||||
page.get_by_role("button", name="Log in").click()
|
||||
page.get_by_role("link", name="Talk", exact=True).click()
|
||||
page.get_by_placeholder("Search conversations or users").click()
|
||||
page.locator("#app-content-vue").click()
|
||||
page.get_by_role("button", name="Create a new group conversation").click()
|
||||
page.locator("label").filter(has_text="Allow guests to join via link").locator("path").click()
|
||||
page.get_by_placeholder("Conversation name").click()
|
||||
page.get_by_placeholder("Conversation name").fill("Drum talk")
|
||||
page.get_by_role("button", name="Create conversation").click()
|
||||
page.get_by_role("button", name="Copy conversation link").click()
|
||||
page.locator("#modal-description-ytlxf").get_by_role("button", name="Close", exact=True).click()
|
||||
page.get_by_role("button", name="Reply").click()
|
||||
page.get_by_role("textbox", name="Write message, @ to mention someone …").fill("Pretty good! Working on a new drum fill!")
|
||||
page.get_by_role("textbox", name="Write message, @ to mention someone …").press("Enter")
|
||||
page.close()
|
||||
|
||||
# ---------------------
|
||||
context.close()
|
||||
browser.close()
|
||||
|
||||
|
||||
with sync_playwright() as playwright:
|
||||
run(playwright)
|
23
join_chat.py
Normal file
23
join_chat.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from playwright.sync_api import Playwright, sync_playwright, expect
|
||||
|
||||
|
||||
def run(playwright: Playwright) -> None:
|
||||
browser = playwright.chromium.launch(headless=False)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto("http://localhost:8080/call/2sfgz4ir")
|
||||
page.get_by_role("button", name="Edit").click()
|
||||
page.get_by_placeholder("Guest").fill("Splash")
|
||||
page.get_by_role("button", name="Save name").click()
|
||||
page.get_by_role("textbox", name="Write message, @ to mention someone …").click()
|
||||
page.get_by_role("textbox", name="Write message, @ to mention someone …").fill("Hey, how's it going?")
|
||||
page.get_by_role("textbox", name="Write message, @ to mention someone …").press("Enter")
|
||||
page.close()
|
||||
|
||||
# ---------------------
|
||||
context.close()
|
||||
browser.close()
|
||||
|
||||
|
||||
with sync_playwright() as playwright:
|
||||
run(playwright)
|
31
nextcloud_create_user_playwright.py
Normal file
31
nextcloud_create_user_playwright.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
from playwright.sync_api import Playwright, sync_playwright
|
||||
|
||||
|
||||
def run(playwright: Playwright) -> None:
|
||||
browser = playwright.chromium.launch(headless=False)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
page.goto("http://localhost:8080/login")
|
||||
page.get_by_label("Account name or email").click()
|
||||
page.get_by_label("Account name or email").fill("Crash")
|
||||
page.get_by_label("Password", exact=True).click()
|
||||
page.get_by_label("Password", exact=True).fill("Override")
|
||||
page.get_by_role("button", name="Log in").click()
|
||||
page.get_by_role("link", name="Open settings menu").click()
|
||||
page.get_by_role("link", name="Users").click()
|
||||
page.get_by_role("button", name="New user").click()
|
||||
page.get_by_placeholder("Username").click()
|
||||
page.get_by_placeholder("Username").fill("Splash")
|
||||
page.get_by_placeholder("Display name").click()
|
||||
page.get_by_placeholder("Display name").fill("Splash")
|
||||
page.get_by_placeholder("Password", exact=True).click()
|
||||
page.get_by_placeholder("Password", exact=True).fill("cymbals3533")
|
||||
page.get_by_role("button", name="Add a new user").click()
|
||||
|
||||
# ---------------------
|
||||
context.close()
|
||||
browser.close()
|
||||
|
||||
|
||||
with sync_playwright() as playwright:
|
||||
run(playwright)
|
|
@ -10,7 +10,7 @@ async def main():
|
|||
)
|
||||
page = await browser.new_page()
|
||||
# await page.set_default_timeout(60_000) # milliseconds
|
||||
await page.goto('http://app/')
|
||||
await page.goto('http://nc/')
|
||||
|
||||
# 1. Create User
|
||||
await page.type('#adminlogin', 'Crash')
|
||||
|
|
|
@ -33,7 +33,7 @@ services:
|
|||
networks:
|
||||
- nextcloud-setup-network
|
||||
|
||||
app:
|
||||
nc:
|
||||
volumes: []
|
||||
networks:
|
||||
- nextcloud-setup-network
|
||||
|
|
Loading…
Add table
Reference in a new issue