Add Playwright tests for Vulnerability UI#2567
Conversation
Reviewer's GuideAdds a Playwright-based end-to-end test suite for the Vulnerability UI, including configuration, helpers, auth bootstrap, and npm scripts to run the tests with environment-driven base URL and proxy settings. Sequence diagram for Playwright auth setup and test executionsequenceDiagram
actor Dev
participant NPM as NPM_Scripts
participant PW as Playwright_CLI
participant CFG as Playwright_Config
participant SETUP as AuthSetup_Test
participant APP as Vulnerability_UI_App
participant STATE as StorageState_File
participant TESTS as Chromium_Tests
Dev->>NPM: run test:playwright
NPM->>PW: invoke playwright test
PW->>CFG: load configuration
CFG-->>PW: projects setup, chromium
PW->>SETUP: run setup project tests
SETUP->>APP: navigate to BASE_URL and perform login
APP-->>SETUP: returns authenticated session
SETUP->>STATE: save storageState to .auth/admin_user.json
SETUP-->>PW: setup complete
PW->>TESTS: run chromium project tests
TESTS->>STATE: load storageState
TESTS->>APP: open Vulnerability UI pages (CVEs, Systems, Reports)
APP-->>TESTS: render pages for assertions
TESTS-->>PW: report results
PW-->>Dev: output report (HTML/JSON or list)
Class diagram for the new Playwright test modulesclassDiagram
class PlaywrightConfig {
}
class AuthSetup {
}
class ConstantsHelper {
}
class FixturesHelper {
}
class LoginHelpers {
}
class NavHelpers {
}
class TestNavigation {
}
class TestCVEs {
}
PlaywrightConfig <.. AuthSetup : defines_project_setup
PlaywrightConfig <.. TestNavigation : configures_project
PlaywrightConfig <.. TestCVEs : configures_project
AuthSetup --> FixturesHelper : uses_fixtures
AuthSetup --> LoginHelpers : uses_login_helpers
FixturesHelper --> LoginHelpers : composes
FixturesHelper --> NavHelpers : composes
FixturesHelper --> ConstantsHelper : uses_constants
TestNavigation --> FixturesHelper : uses
TestNavigation --> NavHelpers : uses
TestNavigation --> ConstantsHelper : uses
TestCVEs --> FixturesHelper : uses
TestCVEs --> NavHelpers : uses
TestCVEs --> ConstantsHelper : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
9757b3e to
e869835
Compare
|
Hi @bastilian @Siasurai @LightOfHeaven1994 @mtclinton, I've set up Playwright E2E tests for Vulnerability UI and would appreciate your feedback on the approach. Current setup: 9 tests across 3 files (navigation, CVEs, systems) AWS CodeBuild — same as Inventory, Content Sources, and Patch are using. dvagner mentioned we could get our own AWS account and he can help set things up the same way they did it. |
|
@niyazRedhat could you please rebase your PR and check why E2E Playwright Tests job has been cancelled and havent reported any greet tests? |
e869835 to
d221336
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
7dd7d91 to
9674851
Compare
|
Hi @LightOfHeaven1994 I rebased on the latest master! |
Summary
_playwright-tests/folder with Playwright tests for Vulnerability UIplaywright.config.jswith Chromium, proxy support, and retry configplaywright_example.envtemplate for environment setupTest coverage
test_navigation.test.ts— navigation smoke tests (CVEs, Systems, Reports pages)test_cves.test.ts— CVEs page filter, search, pagination testsHow to run
See
_playwright-tests/README.mdfor full setup instructions.Status
🚧 WIP — tests being stabilized, not ready for review yet
Summary by Sourcery
Add Playwright-base testing support for the Vulnerability UI, including configuration, helpers, and navigation coverage for key pages.
Build:
Tests: