-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): ✅ fix blog end2end test to only acces… (#355)
* fix(frontend): ✅ fix blog end2end test to only access first element * refactor(ide): ♻️ move project en2end test into end2end folder * test(frontend): ✅ add satellite end2end test * style(frontend): 🚨 run prettier
- Loading branch information
Mats
authored and
GitHub
committed
Apr 22, 2024
1 parent
831f6ef
commit 6b7a2aa
Showing
6 changed files
with
85 additions
and
2 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,2 @@ | ||
| import SatelliteSelector from "@/components/homeComponents/SatelliteSelector"; | ||
| import { test, expect } from "@playwright/experimental-ct-react"; |
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
File renamed without changes.
File renamed without changes.
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,34 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.describe("All Satellites Page Test", () => { | ||
| test("CheckHeadingAndSubtitleIsVisible", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await expect(page).toHaveURL("/satellites"); | ||
| await expect(page.getByTestId("pageHeader")).toBeVisible(); | ||
| await expect(page.getByTestId("pageSubtitle")).toBeVisible(); | ||
| }); | ||
| test("CheckIfCardIsClickable", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await expect(page).toHaveURL("/satellites"); | ||
| await expect( | ||
| page.getByTestId("satellitesTableRow").first(), | ||
| ).toBeVisible(); | ||
| await page.getByTestId("satellitesTableRow").first().click(); | ||
| //Checks if the URL matches /satellites/anySlug | ||
| await expect(page).toHaveURL(/\/satellites\/.+$/); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe("Individual Satellite Page Test", () => { | ||
| test("TestHeadingAndParagraphIsVisible", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await page.getByTestId("satellitesTableRow").first().click(); | ||
| await expect(page).toHaveURL(/\/satellites\/.+$/); | ||
| await expect(page.getByRole("heading").first()).toBeVisible(); | ||
| await expect(page.getByRole("heading").nth(2)).toBeVisible(); | ||
| await expect(page.getByTestId("blockParagraph").first()).toBeVisible(); | ||
| }); | ||
| }); |
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,45 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.describe("All Satellites Page Test", () => { | ||
| test.use({ | ||
| viewport: { width: 390, height: 844 }, | ||
| }); | ||
|
|
||
| test("CheckHeadingAndSubtitleIsVisible", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("navigation").getByRole("button").click(); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await expect(page).toHaveURL("/satellites"); | ||
| await expect(page.getByTestId("pageHeader")).toBeVisible(); | ||
| await expect(page.getByTestId("pageSubtitle")).toBeVisible(); | ||
| }); | ||
| test("CheckIfCardIsClickable", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("navigation").getByRole("button").click(); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await expect(page).toHaveURL("/satellites"); | ||
| await expect( | ||
| page.getByTestId("satellitesTableRow").first(), | ||
| ).toBeVisible(); | ||
| await page.getByTestId("satellitesTableRow").first().click(); | ||
| //Checks if the URL matches /satellites/anySlug | ||
| await expect(page).toHaveURL(/\/satellites\/.+$/); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe("Individual Satellite Page Test", () => { | ||
| test.use({ | ||
| viewport: { width: 390, height: 844 }, | ||
| }); | ||
|
|
||
| test("TestHeadingAndParagraphIsVisible", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("navigation").getByRole("button").click(); | ||
| await page.getByRole("button", { name: "Satellites" }).click(); | ||
| await page.getByTestId("satellitesTableRow").first().click(); | ||
| await expect(page).toHaveURL(/\/satellites\/.+$/); | ||
| await expect(page.getByRole("heading").first()).toBeVisible(); | ||
| await expect(page.getByRole("heading").nth(2)).toBeVisible(); | ||
| await expect(page.getByTestId("blockParagraph").first()).toBeVisible(); | ||
| }); | ||
| }); |