Add project files

This commit is contained in:
Kunthawat Greethong
2025-12-05 09:26:53 +07:00
parent 3b43cb52ef
commit 11986a0196
814 changed files with 141076 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
import { test } from "./helpers/test_helper";
import { expect } from "@playwright/test";
test("edit custom model", async ({ po }) => {
await po.setUp();
await po.goToSettingsTab();
await po.page.getByText("test-provider").click();
// test edit model by double clicking the model panel
await po.page
.locator(".text-lg.font-semibold", { hasText: "test-model" })
.dblclick({ delay: 100 });
await po.page.locator("#edit-model-id").clear();
await po.page.locator("#edit-model-id").fill("new-model-id");
await po.page.locator("#edit-model-name").clear();
await po.page.locator("#edit-model-name").fill("new-model-name");
await po.page.getByRole("button", { name: "Update Model" }).click();
// assert that the model was updated
await po.page
.locator(".text-lg.font-semibold", { hasText: "new-model-name" })
.dblclick({ delay: 100 });
await expect(po.page.locator("#edit-model-id")).toHaveValue("new-model-id");
await expect(po.page.locator("#edit-model-name")).toHaveValue(
"new-model-name",
);
await po.page.getByRole("button", { name: "Cancel" }).click();
// test edit model by clicking the edit button
await po.page
.locator('button svg path[d*="M11 5H6a2"]')
.locator("..")
.locator("..")
.click();
await po.page.locator("#edit-model-id").clear();
await po.page.locator("#edit-model-id").fill("another-model-id");
await po.page.locator("#edit-model-name").clear();
await po.page.locator("#edit-model-name").fill("another-model-name");
await po.page.getByRole("button", { name: "Update Model" }).click();
// assert that the model was updated
await po.page
.locator(".text-lg.font-semibold", { hasText: "another-model-name" })
.dblclick({ delay: 100 });
await expect(po.page.locator("#edit-model-id")).toHaveValue(
"another-model-id",
);
await expect(po.page.locator("#edit-model-name")).toHaveValue(
"another-model-name",
);
await po.page.getByRole("button", { name: "Cancel" }).click();
// Make sure UI hasn't freezed
await po.goToAppsTab();
});