Skip to content

Commit

Permalink
chore: replaced order of tests to see if cookies are cleared at a tes…
Browse files Browse the repository at this point in the history
…t level or a run level
  • Loading branch information
JohnAllenTech committed Oct 14, 2024
1 parent d5468c8 commit fbed02d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions e2e/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import { test, expect } from "@playwright/test";

test.describe("Testing homepage views", () => {
test("Unauthenticated homepage view", async ({ page }) => {
await page.context().clearCookies();
await page.goto("http://localhost:3000/");
// Check headers

await expect(page.locator("h1")).toContainText("A space for coders");
await expect(page.locator("h1")).not.toContainText("Unwanted text");
await expect(page.locator("h2")).toContainText(
"Sign up today to become a writer and get a free invite to our Discord community",
);
});

test("Authenticated homepage view", async ({ page, isMobile }) => {
await page.goto("http://localhost:3000/");

Expand All @@ -26,6 +14,16 @@ test.describe("Testing homepage views", () => {
}),
).toBeVisible();
});
test("Unauthenticated homepage view", async ({ page }) => {
await page.context().clearCookies();
await page.goto("http://localhost:3000/");

await expect(page.locator("h1")).toContainText("A space for coders");
await expect(page.locator("h1")).not.toContainText("Unwanted text");
await expect(page.locator("h2")).toContainText(
"Sign up today to become a writer and get a free invite to our Discord community",
);
});

test("Authenticated landing page view", async ({ page, isMobile }) => {
await page.goto("http://localhost:3000/");
Expand Down

0 comments on commit fbed02d

Please sign in to comment.