test(v2): stabilize production E2E flows
This commit is contained in:
5 files changed
+21
-7
No files matched your search
@@ -48,7 +48,7 @@ export const BoardAddMenu = () => {
|
|||||||
return (
|
return (
|
||||||
<Menu position="bottom-end">
|
<Menu position="bottom-end">
|
||||||
<Menu.Target>
|
<Menu.Target>
|
||||||
<HeaderButton w="auto" px={4}>
|
<HeaderButton w="auto" px={4} aria-label={t("board.action.addContent")}>
|
||||||
<Group gap={4} wrap="nowrap">
|
<Group gap={4} wrap="nowrap">
|
||||||
<IconPlus stroke={1.5} />
|
<IconPlus stroke={1.5} />
|
||||||
<IconChevronDown color="gray" size={16} />
|
<IconChevronDown color="gray" size={16} />
|
||||||
|
|||||||
@@ -110,7 +110,9 @@ const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {
|
|||||||
<HeaderButton
|
<HeaderButton
|
||||||
onClick={toggle}
|
onClick={toggle}
|
||||||
loading={isPending}
|
loading={isPending}
|
||||||
|
data-testid="board-edit-mode-toggle"
|
||||||
aria-label={isEditMode ? commonT("common.action.save") : commonT("common.action.edit")}
|
aria-label={isEditMode ? commonT("common.action.save") : commonT("common.action.edit")}
|
||||||
|
aria-pressed={isEditMode}
|
||||||
onFocus={preloadBoardAddMenu}
|
onFocus={preloadBoardAddMenu}
|
||||||
onPointerEnter={preloadBoardAddMenu}
|
onPointerEnter={preloadBoardAddMenu}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ describe("Custom JSX v2 workbench", () => {
|
|||||||
await page.waitForLoadState("networkidle");
|
await page.waitForLoadState("networkidle");
|
||||||
await page.getByLabel("Username").fill(adminCredentials.username);
|
await page.getByLabel("Username").fill(adminCredentials.username);
|
||||||
await page.locator("#password").fill(adminCredentials.password);
|
await page.locator("#password").fill(adminCredentials.password);
|
||||||
|
const signedIn = page.waitForURL(baseUrl, { waitUntil: "commit", timeout: 15_000 });
|
||||||
await page.locator("button[type='submit']").click();
|
await page.locator("button[type='submit']").click();
|
||||||
await page.waitForURL(baseUrl, { timeout: 15_000 });
|
await signedIn;
|
||||||
|
|
||||||
await page.goto(`${baseUrl}/manage/custom-widgets/new`);
|
await page.goto(`${baseUrl}/manage/custom-widgets/new`);
|
||||||
await page.locator('input[data-path="name"]:visible').fill("E2E Custom JSX v2");
|
await page.locator('input[data-path="name"]:visible').fill("E2E Custom JSX v2");
|
||||||
@@ -75,8 +76,12 @@ describe("Custom JSX v2 workbench", () => {
|
|||||||
await expect(page.getByText('Widget "E2E Custom JSX v2" updated successfully.')).toBeVisible({ timeout: 15_000 });
|
await expect(page.getByText('Widget "E2E Custom JSX v2" updated successfully.')).toBeVisible({ timeout: 15_000 });
|
||||||
|
|
||||||
await page.goto(baseUrl);
|
await page.goto(baseUrl);
|
||||||
await page.getByRole("button", { name: "Edit", exact: true }).click();
|
await page.getByRole("button", { name: "Skip tour", exact: true }).click();
|
||||||
await page.getByRole("button", { name: "New item", exact: true }).click();
|
await expect(page.locator('[data-onboarding-tour-overlay="true"]')).toHaveCount(0);
|
||||||
|
const editToggle = page.getByTestId("board-edit-mode-toggle");
|
||||||
|
await editToggle.click();
|
||||||
|
await expect(editToggle).toHaveAttribute("aria-pressed", "true", { timeout: 15_000 });
|
||||||
|
await page.getByRole("button", { name: "Add board content", exact: true }).click();
|
||||||
await page.getByRole("menuitem", { name: "New item", exact: true }).click();
|
await page.getByRole("menuitem", { name: "New item", exact: true }).click();
|
||||||
const picker = page.getByRole("dialog").last();
|
const picker = page.getByRole("dialog").last();
|
||||||
const customWidgetCard = picker.getByText("E2E Custom JSX v2", { exact: true }).locator("xpath=../../..");
|
const customWidgetCard = picker.getByText("E2E Custom JSX v2", { exact: true }).locator("xpath=../../..");
|
||||||
@@ -87,7 +92,8 @@ describe("Custom JSX v2 workbench", () => {
|
|||||||
await addDialog.getByRole("button", { name: "Save changes", exact: true }).click();
|
await addDialog.getByRole("button", { name: "Save changes", exact: true }).click();
|
||||||
|
|
||||||
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
|
await expect(page.getByText("Widget definition not found")).not.toBeVisible();
|
||||||
await page.getByRole("button", { name: "Save", exact: true }).click();
|
await editToggle.click();
|
||||||
|
await expect(editToggle).toHaveAttribute("aria-pressed", "false", { timeout: 15_000 });
|
||||||
await expect(page.getByText("E2E Widget")).toBeVisible({ timeout: 15_000 });
|
await expect(page.getByText("E2E Widget")).toBeVisible({ timeout: 15_000 });
|
||||||
await expect(page.getByText("42")).toBeVisible({ timeout: 15_000 });
|
await expect(page.getByText("42")).toBeVisible({ timeout: 15_000 });
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -78,10 +78,15 @@ describe("lazy widget application graph", () => {
|
|||||||
await page.goto(`${baseUrl}/auth/login`);
|
await page.goto(`${baseUrl}/auth/login`);
|
||||||
await page.getByLabel("Username").fill(adminCredentials.username);
|
await page.getByLabel("Username").fill(adminCredentials.username);
|
||||||
await page.locator("#password").fill(adminCredentials.password);
|
await page.locator("#password").fill(adminCredentials.password);
|
||||||
|
const signedIn = page.waitForURL(baseUrl, { waitUntil: "commit", timeout: 15_000 });
|
||||||
await page.locator("css=button[type='submit']").click();
|
await page.locator("css=button[type='submit']").click();
|
||||||
|
await signedIn;
|
||||||
|
|
||||||
await expect(page.locator("[data-homarr-dev-benchmark-board]")).toBeVisible({ timeout: 30_000 });
|
await expect(page.locator("[data-homarr-dev-benchmark-board]")).toBeVisible({ timeout: 30_000 });
|
||||||
await expect(page.locator(`[data-id="${itemId}"] .clock-widget-container`)).toBeVisible({ timeout: 15_000 });
|
const clockWidget = page.locator(
|
||||||
|
`[data-id="${itemId}"] .clock-widget-container, [data-grid-item-id="${itemId}"] .clock-widget-container`,
|
||||||
|
);
|
||||||
|
await expect(clockWidget).toBeVisible({ timeout: 15_000 });
|
||||||
|
|
||||||
await page.keyboard.press("Control+K");
|
await page.keyboard.press("Control+K");
|
||||||
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).toBeVisible();
|
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).toBeVisible();
|
||||||
@@ -100,7 +105,7 @@ describe("lazy widget application graph", () => {
|
|||||||
.toBe(`${baseUrl}/`);
|
.toBe(`${baseUrl}/`);
|
||||||
|
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await expect(page.locator(`[data-id="${itemId}"] .clock-widget-container`)).toBeVisible({ timeout: 15_000 });
|
await expect(clockWidget).toBeVisible({ timeout: 15_000 });
|
||||||
expect(pageErrors).toEqual([]);
|
expect(pageErrors).toEqual([]);
|
||||||
} finally {
|
} finally {
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|||||||
@@ -4521,6 +4521,7 @@
|
|||||||
},
|
},
|
||||||
"board": {
|
"board": {
|
||||||
"action": {
|
"action": {
|
||||||
|
"addContent": "Add board content",
|
||||||
"duplicate": {
|
"duplicate": {
|
||||||
"title": "Duplicate board",
|
"title": "Duplicate board",
|
||||||
"message": "This will duplicate the board {name} with all its content. If widgets reference integrations, that you are not allowed to use, they will be removed.",
|
"message": "This will duplicate the board {name} with all its content. If widgets reference integrations, that you are not allowed to use, they will be removed.",
|
||||||
|
|||||||
Reference in new issue
Block a user