-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel-files.spec.ts
More file actions
45 lines (40 loc) · 1.36 KB
/
Copy pathmodel-files.spec.ts
File metadata and controls
45 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { expect, test } from "@playwright/test";
function getInputFile(name: string) {
return {
name,
mimeType: "application/octet-stream",
buffer: Buffer.from(name),
};
}
test("coordinates individual model file slots", async ({ page }) => {
await page.goto("/");
await expect(page.getByTestId("model-file-slot")).toHaveCount(2);
await page
.getByLabel("Select dft.bin")
.setInputFiles(getInputFile("htdemucs.onnx"));
await expect(
page.getByText("Expected dft.bin, received htdemucs.onnx."),
).toBeVisible();
await page
.getByLabel("Select dft.bin")
.setInputFiles(getInputFile("dft.bin"));
await expect(
page.getByText("Expected dft.bin, received htdemucs.onnx."),
).toBeHidden();
await page
.getByLabel("Select htdemucs.onnx")
.setInputFiles(getInputFile("htdemucs.onnx"));
await expect(
page.getByTestId("model-file-slot").getByText("Ready"),
).toHaveCount(2);
await page.getByText("Advanced settings", { exact: true }).click();
await page.locator("#model").selectOption("htdemucs_ft");
await expect(page.getByTestId("model-file-slot")).toHaveCount(5);
await expect(page.getByLabel("Select dft.bin").locator("..")).toContainText(
"Ready",
);
await page.locator("#model").selectOption("htdemucs");
await expect(
page.getByTestId("model-file-slot").getByText("Ready"),
).toHaveCount(2);
});