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

Commit 2147f41

Browse files
author
Rajan Ravi
committed
Fix summary panel count mismatch
Signed-off-by: Rajan Ravi <rravi@rravi-thinkpadp1gen4i.bengluru.csb>
1 parent ba681c7 commit 2147f41

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/ui/helpers/DetailsPage.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ export class DetailsPage {
6060
async verifyVulnerabilityPanelcount() {
6161
const pieVulnSevLabel = `xpath=//*[name()='svg']/*[name()='g']//*[name()='tspan']`;
6262
const totalVuln = `xpath=//*[name()='svg']/*[name()='text']//*[name()='tspan'][1]`;
63-
63+
const totalVulnElement = this.page.locator(totalVuln);
64+
await totalVulnElement.waitFor({ state: "visible", timeout: 5000 });
65+
const totalVulnPanel = await totalVulnElement.textContent();
6466
const panelVulnSev = await this.getCountFromLabels(pieVulnSevLabel, ":");
6567
const sumPanelVulnSev = await Object.values(panelVulnSev).reduce(
6668
(sum, value) => sum + value,
6769
0
6870
);
69-
const totalVulnPanel = await this.page.locator(totalVuln).textContent();
7071
const tableVulnSev = await this.getCVSSCountFromVulnTable();
7172
let mismatch = false;
7273
await expect(
@@ -77,7 +78,9 @@ export class DetailsPage {
7778
for (const severity in tableVulnSev) {
7879
if (panelVulnSev[severity] !== undefined) {
7980
if (panelVulnSev[severity] !== tableVulnSev[severity]) {
80-
console.log("{severity} count mismatch");
81+
console.log(
82+
`${severity} count mismatch. Summary panel count ${panelVulnSev[severity]}, Rows count ${tableVulnSev[severity]}`
83+
);
8184
mismatch = true;
8285
}
8386
}
@@ -141,7 +144,7 @@ export class DetailsPage {
141144
let cvssLocator = await this.page
142145
.locator(`xpath=//td[@data-label='CVSS']//div[.='${cvssType}']`)
143146
.all();
144-
counts[cvssType] = await cvssLocator.length;
147+
counts[cvssType] += await cvssLocator.length;
145148
}
146149
nextPage = await nextButton.isEnabled();
147150
if (nextPage) {

0 commit comments

Comments
 (0)