Skip to content

Commit

Permalink
fix integrationtests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Junk committed Nov 24, 2023
1 parent 98707ae commit 93186c5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 85 deletions.
140 changes: 70 additions & 70 deletions tests/general_re-hi_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,106 +11,106 @@
// This part tests the general info revision history collapsible section

import { expect, test } from "@playwright/test";
import { readFileSync } from "fs";


test('general collapsible content Revision history', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await expect(page.getByRole('heading', { name: ' Revision history' })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await expect(page.getByRole("heading", { name: " Revision history" })).toBeVisible();
});

test('general collapsible content Revision history function', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history function", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('heading', { name: ' Revision history' })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("heading", { name: " Revision history" })).toBeVisible();
});

test('general collapsible content Revision history table', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history table", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');

await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.locator('.subsection > .collapsible > .body')).toBeVisible()
});
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.locator(".subsection > .collapsible > .collapsible-body")).toBeVisible();
});

test('general collapsible content Revision history Date Cell', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Date Cell", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: 'Date', exact: true })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "Date", exact: true })).toBeVisible();
});

test('general collapsible content Revision history Date cell value', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Date cell value", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: '2022-03-17T13:03:42.105Z' }).nth(2)).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "2022-03-17T13:03:42.105Z" }).nth(2)).toBeVisible();
});

test('general collapsible content Revision history Number Cell', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Number Cell", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: 'Number' })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "Number" })).toBeVisible();
});

test('general collapsible content Revision history Number cell value', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Number cell value", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');

await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: '1', exact: true }).nth(1)).toBeVisible()
});
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "1", exact: true }).nth(1)).toBeVisible();
});

test('general collapsible content Revision history Summary Cell', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Summary Cell", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: 'Summary' })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "Summary" })).toBeVisible();
});

test('general collapsible content Revision history Summary cell value', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Summary cell value", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');

await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: 'Initial revision' })).toBeVisible()
});
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "Initial revision" })).toBeVisible();
});

test('general collapsible content Revision history Legacy version cell', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Legacy version cell", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');
await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('cell', { name: 'Legacy_version' })).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(page.getByRole("cell", { name: "Legacy_version" })).toBeVisible();
});

test('general collapsible content Revision history Legacy version value', async ({ page }) => {
await page.goto('/');
test("general collapsible content Revision history Legacy version value", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles('./docs/bsi-2022-0001.json');

await page.getByRole('heading', { name: ' Revision history' }).click();
await expect(page.getByRole('row', { name: '2022-03-17T13:03:42.105Z 1 Initial revision' }).getByRole('cell').nth(3)).toBeVisible()
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Revision history" }).click();
await expect(
page
.getByRole("row", { name: "2022-03-17T13:03:42.105Z 1 Initial revision" })
.getByRole("cell")
.nth(3)
).toBeVisible();
});
12 changes: 0 additions & 12 deletions tests/general_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ test("Test dropbox", async ({ page }) => {
expect(divTextContent).toContain('Displaying file "bsi-2022-0001.json".');
});

test("test select file button", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await expect(
page.getByRole("heading", {
name: "BSI-2022-0001: CVRF-CSAF-Converter: XML External Entities Vulnerability"
})
).toBeVisible();
});

test("general collapsible visibility", async ({ page }) => {
await page.goto("/");
await page.locator('input[type="file"]').click();
Expand Down
2 changes: 1 addition & 1 deletion tests/standard_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test("index page has expected version", async ({ page }) => {
var versionnr = process.env.npm_package_version;
var version = "v" + versionnr;
await page.goto("/");
await expect(page.getByRole("heading", { name: version })).toBeVisible();
await expect(page.getByText(version)).toBeVisible();
});

test("index page has file input", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/vulnerabilities_overview_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test("Vulnerabilities overview collapsible table", async ({ page }) => {
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: "Vulnerabilities overview" });
await expect(page.locator("div:nth-child(6) > .body").first()).toBeVisible();
await expect(page.locator(".collapsible-body").first()).toBeVisible();
});

test("Vulnerabilities overview collapsible table inner", async ({ page }) => {
Expand All @@ -45,7 +45,7 @@ test("Vulnerabilities overview collapsible table inner", async ({ page }) => {
await page.locator('input[type="file"]').setInputFiles("./docs/bsi-2022-0001.json");

await page.getByRole("heading", { name: " Vulnerabilities overview" });
await expect(page.locator(".body > .crosstable-overview")).toBeVisible();
await expect(page.locator(".collapsible-body > .crosstable-overview")).toBeVisible();
});

test("Vulnerabilities overview collapsible product cell", async ({ page }) => {
Expand Down

0 comments on commit 93186c5

Please sign in to comment.