Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit 338ad8c

Browse files
committed
Added advisory type filtering for locator
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
1 parent a4ec7b5 commit 338ad8c

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed

tests/ui/features/@advisory-explorer/advisory-explorer.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Feature: Advisory Explorer
44

55
# Advisory Vulnerabilities
66
Scenario: Display vulnerabilities tied to a single advisory
7-
Given User visits Advisory details Page of "<advisoryName>"
8-
Then User navigates to the Vulnerabilites tab on the Advisory Overview page
7+
Given User visits Advisory details Page of "<advisoryName>" with type "<advisoryType>"
8+
Then User navigates to the Vulnerabilities tab on the Advisory Overview page
99
Then Pagination of Vulnerabilities list works
1010
Then A list of all active vulnerabilites tied to the advisory should display
1111
And The "ID, Title, Discovery, Release, Score, CWE" information should be visible for each vulnerability
1212
And The vulnerabilities should be sorted by ID by default
1313
And User visits Vulnerability details Page of "<vulnerabilityID>" by clicking it
1414

1515
Examples:
16-
| advisoryName | vulnerabilityID |
17-
| CVE-2023-3223 | CVE-2023-3223 |
16+
| advisoryName | vulnerabilityID | advisoryType |
17+
| CVE-2023-3223 | CVE-2023-3223 | csaf |
1818

tests/ui/features/@advisory-explorer/advisory-explorer.step.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ export const { Given, When, Then } = createBdd();
88
const VULN_TABLE_NAME = "vulnerability table";
99

1010
Given(
11-
"User visits Advisory details Page of {string}",
12-
async ({ page }, advisoryName) => {
11+
"User visits Advisory details Page of {string} with type {string}",
12+
async ({ page }, advisoryName, advisoryType) => {
1313
const searchPage = new SearchPage(page, "Advisories");
1414
await searchPage.dedicatedSearch(advisoryName);
15-
await page.getByRole("link", { name: advisoryName }).click();
15+
const advisory = `xpath=//tr[contains(.,'${advisoryName}') and contains(.,'${advisoryType}')]/td/a`;
16+
await page.locator(advisory).click();
1617
}
1718
);
1819

1920
Then(
20-
"User navigates to the Vulnerabilites tab on the Advisory Overview page",
21+
"User navigates to the Vulnerabilities tab on the Advisory Overview page",
2122
async ({ page }) => {
2223
await page.getByRole("tab", { name: "Vulnerabilities" }).click();
2324
}
@@ -52,7 +53,9 @@ Then(
5253
Then(
5354
"The {string} information should be visible for each vulnerability",
5455
async ({ page }, headers) => {
55-
const headersArr = headers.split(`,`).map((column) => column.trim());
56+
const headersArr = headers
57+
.split(`,`)
58+
.map((column: String) => column.trim());
5659
for (const label of headersArr) {
5760
const header = page.getByRole("columnheader", { name: label });
5861
if (await header.count()) {

tests/ui/features/@sbom-explorer/sbom-explorer.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Feature: SBOM Explorer - View SBOM details
7676
Then List of related Vulnerabilities should be sorted by "Id" in ascending order
7777

7878
Examples:
79-
| sbomName |
79+
| sbomName |
8080
| quarkus-bom |
8181

8282
@slow
@@ -86,7 +86,7 @@ Feature: SBOM Explorer - View SBOM details
8686
When User selects the Tab "Vulnerabilities"
8787
Then Pagination of Vulnerabilities list works
8888
Examples:
89-
| sbomName |
89+
| sbomName |
9090
| quarkus-bom |
9191

9292
@slow
@@ -96,7 +96,7 @@ Feature: SBOM Explorer - View SBOM details
9696
When User selects the Tab "Packages"
9797
Then Pagination of Packages list works
9898
Examples:
99-
| sbomName |
99+
| sbomName |
100100
| ubi9-minimal-container |
101101

102102
Scenario Outline: Check Column Headers of SBOM Explorer Vulnerabilities table
@@ -110,7 +110,7 @@ Feature: SBOM Explorer - View SBOM details
110110
Then List of Vulnerabilities has column "Published"
111111
Then List of Vulnerabilities has column "Updated"
112112
Examples:
113-
| sbomName |
113+
| sbomName |
114114
| quarkus-bom |
115115

116116
@slow
@@ -123,15 +123,15 @@ Feature: SBOM Explorer - View SBOM details
123123
#Then Sorting of "CVSS" Columns works
124124
# Bug: https://issues.redhat.com/browse/TC-2598
125125
Examples:
126-
| sbomName |
126+
| sbomName |
127127
| quarkus-bom |
128128

129129
Scenario Outline: Add Labels to SBOM from SBOM List Page
130130
Given An ingested SBOM "<sbomName>" is available
131131
When User Adds Labels "<Labels>" to "<sbomName>" SBOM from List Page
132132
Then The Label list "<Labels>" added to the SBOM "<sbomName>" on List Page
133133
Examples:
134-
| sbomName | Labels |
134+
| sbomName | Labels |
135135
| quarkus-bom | RANDOM_LABELS |
136136

137137
Scenario Outline: Add Labels to SBOM from SBOM Explorer Page
@@ -140,5 +140,5 @@ Feature: SBOM Explorer - View SBOM details
140140
When User Adds Labels "<Labels>" to "<sbomName>" SBOM from Explorer Page
141141
Then The Label list "<Labels>" added to the SBOM "<sbomName>" on Explorer Page
142142
Examples:
143-
| sbomName | Labels |
143+
| sbomName | Labels |
144144
| ubi9-minimal-container | RANDOM_LABELS |

tests/ui/features/@vulnerability-explorer/vulnerability-explorer.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ Feature: Vulnerability Explorer - View Vulnerability details
5757
And The "ID, Title, Type, Revision, Vulnerabilities" information should be visible for each advisory
5858
And The advisories should be sorted by "<columnName>"
5959
Then User searches for "<advisoryID>"
60-
Then User visits Advisory details Page of "<advisoryID>"
60+
Then User visits Advisory details Page of "<advisoryID>" with type "<advisoryType>"
6161
Then The page title is "<advisoryID>"
6262

6363
Examples:
64-
| vulnerabilityID | advisoryID | columnName |
65-
| CVE-2023-1664| CVE-2023-1664 | ID |
64+
| vulnerabilityID | columnName | advisoryID | advisoryType |
65+
| CVE-2023-1664 | ID | CVE-2023-1664 | csaf |

tests/ui/features/@vulnerability-explorer/vulnerability-explorer.step.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ Then(
136136
Then(
137137
"The {string} information should be visible for each advisory",
138138
async ({ page }, columnHeaders) => {
139-
const headers = columnHeaders.split(`,`).map((column) => column.trim());
139+
const headers = columnHeaders
140+
.split(`,`)
141+
.map((column: String) => column.trim());
140142

141143
for (const header of headers) {
142144
console.log(`Checking visibility of column header: ${header}`);
@@ -164,9 +166,9 @@ Then("User searches for {string}", async ({ page }, advisoryID) => {
164166
});
165167

166168
Then(
167-
"User visits Advisory details Page of {string}",
168-
async ({ page }, advisoryID) => {
169-
const link = page.getByRole("link", { name: advisoryID });
170-
await link.click();
169+
"User visits Advisory details Page of {string} with type {string}",
170+
async ({ page }, advisoryID, advisoryType) => {
171+
const advisory = `xpath=//tr[contains(.,'${advisoryID}') and contains(.,'${advisoryType}')]/td/a`;
172+
await page.locator(advisory).click();
171173
}
172174
);

0 commit comments

Comments
 (0)