Skip to content

Commit 4603b4f

Browse files
committed
Formatting and data changes
Signed-off-by: mrrajan <[email protected].>
1 parent 6bdf38a commit 4603b4f

File tree

7 files changed

+76
-123
lines changed

7 files changed

+76
-123
lines changed

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"!**/dist",
4141
"!**/node_modules",
4242
"!client/coverage",
43-
"!client/src/app/client"
43+
"!client/src/app/client",
44+
"!**/examples_sbom.json"
4445
]
4546
}
4647
}

e2e/tests/common/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ export const SBOM_FILES = [
6161
"rhel-9.2-eus.spdx.json.bz2",
6262
"spdx-ancestor-of-example.json.bz2",
6363
"example_container_index.json.bz2",
64-
"quarkus-bom-3.8.3.redhat-00003.json.bz2",
65-
"exhort_mvn.json.bz2",
66-
"examples.json",
6764
];
6865

6966
export const ADVISORY_FILES = [

e2e/tests/ui/features/@sbom-scan/scan-sbom.feature

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Scenario: Generate Vulnerability Report For SBOM without any vulnerabilities
2222
Then Application navigates to Generate Vulnerability Report screen
2323
Examples:
2424
| fileName | filePath |
25-
| example_product_quarkus.json | /tests/common/assets/sbom/ |
25+
| example_product_quarkus.json.bz2 | /tests/common/assets/sbom/ |
2626
| ubi9-minimal-9.3-1361.json.bz2 | /tests/common/assets/sbom/ |
2727

2828
Scenario: Cancel Generate vulnerability report
@@ -41,7 +41,7 @@ Scenario: Generate Vulnerability Report for supported SBOM file extensions
4141
Then On the successful report generation the Application should render Vulnerability Report for the SBOM
4242
Examples:
4343
| fileName | filePath |
44-
| examples.json | /tests/common/assets/sbom/ |
44+
| examples_sbom.json | /tests/common/assets/sbom/ |
4545
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ |
4646

4747
Scenario: Verify Generate Vulnerability Report Screen
@@ -70,8 +70,8 @@ Scenario: Verify Vulnerabilities on Generate Vulnerability Report for an SBOM
7070
Then The Vulnerabilities on the Vulnerability ID column should match with "<Vulnerabilities>"
7171
Examples:
7272
| fileName | filePath | Vulnerabilities |
73-
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2024-40094,CVE-2022-46337,CVE-2024-21742,CVE-2024-30171,CVE-2024-31141,CVE-2024-10039,CVE-2024-4028,CVE-2024-7260,CVE-2024-7318,CVE-2023-3635,CVE-2023-3635,CVE-2024-29025,CVE-2024-47535,CVE-2025-25193,CVE-2024-7254,CVE-2024-2700,CVE-2024-12397,CVE-2025-1634 |
74-
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2020-8908,CVE-2023-2976,CVE-2023-22102,CVE-2024-47554,CVE-2023-1428,CVE-2023-32731,CVE-2023-32732,CVE-2024-21742,CVE-2022-45787,CVE-2023-31582,CVE-2024-30171,CVE-2023-0105,CVE-2023-1664,CVE-2023-6927,CVE-2024-10039,CVE-2024-4028,CVE-2024-7260,CVE-2024-7318,CVE-2024-7254,CVE-2024-29025,CVE-2024-47535,CVE-2025-25193,CVE-2023-34462,CVE-2023-4586,CVE-2023-0481,CVE-2023-6267,CVE-2024-1726,CVE-2023-2974,CVE-2024-2700,CVE-2023-1584,CVE-2023-5675,CVE-2025-1634,CVE-2023-4853,CVE-2023-34453,CVE-2023-34454,CVE-2023-34455,CVE-2023-43642,CVE-2024-1300,CVE-2023-24815 |
73+
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2024-2700,CVE-2024-29025,CVE-2025-48924,CVE-2025-49574,CVE-2025-55163 |
74+
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2022-45787,CVE-2023-0481,CVE-2023-1584,CVE-2023-4853,CVE-2024-2700,CVE-2024-29025,CVE-2025-48924,CVE-2025-48988,CVE-2025-48989,CVE-2025-49128,CVE-2025-49574,CVE-2025-52520,CVE-2025-53506,CVE-2025-55163,CVE-2025-55668 |
7575

7676
Scenario: Verify Vulnerability Details on Generate Vulnerability Report for an SBOM
7777
Given User Navigated to Generate Vulnerability Report screen
@@ -113,32 +113,13 @@ Scenario: Verify Affected package list on Generate Vulnerability Report for an S
113113
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2024-29025 | maven | io.netty | netty-codec-http | 4.1.107.Final-redhat-00001| |repository_url=https://maven.repository.redhat.com/ga/,type=jar |
114114
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-0481 | maven | io.quarkus.resteasy.reactive | resteasy-reactive-common | 2.13.7.Final | | |
115115

116-
Scenario: Verify Filtering on Generate Vulnerability Report for an SBOM
117-
Given User Navigated to Generate Vulnerability Report screen
118-
When User Clicks on Browse files Button
119-
When User Selects SBOM "<fileName>" from "<filePath>" on the file explorer dialog window
120-
Then On the successful report generation the Application should render Vulnerability Report for the SBOM
121-
When User clicks on Clear filters option
122-
When User Applies "<filter>" filter with "<value>" on the Vulnerability Report
123-
Then Applied "<filter>" should be visible with "<value>" on the filter bar
124-
Then The Vulnerabilities on the Vulnerability ID column should match with "<Vulnerabilities>"
125-
When User Applies "Vulnerability ID" filter with "<Vulnerability>" on the Vulnerability Report
126-
When User Enters "<Vulnerability>" in the Vulnerability ID Textbox
127-
Then The "Severity" of the "<Vulnerability>" should match with "<severity:importer>"
128-
Examples:
129-
| fileName | filePath | filter | value | Vulnerabilities | Vulnerability | severity:importer |
130-
| examples.json | /tests/common/assets/sbom/ | Severity | Medium | CVE-2024-47535,CVE-2025-25913 | CVE-2025-25913 | Medium(5.5): Unknown |
131-
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | Severity | Low | CVE-2020-8908,CVE-2023-0481,CVE-2024-4028 | CVE-2023-0481 | Medium(5.3): Unknown,Low(3.3): Unknown,Medium(5.3): Unknown|
132-
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | Severity | High |CVE-2024-2700,CVE-2024-7254,CVE-2024-10039,CVE-2024-12397,CVE-2024-40094,CVE-2025-1634 | CVE-2024-2700 | High(7): Unknown,High(7): Unknown |
133-
134-
135116
Scenario: Verify Actions on Generate Vulnerability Report for an SBOM
136117
Given User Navigated to Generate Vulnerability Report screen
137118
When User Clicks on Browse files Button
138119
When User Selects SBOM "<fileName>" from "<filePath>" on the file explorer dialog window
139120
When User Clicks on "Actions" button
140-
Then The "Actions" dropdown should have options "Generate new report" and "Download CSV"
141-
When User Clicks on "Generate new report" option from the "Actions" dropdown
121+
Then The Actions dropdown should have options "Generate new report" and "Download CSV"
122+
When User Clicks on "Generate new report" option from the Actions dropdown
142123
Then Application navigates to Generate Vulnerability Report screen
143124
Examples:
144125
| fileName | filePath |
@@ -151,8 +132,8 @@ Scenario: Verify Download CSV on Generate Vulnerability Report for an SBOM
151132
When User Clicks on Browse files Button
152133
When User Selects SBOM "<fileName>" from "<filePath>" on the file explorer dialog window
153134
When User Clicks on "Actions" button
154-
Then The "Actions" dropdown should have options "Generate new report" and "Download CSV"
155-
When User Downloads CSV with default filename "<fileName>" by clicking on "Download CSV" option
135+
Then The Actions dropdown should have options "Generate new report" and "Download CSV"
136+
Then User Downloads CSV with default filename "<fileName>" by clicking on "Download CSV" option
156137
Examples:
157138
| fileName | filePath |
158139
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ |
@@ -169,8 +150,8 @@ Scenario: Verify Download and Leave on Generate Vulnerability Report for an SBOM
169150
Then Application navigates to Vulnerability Explorer screen of "<Vulnerability>"
170151
Examples:
171152
| fileName | filePath | Vulnerability |
172-
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-25193 |
173-
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-4586 |
153+
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-48924 |
154+
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-1584 |
174155

175156
Scenario: Verify Leave without Downloading on Generate Vulnerability Report for an SBOM
176157
Given User Navigated to Generate Vulnerability Report screen
@@ -183,8 +164,8 @@ Scenario: Verify Leave without Downloading on Generate Vulnerability Report for
183164
Then Application navigates to Vulnerability Explorer screen of "<Vulnerability>"
184165
Examples:
185166
| fileName | filePath | Vulnerability |
186-
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-25193 |
187-
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-4586 |
167+
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-48924 |
168+
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-1584 |
188169

189170
Scenario: Verify Cancel on Leave Vulnerability Report modal window
190171
Given User Navigated to Generate Vulnerability Report screen
@@ -197,8 +178,26 @@ Scenario: Verify Cancel on Leave Vulnerability Report modal window
197178
Then Application should remain on the Generate Vulnerability Report screen
198179
Examples:
199180
| fileName | filePath | Vulnerability |
200-
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-25193 |
201-
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-4586 |
181+
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | CVE-2025-48924 |
182+
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | CVE-2023-1584 |
183+
184+
Scenario: Verify Filtering on Generate Vulnerability Report for an SBOM
185+
Given User Navigated to Generate Vulnerability Report screen
186+
When User Clicks on Browse files Button
187+
When User Selects SBOM "<fileName>" from "<filePath>" on the file explorer dialog window
188+
Then On the successful report generation the Application should render Vulnerability Report for the SBOM
189+
When User clicks on Clear filters option
190+
When User Applies "<filter>" filter with "<value>" on the Vulnerability Report
191+
Then Applied "<filter>" should be visible with "<value>" on the filter bar
192+
Then The Vulnerabilities on the Vulnerability ID column should match with "<Vulnerabilities>"
193+
When User Applies "Vulnerability ID" filter with "<Vulnerability>" on the Vulnerability Report
194+
When User Enters "<Vulnerability>" in the Vulnerability ID Textbox
195+
Then The "Severity" of the "<Vulnerability>" should match with "<severity:importer>"
196+
Examples:
197+
| fileName | filePath | filter | value | Vulnerabilities | Vulnerability | severity:importer |
198+
| examples_sbom.json | /tests/common/assets/sbom/ | Severity | Medium | CVE-2025-48795,CVE-2025-48924 | CVE-2025-48924 | Medium(6.5): Unknown |
199+
| exhort_mvn.json.bz2 | /tests/common/assets/sbom/ | Severity | Medium |CVE-2022-45787,CVE-2023-0481,CVE-2024-29025,CVE-2025-48924,CVE-2025-49128,CVE-2025-49574,CVE-2025-55668 | CVE-2023-0481 | Medium(5.3): Unknown,Low(3.3): Unknown,Medium(5.3): Unknown|
200+
| quarkus-bom-3.8.3.redhat-00003.json.bz2 | /tests/common/assets/sbom/ | Severity | High | CVE-2024-2700,CVE-2025-55163 | CVE-2024-2700 | High(7): Unknown |
202201

203202
Scenario: Verify Pagination on Generate Vulnerability Report for an SBOM
204203
Given User Navigated to Generate Vulnerability Report screen

e2e/tests/ui/features/@sbom-scan/scan-sbom.step.ts

Lines changed: 38 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ Then(
177177
Then(
178178
"The Vulnerabilities on the Vulnerability ID column should match with {string}",
179179
async ({ page }, vulnerabilitiesCsv: string) => {
180-
const scanPage = await SbomScanPage.build(page);
181180
const parentElem = `xpath=//div[@id="vulnerability-table-pagination-top"]`;
182181
const toolbarTable = new ToolbarTable(page, "Vulnerability table");
183182
await toolbarTable.selectPerPage(parentElem, "100 per page");
@@ -213,10 +212,6 @@ Then(
213212
await collectPage();
214213
}
215214

216-
// Use the reusable method to verify expected IDs against collected IDs
217-
// Create a temporary page locator to hold the collected IDs for verification
218-
const allCollectedIdsAsCsv = collectedIds.join(",");
219-
220215
// Verify each expected ID is present at least once
221216
for (const id of expectedIds) {
222217
await expect
@@ -287,12 +282,11 @@ Then(
287282
const cell = row.locator('td[data-label="Severity"]');
288283

289284
// Use the reusable helper for comma-delimited severity values
290-
const result = await verifyCommaDelimitedValues(
285+
await verifyCommaDelimitedValues(
291286
cell,
292287
expected,
293288
'xpath=//ul[@aria-label="Label group category"]//li',
294289
);
295-
console.log("debug cellText:", result);
296290
},
297291
);
298292

@@ -336,94 +330,74 @@ Then(
336330
"The {string} column of the {string} affected package should match with {string}",
337331
async ({ page }, column: string, vulnerability: string, expected: string) => {
338332
const scanPage = await SbomScanPage.build(page);
333+
const vulnerabilityRow = scanPage.getVulnerabilityRow(vulnerability);
334+
const packageTable = vulnerabilityRow.locator(
335+
`xpath=/following-sibling::tr[contains(@class,'expandable')]/td[@data-label='Affected packages']//table`,
336+
);
337+
await expect(packageTable).toBeVisible();
339338

340-
// Find the nested grid by looking for a grid that has "Type" as a columnheader
341-
// (only the nested affected packages grid has this, not the main vulnerability table)
342-
const nestedGrid = page
343-
.locator("role=grid")
344-
.filter({ has: page.locator('role=columnheader[name="Type"]') });
345-
346-
// Dynamically find the column index from the headers
347-
const headerRow = nestedGrid
348-
.locator("role=rowgroup")
349-
.first()
350-
.locator("role=row");
351-
const headers = headerRow.locator("role=columnheader");
352-
const headerCount = await headers.count();
353-
339+
const headerElements = packageTable.locator(`xpath=//th`);
340+
const headerElemCount = await headerElements.count();
354341
let columnIndex = -1;
355-
for (let i = 0; i < headerCount; i++) {
356-
const headerText = await headers.nth(i).textContent();
342+
for (let i = 0; i < headerElemCount; i++) {
343+
const headerText = await headerElements.nth(i).textContent();
357344
if (headerText?.trim() === column) {
358345
columnIndex = i;
359346
break;
360347
}
361348
}
362-
363349
if (columnIndex === -1) {
364350
throw new Error(
365351
`Column "${column}" not found in affected packages table`,
366352
);
367353
}
368354

369-
// Get the first data row from the nested grid's body
370-
const dataRow = nestedGrid
371-
.locator("role=rowgroup")
372-
.last()
373-
.locator("role=row")
374-
.first();
375-
376-
// Get the cell at the column index
377-
const cell = dataRow.locator("role=gridcell").nth(columnIndex);
378-
379-
// Special handling for Qualifiers column - qualifiers are rendered as separate elements
380-
if (column === "Qualifiers") {
381-
// Use the reusable helper for comma-delimited values
382-
await verifyCommaDelimitedValues(cell, expected, "xpath=//td/span");
383-
} else {
384-
// For other columns, check if expected is empty string (for empty columns)
385-
if (expected === "") {
386-
const cellText = await cell.textContent();
387-
await expect(cellText?.trim() || "").toBe("");
355+
const rows = packageTable.locator(`xpath=//tbody/tr`);
356+
const rowCount = await rows.count();
357+
for (let i = 1; i <= rowCount; i++) {
358+
const cell = packageTable.locator(
359+
`xpath=//tbody/tr[${i}]//td[${columnIndex + 1}]`,
360+
);
361+
if (column === "Qualifiers") {
362+
await verifyCommaDelimitedValues(cell, expected, "xpath=//span");
388363
} else {
389-
await expect(cell).toContainText(expected);
364+
if (expected === "") {
365+
const cellText = await cell.textContent();
366+
await expect(cellText?.trim() || "").toBe("");
367+
} else {
368+
await expect(cell).toContainText(expected);
369+
}
390370
}
391371
}
392372
},
393373
);
394374

395375
Then(
396-
"The {string} dropdown should have options {string} and {string}",
397-
async ({ page }, dropdownName: string, option1: string, option2: string) => {
376+
"The Actions dropdown should have options {string} and {string}",
377+
async ({ page }, option1: string, option2: string) => {
398378
// The dropdown should already be open from the previous step
399379
await expect(page.getByRole("menuitem", { name: option1 })).toBeVisible();
400380
await expect(page.getByRole("menuitem", { name: option2 })).toBeVisible();
401381
},
402382
);
403383

404384
When(
405-
"User Clicks on {string} option from the {string} dropdown",
406-
async ({ page }, optionName: string, dropdownName: string) => {
385+
"User Clicks on {string} option from the Actions dropdown",
386+
async ({ page }, optionName: string) => {
407387
// Just click for non-download actions
408388
await page.getByRole("menuitem", { name: optionName }).click();
409389
},
410390
);
411391

412-
When(
392+
Then(
413393
"User Downloads CSV with default filename {string} by clicking on {string} option",
414-
async (
415-
{ page },
416-
fileName: string,
417-
optionName: string,
418-
dropdownName: string,
419-
) => {
394+
async ({ page }, fileName: string, optionName: string) => {
420395
// Use the reusable helper for click + download verification
421-
await clickAndVerifyDownload(
422-
page,
423-
() => page.getByRole("menuitem", { name: optionName }).click(),
424-
".csv",
425-
fileName,
396+
const downloadedFileName = await clickAndVerifyDownload(page, () =>
397+
page.getByRole("menuitem", { name: optionName }).click(),
426398
);
399+
await expect(downloadedFileName).toContain(fileName);
400+
await expect(downloadedFileName.endsWith(".csv")).toBeTruthy();
427401
},
428402
);
429403

@@ -453,12 +427,11 @@ When(
453427
async ({ page }, fileName: string, buttonName: string) => {
454428
const modal = page.locator('[role="dialog"]');
455429
// Use the reusable helper for click + download verification
456-
await clickAndVerifyDownload(
457-
page,
458-
() => modal.getByRole("button", { name: buttonName }).click(),
459-
".csv",
460-
fileName,
430+
const downloadedFileName = await clickAndVerifyDownload(page, () =>
431+
modal.getByRole("button", { name: buttonName }).click(),
461432
);
433+
await expect(downloadedFileName).toContain(fileName);
434+
await expect(downloadedFileName.endsWith(".csv")).toBeTruthy();
462435
},
463436
);
464437

0 commit comments

Comments
 (0)