add test to upload new video

This commit is contained in:
MarconLP 2023-04-15 21:36:20 +02:00
parent 6db45ffbfc
commit b1f644ad1e
No known key found for this signature in database
GPG key ID: A08A9C8B623F5EA5

View file

@ -1,5 +1,7 @@
import { test, expect } from "@playwright/test";
test.describe.configure({ mode: "serial" });
test("should be able to view videos", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page
@ -14,3 +16,21 @@ test("no videos should exist", async ({ page }) => {
"You do not have any recordings."
);
});
test("can upload video", async ({ page }) => {
await page.goto("http://localhost:3000/videos");
await page.getByText("New video").click();
await page
.getByText("Drop files to Attach, or browse")
.setInputFiles("tests/.auth/example_video.webm");
await page.getByRole("button", { name: "Upload" }).click();
await expect(page).toHaveURL(/http:\/\/localhost:3000\/share\/[A-Za-z0-9]+/, {
timeout: 30000,
});
await page.click('[href="/videos"]');
await page.getByText("example_video.webm").click();
await expect(page).toHaveURL(/http:\/\/localhost:3000\/share\/[A-Za-z0-9]+/, {
timeout: 30000,
});
});