chore: Backport commits to release branch#933
chore: Backport commits to release branch#933mrrajan wants to merge 36 commits intoguacsec:release/0.4.zfrom
Conversation
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
…uacsec#879) Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
Reviewer's GuideBackported multiple Playwright BDD e2e enhancements to the release branch: refactors step definitions to use page objects and shared assertions, introduces reusable table/pagination/sorting steps, adds delete flows and SBOM/advisory/vulnerability correlation tests, and extends page objects and custom matchers to support these flows while normalizing feature files and navigation labels. Sequence diagram for SBOM delete flow using ConfirmDialog and DialogMatcherssequenceDiagram
actor Tester
participant SbomListPage
participant ConfirmDialog
participant DialogMatchers
Tester->>SbomListPage: openSbomList
Tester->>SbomListPage: selectSbomRow
Tester->>SbomListPage: triggerDeleteAction
SbomListPage-->>ConfirmDialog: show
ConfirmDialog->>DialogMatchers: verifyDialogVisible
DialogMatchers-->>ConfirmDialog: dialogIsVisible
Tester->>ConfirmDialog: confirmDeletion
ConfirmDialog->>DialogMatchers: verifyDialogClosed
DialogMatchers-->>ConfirmDialog: dialogIsClosed
SbomListPage-->>Tester: sbomRowRemovedFromTable
Class diagram for shared UI test infrastructure and page objectsclassDiagram
class DetailsPage {
}
class AdvisoryDetailsPage {
}
class PackageDetailsPage {
}
class SbomDetailsPage {
}
class VulnerabilityDetailsPage {
}
class VulnerabilitiesTab {
}
class SbomsTab {
}
class AdvisoriesTab {
}
class SbomListPage {
}
class VulnerabilityListPage {
}
class ConfirmDialog {
}
class DialogMatchers {
}
class AuthSteps {
}
class TableSteps {
}
class DetailsPageSteps {
}
class ListPageSteps {
}
DetailsPage <|-- AdvisoryDetailsPage
DetailsPage <|-- PackageDetailsPage
DetailsPage <|-- SbomDetailsPage
DetailsPage <|-- VulnerabilityDetailsPage
AdvisoryDetailsPage o-- VulnerabilitiesTab
PackageDetailsPage o-- SbomsTab
PackageDetailsPage o-- VulnerabilitiesTab
SbomDetailsPage o-- VulnerabilitiesTab
VulnerabilityDetailsPage o-- AdvisoriesTab
VulnerabilityDetailsPage o-- SbomsTab
SbomListPage o-- ConfirmDialog
VulnerabilityListPage o-- ConfirmDialog
DialogMatchers <.. ConfirmDialog
AuthSteps <.. AdvisoryDetailsPage
AuthSteps <.. PackageDetailsPage
AuthSteps <.. SbomDetailsPage
AuthSteps <.. VulnerabilityDetailsPage
TableSteps <.. SbomListPage
TableSteps <.. VulnerabilityListPage
DetailsPageSteps <.. AdvisoryDetailsPage
DetailsPageSteps <.. PackageDetailsPage
DetailsPageSteps <.. SbomDetailsPage
DetailsPageSteps <.. VulnerabilityDetailsPage
ListPageSteps <.. SbomListPage
ListPageSteps <.. VulnerabilityListPage
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- In
e2e/tests/ui/features/sbom-explorer.featurethe stepThen Pagination of "vulnerabilities" list worksno longer matches the new generic step definitionPagination of {string} table worksand also uses a different table name format than the rest ("vulnerabilities" vs "Vulnerability"), which is likely to cause an undefined or mis-targeted step; consider aligning this toThen Pagination of "Vulnerability" table works(or adjust the step definition accordingly). - The step
Given User visits Vulnerability details Page of {string}is now defined both in@vulnerability-explorer/vulnerability-explorer.step.tsand@sbom-explorer/sbom-explorer.step.ts, which can cause ambiguous step resolution in Playwright BDD; it would be safer to centralize this shared step in a single file (or give one of them a distinct pattern).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `e2e/tests/ui/features/sbom-explorer.feature` the step `Then Pagination of "vulnerabilities" list works` no longer matches the new generic step definition `Pagination of {string} table works` and also uses a different table name format than the rest ("vulnerabilities" vs "Vulnerability"), which is likely to cause an undefined or mis-targeted step; consider aligning this to `Then Pagination of "Vulnerability" table works` (or adjust the step definition accordingly).
- The step `Given User visits Vulnerability details Page of {string}` is now defined both in `@vulnerability-explorer/vulnerability-explorer.step.ts` and `@sbom-explorer/sbom-explorer.step.ts`, which can cause ambiguous step resolution in Playwright BDD; it would be safer to centralize this shared step in a single file (or give one of them a distinct pattern).
## Individual Comments
### Comment 1
<location path="e2e/tests/ui/features/@sbom-explorer/sbom-explorer.step.ts" line_range="296-253" />
<code_context>
+ },
+);
+
+// Shared step - navigates to vulnerability details page
+// Also defined in @vulnerability-explorer/vulnerability-explorer.step.ts
+Given(
+ "User visits Vulnerability details Page of {string}",
+ async ({ page }, vulnerabilityID: string) => {
+ await VulnerabilityDetailsPage.build(page, vulnerabilityID);
+ },
</code_context>
<issue_to_address>
**issue (bug_risk):** This step definition duplicates the same "User visits Vulnerability details Page of {string}" step in vulnerability-explorer, which can cause ambiguous step errors.
The same `Given("User visits Vulnerability details Page of {string}", ...)` now exists in both `@sbom-explorer/sbom-explorer.step.ts` and `@vulnerability-explorer/vulnerability-explorer.step.ts`. Please either centralize this in a single/shared step file and reuse it, or adjust the step text so each definition is unique.
</issue_to_address>
### Comment 2
<location path=".github/chatmodes/playwright-tester.chatmode.md" line_range="42" />
<code_context>
- npx playwright test --project='bdd' --trace on -g "scenario name here" --headed
+ npx playwright test --project='bdd' --trace on -g "scenario name here"
```
- In case of test failures, the above command launched HTML server to host the test output Press `Ctrl+C` to stop the server
</code_context>
<issue_to_address>
**suggestion (typo):** Tighten grammar and punctuation in this sentence for clarity.
Suggest: "In case of test failures, the above command launches an HTML server to host the test output. Press `Ctrl+C` to stop the server."
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| When( | ||
| "User clicks on the vulnerability row with ID {string}", | ||
| async ({ page }, vulnerabilityID: string) => { |
There was a problem hiding this comment.
issue (bug_risk): This step definition duplicates the same "User visits Vulnerability details Page of {string}" step in vulnerability-explorer, which can cause ambiguous step errors.
The same Given("User visits Vulnerability details Page of {string}", ...) now exists in both @sbom-explorer/sbom-explorer.step.ts and @vulnerability-explorer/vulnerability-explorer.step.ts. Please either centralize this in a single/shared step file and reuse it, or adjust the step text so each definition is unique.
| npx playwright test --project='bdd' --trace on -g "scenario name here" --headed | ||
| npx playwright test --project='bdd' --trace on -g "scenario name here" | ||
| ``` | ||
| - In case of test failures, the above command launched HTML server to host the test output Press `Ctrl+C` to stop the server |
There was a problem hiding this comment.
suggestion (typo): Tighten grammar and punctuation in this sentence for clarity.
Suggest: "In case of test failures, the above command launches an HTML server to host the test output. Press Ctrl+C to stop the server."
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
58fe25f to
95090c2
Compare
carlosthe19916
left a comment
There was a problem hiding this comment.
As those are cherry-picks I cannot not really review the changes itself, but having CI to pass would be enough. I see CI failing, let's make sure no errors are encountered and we can merge this
…ec#831) Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
…c#835) Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
…uacsec#879) Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
…ision (guacsec#896) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Matej Nesuta <mnesuta@mnesuta-thinkpadp1gen7.rmtcz.csb>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
The below commits cherry-picked to backport to release branch:
Summary by Sourcery
Backport end-to-end test improvements and additional scenarios around SBOM, advisory, and vulnerability workflows to the release branch.
Enhancements:
Tests: