This commit is contained in:
nnduc
2026-10-24 14:03:52 +07:00
commit 4fe046de58
4790 changed files with 311146 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import asyncio
from playwright.async_api import async_playwright
from browser import login, BASE, OUT
import os
S = os.path.dirname(os.path.abspath(__file__))
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch()
ctx, page, errors = await login(browser, "alice@localhost", "alicepass", "aliceup")
await page.goto(BASE + "/chat/bob@localhost")
await page.wait_for_selector("#chat_textarea", timeout=15000)
await page.wait_for_timeout(2000)
for f in ("test.png", "notes.txt"):
await page.evaluate("Upload_ajaxGetPanel()")
await page.wait_for_selector("#upload", timeout=10000)
await page.set_input_files("input#file", f"{S}/{f}")
await page.wait_for_timeout(1500)
await page.click("#upload_button")
await page.wait_for_timeout(4000)
await page.screenshot(path=f"{OUT}/upload_1.png")
for e in errors:
print(e)
await browser.close()
asyncio.run(main())