Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,18 @@ Feature: Vulnerability Explorer - View Vulnerability details
# Related advisories
Scenario Outline: View related Advisories
Given User visits Vulnerability details Page of "<vulnerabilityID>"
Then Tab "Advisories" is visible
Then The page title is "<vulnerabilityID>"

Then User navigates to the Related Advisories tab on the Vulnerability Overview page
Then Pagination of Advisories list works
Then A list of all active Advisories tied to the Vulnerability should display
And The ID, Title, Type, Revision and Vulnerabilities information should be visible for each advisory
And The advisories should be sorted by "<columnName>"
Then User searches for "<advisoryID>"
Then User visits Advisory details Page of "<advisoryID>"
Then The page title is "<advisoryID>"

Examples:
| vulnerabilityID |
| CVE-2023-1664 |
| vulnerabilityID | advisoryID | columnName |
| CVE-2023-1664| CVE-2023-1664 | ID |
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const { Given, When, Then } = createBdd();

const SBOM_TABLE_NAME = "Sbom table";
const ADVISORY_TABLE_NAME = "Advisory table";
const COLUMN_LABELS = ["ID", "Title", "Type", "Revision", "Vulnerabilities"];

Given(
"User visits Vulnerability details Page of {string}",
Expand Down Expand Up @@ -126,41 +127,58 @@ Then(
);

// Advisories
Then(
"User navigates to the Related Advisories tab on the Vulnerability Overview page",
async ({ page }) => {
await page.getByRole("tab", { name: "Advisories" }).click();
}
);

Then("User selects the Tabs {string}", async ({ page }, tabName) => {
await page.getByText(tabName).click();
Then("Pagination of Advisories list works", async ({ page }) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
const advisoryTableTopPagination = `xpath=//div[@id="advisory-table-pagination-top"]`;
await toolbarTable.verifyPagination(advisoryTableTopPagination);
});

Then(
"The Advisory table is sorted by {string}",
async ({ page }, columnName) => {
"A list of all active Advisories tied to the Vulnerability should display",
async ({ page }) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyTableIsSortedBy(columnName);
await toolbarTable.verifyPaginationHasTotalResultsGreatherThan(0);
}
);

Then(
"The Advisory table total results is {int}",
async ({ page }, totalResults) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResults(totalResults);
"The ID, Title, Type, Revision and Vulnerabilities information should be visible for each advisory",
async ({ page }) => {
for (const label of COLUMN_LABELS) {
const header = page.getByRole("columnheader", { name: label });
if (await header.count()) {
await expect(header).toBeVisible();
} else {
await expect(page.getByRole("button", { name: label })).toBeVisible();
}
}
}
);

Then(
"The Advisory table total results is greather than {int}",
async ({ page }, totalResults) => {
"The advisories should be sorted by {string}",
async ({ page }, columnName) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResultsGreatherThan(
totalResults
);
await toolbarTable.verifyTableIsSortedBy(columnName);
}
);

Then("User searches for {string}", async ({ page }, advisoryID) => {
const searchPage = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await searchPage.filterByText(advisoryID);
});

Then(
"The {string} column of the Advisory table contains {string}",
async ({ page }, columnName, expectedValue) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyColumnContainsText(columnName, expectedValue);
"User visits Advisory details Page of {string}",
async ({ page }, advisoryID) => {
const link = page.getByRole("link", { name: advisoryID });
await link.click();
}
);
Loading