-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): updating metadata added later from edit page (#1125)
* fix: updating metadata from detail * add: e2e test
- Loading branch information
Showing
4 changed files
with
93 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { closeNotification } from "@reearth-cms/e2e/common/notification"; | ||
import { handleFieldForm } from "@reearth-cms/e2e/project/utils/field"; | ||
import { createModel } from "@reearth-cms/e2e/project/utils/model"; | ||
import { createProject, deleteProject } from "@reearth-cms/e2e/project/utils/project"; | ||
import { expect, test } from "@reearth-cms/e2e/utils"; | ||
|
||
test.beforeEach(async ({ reearth, page }) => { | ||
await reearth.goto("/", { waitUntil: "domcontentloaded" }); | ||
await createProject(page); | ||
await createModel(page); | ||
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click(); | ||
await handleFieldForm(page, "text"); | ||
await page.getByText("Content").click(); | ||
await page.getByRole("button", { name: "plus New Item" }).click(); | ||
await page.getByRole("button", { name: "Save" }).click(); | ||
await closeNotification(page); | ||
await page.getByText("Schema").click(); | ||
await page.getByRole("tab", { name: "Meta Data" }).click(); | ||
await page.locator("li").filter({ hasText: "Boolean" }).locator("div").first().click(); | ||
await handleFieldForm(page, "boolean"); | ||
await page.getByText("Content").click(); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await deleteProject(page); | ||
}); | ||
|
||
test("Updating metadata added later from table has succeeded", async ({ page }) => { | ||
await page.getByRole("switch").click(); | ||
await closeNotification(page); | ||
await page.getByRole("link", { name: "edit", exact: true }).click(); | ||
await expect(page.getByLabel("boolean")).toHaveAttribute("aria-checked", "true"); | ||
}); | ||
|
||
test("Updating metadata added later from edit page has succeeded", async ({ page }) => { | ||
await page.getByRole("link", { name: "edit", exact: true }).click(); | ||
await page.getByLabel("boolean").click(); | ||
await closeNotification(page); | ||
await page.getByLabel("Back").click(); | ||
await expect(page.getByRole("switch")).toHaveAttribute("aria-checked", "true"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters