fix e2e selectors

This commit is contained in:
ajnart committed 2026-07-28 15:49:17 +02:00
1 parent a7eae3ff81
commit 6f957ee984
2 files changed
+6 -5

No files matched your search

+4 -4
View File
@@ -173,8 +173,8 @@ const addCustomWidgetToBoard = async (
const customWidgetCard = picker.getByText(name, { exact: true }).locator("xpath=../../..");
await customWidgetCard.hover();
await customWidgetCard.getByRole("button", { name: "Add to board" }).click();
const addDialog = page.getByRole("dialog").last();
await expect(addDialog.getByText(name, { exact: true })).toBeVisible();
const addDialog = page.getByRole("dialog", { name: `Edit item - ${name}`, exact: true });
await expect(addDialog).toBeVisible();
await addDialog.getByRole("button", { name: "Save changes", exact: true }).click();
await page.getByRole("button", { name: "Save", exact: true }).click();
};
@@ -233,9 +233,9 @@ describe("Custom JSX v2 workbench", () => {
await expect(page.getByText('Widget "E2E Custom JSX v2" updated successfully.')).toBeVisible({ timeout: 15_000 });
await addCustomWidgetToBoard(page, baseUrl, "E2E Custom JSX v2");
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
await expect(page.getByText("E2E Widget")).toBeVisible({ timeout: 15_000 });
await expect(page.getByText("42")).toBeVisible({ timeout: 15_000 });
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
} finally {
await Promise.allSettled([browser?.close(), homarrContainer?.stop(), mockApi?.close()]);
}
@@ -299,9 +299,9 @@ describe("Custom JSX v2 workbench", () => {
await page.waitForURL("**/manage/custom-widgets/edit/**", { timeout: 15_000 });
await addCustomWidgetToBoard(page, baseUrl, workshopWidgetName);
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
await expect(page.getByText("Workshop query result")).toBeVisible({ timeout: 15_000 });
await expect(page.getByText("73")).toBeVisible({ timeout: 15_000 });
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
} finally {
await Promise.allSettled([browser?.close(), homarrContainer?.stop(), workshopMock?.close(), mockApi?.close()]);
}
+2 -1
View File
@@ -28,7 +28,8 @@ export class OnboardingActions {
}
public async startOnboardingAsync(type: "scratch" | "before 1.0") {
await this.page.locator("button", { hasText: type }).click();
const name = type === "scratch" ? "Start from scratch" : "Import from Homarr before 1.0";
await this.page.getByRole("button", { name, exact: true }).click();
}
public async processUserStepAsync(input: { username: string; password: string; confirmPassword: string }) {