From f8ea1df7af9d565f27fe13f23767ffac1c6e7a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Gr=C3=B8tan=20Gregusson?= Date: Thu, 25 Apr 2024 15:41:14 +0200 Subject: [PATCH] fix(frontend): :bug: Fix testids --- frontend/playwright.config.ts | 2 +- .../src/components/satelliteData/SatelliteStatsTableRow.tsx | 1 + frontend/tests/e2e/blog.mobile.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 9b76a64..964c295 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -10,7 +10,7 @@ import { defineConfig, devices } from "@playwright/test"; * See https://playwright.dev/docs/test-configuration. */ //const baseURL = `http://localhost:3000/`; -const baseURL = `http://web.hypso.ies.ntnu.no:3000/`; +const baseURL = `https://hypso.space/`; export default defineConfig({ testDir: "./tests/e2e", diff --git a/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx b/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx index 986c6f6..8c6d4b7 100644 --- a/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx +++ b/frontend/src/components/satelliteData/SatelliteStatsTableRow.tsx @@ -64,6 +64,7 @@ export default function SatelliteStatsTableRow({ setSelectedSatellite(satName); handleRowClick(); }} + data-testid="satellitesTableRow" > {satName} diff --git a/frontend/tests/e2e/blog.mobile.spec.ts b/frontend/tests/e2e/blog.mobile.spec.ts index 6cb4e3e..3abc46e 100644 --- a/frontend/tests/e2e/blog.mobile.spec.ts +++ b/frontend/tests/e2e/blog.mobile.spec.ts @@ -13,8 +13,8 @@ test.describe("Blogs pages test", () => { 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.getByTestId("articleTag").first()).toHaveText("Satellites"); + await page.getByTestId("blogCardLink").first().click(); await expect(page).toHaveURL(/\/blog\/.+$/); }); test("individualBlogPagetest", async ({ page }) => {