Skip to content

test(audit_log): e2e testing for login and logout successfully with audit (#6092)#6097

Open
a19836 wants to merge 3 commits into
mainfrom
issue/6092
Open

test(audit_log): e2e testing for login and logout successfully with audit (#6092)#6097
a19836 wants to merge 3 commits into
mainfrom
issue/6092

Conversation

@a19836

@a19836 a19836 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

End-to-end integration test covering the frontend login:

  1. With Playwright
  2. Execute a login action
  3. Then logout
  4. Check manually if login action was logged in the backend-api's console (console transport must be active)
    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

  1. Run one of the following commands:
    yarn test:e2e tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-deps
    or
    yarn playwright test tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-deps
    or
    npx playwright test tests_e2e/tests/aop/audit_log/login-audit.spec.ts --project="Google Chrome" --no-deps

Related issues

Definition of Done

  • was login and logout actions logged into console

@a19836 a19836 self-assigned this Jun 5, 2026
@a19836 a19836 added filigran team Item from the Filigran team. audit-logging Functional scope: audit logging labels Jun 5, 2026
@a19836 a19836 linked an issue Jun 5, 2026 that may be closed by this pull request
1 task
@a19836 a19836 changed the title test(audit-log): e2e testing for login and logout successfully with audit (#6092) test(audit_log): e2e testing for login and logout successfully with audit (#6092) Jun 5, 2026
@a19836 a19836 requested review from Dimfacion and RomuDeuxfois June 5, 2026 14:40
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.54%. Comparing base (de611ed) to head (ce3c36b).

❌ 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     
Flag Coverage Δ
backend 64.58% <ø> (-0.03%) ⬇️
e2e 16.70% <ø> (-0.20%) ⬇️
frontend 1.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@a19836 a19836 marked this pull request as ready for review June 5, 2026 14:57
Copilot AI review requested due to automatic review settings June 5, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread openaev-front/tests_e2e/tests/aop/audit_log/login-audit.spec.ts
Comment thread openaev-front/tests_e2e/tests/aop/audit_log/login-audit.spec.ts Outdated
@SamuelHassine SamuelHassine removed the audit-logging Functional scope: audit logging label Jun 7, 2026
Comment thread openaev-front/tests_e2e/tests/aop/audit_log/login-audit.spec.ts
@a19836 a19836 requested a review from RomuDeuxfois June 9, 2026 16:04

@corinnekrych corinnekrych left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(audit-logging): add e2e test for the login action

6 participants