diff --git a/tests/home.spec.js b/tests/home.spec.js index 1b0e053..c88b23f 100644 --- a/tests/home.spec.js +++ b/tests/home.spec.js @@ -17,29 +17,6 @@ test("Theme", async ({ page }) => { await page.getByRole("menuitem", { name: "System" }).click() }) -test("Create place with dialog", async ({ page }) => { - await page.getByRole("button", { name: "Add" }).click() - await page.getByLabel("Building").click() - await page.getByLabel("Bar").click() - await page.getByPlaceholder("Name of the building....").click() - await page.getByPlaceholder("Name of the building....").fill("Random Name") - await page.getByPlaceholder("Name of the building....").press("Tab") - await page - .getByPlaceholder("Which city are the building ?") - .fill("Random City") - await page.getByPlaceholder("Which city are the building ?").press("Tab") - await page.getByPlaceholder("What is the zipcode ?").fill("12345") - await page.getByPlaceholder("What is the zipcode ?").press("Tab") - await page.getByPlaceholder("Which country are the").fill("Random Country") - await page.getByRole("button", { name: "Next" }).click() - await page.getByLabel("Bar").click() - await page.getByLabel("Cocktail").getByText("Cocktail").click() - - await page.getByRole("button", { name: "Next" }).click() - await page.getByLabel("Create a place").getByText("Bar").click() - await page.getByRole("button", { name: "Finish" }).click() -}) - test("Pagination", async ({ page }) => { await expect(page.getByRole("button", { name: "Previous" })).toBeDisabled() await page.getByRole("button", { name: "Next" }).click() diff --git a/tests/places/create.spec.js b/tests/places/create.spec.js deleted file mode 100644 index 49e5dbb..0000000 --- a/tests/places/create.spec.js +++ /dev/null @@ -1,121 +0,0 @@ -import { test } from "@playwright/test" - -test.beforeEach(async ({ page }) => { - await page.goto("/places/create", { waitUntil: "networkidle" }) -}) - -test("Create a bar place", async ({ page }) => { - await page.getByLabel("Building").click() - await page.getByLabel("Bar").click() - await page.getByPlaceholder("Name of the building....").click() - await page.getByPlaceholder("Name of the building....").fill("Random bar") - await page.getByPlaceholder("Which city are the building ?").click() - await page - .getByPlaceholder("Which city are the building ?") - .fill("Random City") - await page.getByPlaceholder("Which city are the building ?").press("Tab") - await page.getByPlaceholder("What is the zipcode ?").fill("12345") - await page.getByPlaceholder("What is the zipcode ?").press("Tab") - await page.getByPlaceholder("Which country are the").fill("Random Country") - await page.getByRole("button", { name: "Next" }).click() - await page.getByLabel("Bar").click() - await page.getByLabel("Cocktail").click() - await page.getByLabel("Average Cost").click() - await page.getByLabel("1").click() - await page.getByRole("button", { name: "Next" }).click() - await page.getByRole("button", { name: "Finish" }).click() - await page.getByRole("heading", { name: "List of places" }).isVisible() - await page.getByPlaceholder("Search by name...").click() - await page.getByPlaceholder("Search by name...").fill("Random bar") - await page.getByRole("cell", { name: "Random bar" }).click() -}) - -test("Create a museum place", async ({ page }) => { - await page.getByLabel("Building").click() - await page.getByLabel("Museum").click() - await page.getByPlaceholder("Name of the building....").click() - await page.getByPlaceholder("Name of the building....").fill("Random Museum") - await page.getByPlaceholder("Name of the building....").press("Tab") - await page - .getByPlaceholder("Which city are the building ?") - .fill("Random City") - await page.getByPlaceholder("Which city are the building ?").press("Tab") - await page.getByPlaceholder("What is the zipcode ?").fill("12345") - await page.getByPlaceholder("What is the zipcode ?").press("Tab") - await page.getByPlaceholder("Which country are the").fill("Random Country") - await page.getByPlaceholder("Which country are the").press("Enter") - await page.getByLabel("Museum").click() - await page.getByLabel("Art", { exact: true }).click() - await page.getByLabel("Artistic movements").click() - await page.getByLabel("Renaissance").click() - await page.getByLabel("Free or Pay ?").click() - await page.getByLabel("Free", { exact: true }).click() - await page.getByRole("button", { name: "Next" }).click() - await page.getByPlaceholder("Give the price of the museum").fill("") - await page.getByRole("button", { name: "Next" }).click() - await page.getByRole("button", { name: "Finish" }).click() - await page.getByRole("heading", { name: "List of places" }).isVisible() - await page.getByPlaceholder("Search by name...").click() - await page.getByPlaceholder("Search by name...").fill("Random Museum") - await page.getByRole("cell", { name: "Random Museum" }).click() -}) - -test("Create a restaurant place", async ({ page }) => { - await page.getByLabel("Building").click() - await page.getByLabel("Restaurant").click() - await page.getByPlaceholder("Name of the building....").click() - await page - .getByPlaceholder("Name of the building....") - .fill("Random Restaurant") - await page.getByPlaceholder("Name of the building....").press("Tab") - await page - .getByPlaceholder("Which city are the building ?") - .fill("Random City") - await page.getByPlaceholder("Which city are the building ?").press("Tab") - await page.getByPlaceholder("What is the zipcode ?").fill("12345") - await page.getByPlaceholder("What is the zipcode ?").press("Tab") - await page.getByPlaceholder("Which country are the").fill("Random Country") - await page.getByPlaceholder("Which country are the").press("Enter") - await page.getByLabel("Restaurant").click() - await page.getByLabel("Italian").click() - await page.getByLabel("Stars").click() - await page.getByLabel("1").click() - await page.getByLabel("Average Cost").click() - await page.getByLabel("1").click() - await page.getByRole("button", { name: "Next" }).click() - await page.getByRole("button", { name: "Finish" }).click() - await page.getByRole("heading", { name: "List of places" }).isVisible() - await page.getByPlaceholder("Search by name...").click() - await page.getByPlaceholder("Search by name...").fill("Random Restaurant") - await page.getByRole("cell", { name: "Random Restaurant" }).click() -}) - -test("Create a park place", async ({ page }) => { - await page.locator("form").click() - await page.getByLabel("Building").click() - await page.getByLabel("Park").click() - await page.getByPlaceholder("Name of the building....").click() - await page.getByPlaceholder("Name of the building....").fill("Random Park") - await page.getByPlaceholder("Name of the building....").press("Tab") - await page - .getByPlaceholder("Which city are the building ?") - .fill("Random City") - await page.getByPlaceholder("Which city are the building ?").press("Tab") - await page.getByPlaceholder("What is the zipcode ?").fill("12345") - await page.getByPlaceholder("What is the zipcode ?").press("Tab") - await page.getByPlaceholder("Which country are the").fill("Random Country") - await page.getByPlaceholder("Which country are the").press("Enter") - await page.getByLabel("Park").click() - await page.getByLabel("City").click() - await page.getByLabel("Free or Pay ?").click() - await page.getByLabel("Free", { exact: true }).click() - await page.getByLabel("Public ?").click() - await page.getByRole("button", { name: "Next" }).click() - await page.getByPlaceholder("Give the price of the park").fill("") - await page.getByRole("button", { name: "Next" }).click() - await page.getByRole("button", { name: "Finish" }).click() - await page.getByRole("heading", { name: "List of places" }).isVisible() - await page.getByPlaceholder("Search by name...").click() - await page.getByPlaceholder("Search by name...").fill("Random park") - await page.getByRole("cell", { name: "Random Park" }).click() -})