Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(web): publish and unpublish items from table #1312

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions web/e2e/project/content/content.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,52 @@ test("Item CRUD and searching has succeeded", async ({ page }) => {
await expect(page.getByRole("cell", { name: "new text" })).toBeHidden();
});

test("Publishing and Unpublishing item has succeeded", async ({ page }) => {
test("Publishing and Unpublishing item from edit page has succeeded", async ({ page }) => {
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click();
await handleFieldForm(page, "text");
await page.getByText("Settings").first().click();
await page.getByRole("row", { name: "Owner" }).getByRole("switch").click();
await page.getByRole("button", { name: "Save changes" }).last().click();
await closeNotification(page);
await page.getByText("Content").first().click();
await page.getByRole("button", { name: "plus New Item" }).click();
await page.getByLabel("text").click();
await page.getByLabel("text").fill("text");
await page.getByRole("button", { name: "Save" }).click();
await closeNotification(page);
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByRole("button", { name: "Publish" }).click();
await closeNotification(page);
await expect(page.getByText("PUBLIC")).toBeVisible();
await page.getByLabel("Back").click();
caichi-t marked this conversation as resolved.
Show resolved Hide resolved
await expect(page.getByText("PUBLIC")).toBeVisible();
await page.getByLabel("", { exact: true }).check();
await page.getByRole("cell").getByLabel("edit").locator("svg").click();
await expect(page.getByText("PUBLIC")).toBeVisible();
await page.getByRole("button", { name: "ellipsis" }).click();
await page.getByText("Unpublish").click();
await closeNotification(page);
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByRole("cell").getByLabel("edit").locator("svg").click();
await page.getByLabel("Back").click();
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByRole("button", { name: "Publish" }).click();
});

test("Publishing and Unpublishing item from table has succeeded", async ({ page }) => {
await page.locator("li").filter({ hasText: "Text" }).locator("div").first().click();
await handleFieldForm(page, "text");
await page.getByText("Content").first().click();
await page.getByRole("button", { name: "plus New Item" }).click();
await page.getByLabel("text").click();
await page.getByLabel("text").fill("text");
await page.getByRole("button", { name: "Save" }).click();
await closeNotification(page);
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByLabel("Back").click();
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByLabel("", { exact: true }).check();
await page.getByText("Publish", { exact: true }).click();
await page.getByRole("button", { name: "Yes" }).click();
await closeNotification(page);
await expect(page.getByText("PUBLIC")).toBeVisible();
caichi-t marked this conversation as resolved.
Show resolved Hide resolved
await page.getByRole("button", { name: "ellipsis" }).click();
await page.getByText("Unpublish").click();
await closeNotification(page);
await expect(page.getByText("DRAFT")).toBeVisible();
await page.getByLabel("Back").click();
await page.getByRole("cell").getByLabel("edit").locator("svg").click();
await expect(page.getByText("DRAFT")).toBeVisible();
});

Expand Down