test(audit_log): e2e testing for login and logout successfully with audit (#6092)#6097
test(audit_log): e2e testing for login and logout successfully with audit (#6092)#6097a19836 wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (1.90%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6097 +/- ##
============================================
- Coverage 42.57% 42.54% -0.04%
+ Complexity 6736 6730 -6
============================================
Files 2237 2237
Lines 61082 61082
Branches 8021 8021
============================================
- Hits 26007 25987 -20
- Misses 33391 33412 +21
+ Partials 1684 1683 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Playwright E2E spec under tests_e2e/tests/aop/audit_log/ to exercise the UI authentication flow (login → logout) as groundwork for verifying audit logging for auth events referenced by issue #6092.
Changes:
- Added a new E2E test that performs a login with provided credentials, then logs out and asserts the login screen is shown again.
- Included an explicit CSRF bootstrap + logout request flow to ensure logout succeeds under Spring Security CSRF protection.
corinnekrych
left a comment
There was a problem hiding this comment.
The new test duplicates the login steps (fill username/password, click sign in) instead of reusing the existing login() utility from tests_e2e/utils/login.ts. It would be cleaner to call await login(page) from that shared utility and then proceed to the logout + audit verification steps
also the test should check the audit log file and expect audit entries to match user action login/logout
Description
End-to-end integration test covering the frontend login:
Note: Because we don't have yet the audit-log search API, we need to perform this check manually.
Proposed changes
Create a test file to comply with the requirements in the related issue and above description.
Testing Instructions
yarn test:e2e tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-depsor
yarn playwright test tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-depsor
npx playwright test tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-depsRelated issues
Definition of Done