From 83a858b036f8f27ced54148f480923bed193f0d6 Mon Sep 17 00:00:00 2001 From: JanHoefelmeyer Date: Fri, 6 Oct 2023 10:13:12 +0200 Subject: [PATCH] FeedView basic E2E-tests --- tests/test.ts | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/tests/test.ts b/tests/test.ts index b9b3de4..15432f1 100644 --- a/tests/test.ts +++ b/tests/test.ts @@ -31,11 +31,6 @@ test("index page has URL Button", async ({ page }) => { await expect(page.getByRole('button', { name: ' URL' })).toBeVisible(); }); -test("index page has Switch to ROLIE-feed Button", async ({ page }) => { - await page.goto("/"); - await expect(page.getByRole('link', { name: 'Switch to ROLIE-feed' })).toBeVisible(); -}); - test("index page has textbox", async ({ page }) => { await page.goto("/"); await expect(page.locator('input[type="text"]')).toBeVisible(); @@ -48,6 +43,36 @@ test("index page has dropbox", async ({ page }) => { expect(divTextContent).toContain("Drop your CSAF-file here"); }); +test("index page has Switch to ROLIE-feed Button", async ({ page }) => { + await page.goto("/"); + await expect(page.getByRole('link', { name: 'Switch to ROLIE-feed' })).toBeVisible(); +}); + +test("index page Switch to ROLIE-feed Button works", async ({ page }) => { + await page.goto("/"); + await page.getByRole('link', { name: 'Switch to ROLIE-feed' }).click(); + await expect(page.getByRole('link', { name: 'Switch to Single View' })).toBeVisible(); +}); + +test("index page ROLIE feed version has View feed button", async ({ page }) => { + await page.goto("/"); + await page.getByRole('link', { name: 'Switch to ROLIE-feed' }).click(); + await expect(page.getByRole('button', { name: ' View feed' })).toBeVisible(); +}); + +test("index page ROLIE feed version has switch to single view button", async ({ page }) => { + await page.goto("/"); + await page.getByRole('link', { name: 'Switch to ROLIE-feed' }).click(); + await expect(page.getByRole('link', { name: 'Switch to single view' })).toBeVisible(); +}); + +test("index page ROLIE feed version has working switch to single view button", async ({ page }) => { + await page.goto("/"); + await page.getByRole('link', { name: 'Switch to ROLIE-feed' }).click(); + await page.getByRole('link', { name: 'Switch to single view' }).click(); + await expect(page.getByRole('link', { name: 'Switch to ROLIE-feed' })).toBeVisible(); +}); + test("Test dropbox", async ({ page }) => { await page.goto("/"); const buffer = readFileSync("./docs/bsi-2022-0001.json");