-
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.
275 create e2e test for blogs (#318)
* test(frontend): 🧪 Write test for project page Check if project page has title and subtitle. Add testids to elements in project page and individual project page. Check if individual project page has title and paragraph. * test(frontend): 🧪 Added failing mobile project test * test(frontend): ✅ Fixed mobile project test and added hamburger to close navbar * fix(frontend): 💄 change tests for mobile to handle new navbar functionality * test(frontend): ✅ Make test for blogs pages. Edit featured image mobile test to use correct viewport * test(frontend): 🔥 remove project tests as they are part of another issue * style(frontend): 🎨 prettier --------- Co-authored-by: Lucas Tran <lucastran1107@gmail.com> Co-authored-by: Jakob Grøtan Gregusson <jakobgg@stud.ntnu.no> Co-authored-by: Jakobgg1243 <Jakob.gregusson@gmail.com> Co-authored-by: Lucas Tran <lucastra@stud.ntnu.no>
- Loading branch information
5 people
authored and
GitHub
committed
Apr 18, 2024
1 parent
9ad653e
commit 2999ab8
Showing
11 changed files
with
97 additions
and
19 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.describe("Blogs pages test", () => { | ||
| test("blogsOverviewPageTest", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("button", { name: "Blog" }).click(); | ||
| await expect(page).toHaveURL("/blog"); | ||
| await expect(page.getByTestId("pageHeader")).toBeVisible(); | ||
| await expect(page.getByTestId("pageSubtitle")).toBeVisible(); | ||
| await page.getByTestId("blogsSatellitesButton").click(); | ||
| await expect(page).toHaveURL("/blog?page=1&tag=Satellites"); | ||
| await expect(page.getByTestId("articleTag")).toHaveText("Satellites"); | ||
| await page.getByTestId("blogCardLink").click(); | ||
| await expect(page).toHaveURL(/\/blog\/.+$/); | ||
| }); | ||
| test("individualBlogPagetest", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("button", { name: "Blog" }).click(); | ||
| await expect(page).toHaveURL("/blog"); | ||
| await page.getByTestId("blogCardLink").first().click(); | ||
| await expect(page).toHaveURL(/\/blog\/.+$/); | ||
| 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,29 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.describe("Blogs pages test", () => { | ||
| test.use({ | ||
| viewport: { width: 390, height: 844 }, | ||
| }); | ||
| test("blogsOverviewPageTest", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("navigation").getByRole("button").click(); | ||
| await page.getByRole("button", { name: "Blog" }).click(); | ||
| await expect(page).toHaveURL("/blog"); | ||
| await expect(page.getByTestId("pageHeader")).toBeVisible(); | ||
| await expect(page.getByTestId("pageSubtitle")).toBeVisible(); | ||
| await page.getByTestId("blogsSatellitesButton").click(); | ||
| await expect(page).toHaveURL("/blog?page=1&tag=Satellites"); | ||
| await expect(page.getByTestId("articleTag")).toHaveText("Satellites"); | ||
| await page.getByTestId("blogCardLink").click(); | ||
| await expect(page).toHaveURL(/\/blog\/.+$/); | ||
| }); | ||
| test("individualBlogPagetest", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await page.getByRole("navigation").getByRole("button").click(); | ||
| await page.getByRole("button", { name: "Blog" }).click(); | ||
| await expect(page).toHaveURL("/blog"); | ||
| await page.getByTestId("blogCardLink").first().click(); | ||
| await expect(page).toHaveURL(/\/blog\/.+$/); | ||
| 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 |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test("test", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await expect( | ||
| page.getByRole("img", { name: "Featured satellite image" }), | ||
| ).toBeVisible(); | ||
| await expect( | ||
| page.getByRole("heading", { name: "Featured Satellite Image" }), | ||
| ).toBeVisible(); | ||
| test.describe("Featured Image Test", () => { | ||
| test.use({ | ||
| viewport: { width: 390, height: 844 }, | ||
| }); | ||
| test("Featured Image Test", async ({ page }) => { | ||
| await page.goto("/"); | ||
| await expect( | ||
| page.getByRole("img", { name: "Featured satellite image" }), | ||
| ).toBeVisible(); | ||
| await expect( | ||
| page.getByRole("heading", { name: "Featured Satellite Image" }), | ||
| ).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
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