mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-03-22 03:08:23 +00:00
- Added support for invitations management in the UI E2E tests, including a new InvitationsPage class for handling invitation-related actions. - Updated the Playwright configuration to include a new project for invitations tests. - Created comprehensive end-to-end tests for inviting new users, verifying the sign-up process, and ensuring proper organization association. - Introduced new environment variable 'E2E_ORGANIZATION_ID' for managing organization-specific tests. - Documented the new test cases and flow for invitations management in the corresponding markdown files.
2.5 KiB
2.5 KiB
E2E Tests: Invitations Management
Suite ID: INVITATION-E2E
Feature: User Invitations.
Test Case: INVITATION-E2E-001 - Invite New User and Complete Sign-Up
Priority: critical
Tags:
- type → @e2e
- feature → @invitations
- id → @INVITATION-E2E-001
Description/Objective: Validates the full flow to invite a new user from the admin session, consume the invitation link, sign up as the invited user, authenticate, and verify the user is associated to the expected organization.
Preconditions:
- Admin authentication state available:
playwright/.auth/admin_user.json(admin.auth.setup) - Environment variables configured:
E2E_NEW_USER_PASSWORD(password for the invited user)E2E_ORGANIZATION_ID(expected organization for membership verification)
- Application running with accessible UI/API endpoints
Flow Steps:
- Navigate to invitations page
- Click "Send Invitation" button
- Fill unique email address for the invite
- Select role
e2e_admin - Click "Send Invitation" to generate invitation
- Read the generated share URL from the invitation details
- Open a new browser context (no admin cookies) and navigate to the share URL
- Complete sign-up with provided password and accept terms
- Verify sign-up success (no errors) and redirect to login page
- Log in with the newly created credentials in the new context
- Verify successful login
- Navigate to user profile and verify
organizationIdmatchesE2E_ORGANIZATION_ID
Expected Result:
- Invitation is created and a valid share URL is provided
- Invited user can sign up successfully using the invitation link
- User is redirected to the login page after sign-up (OSS flow)
- Login succeeds with the new credentials
- User profile shows membership in the expected organization
Key verification points:
- Invitations page loads and displays the heading
- Send Invitation form is visible (email + role select)
- Invitation details page shows share URL
- Sign-up page loads from invitation link and submits without errors
- Post sign-up, redirect to login is performed
- Login with the new account succeeds
- Profile page shows the expected organization id
Notes:
- Test uses a fresh browser context for the invitee to avoid admin session leakage
- Email should be unique per run (the test uses a random suffix)
- Ensure
E2E_NEW_USER_PASSWORDandE2E_ORGANIZATION_IDare set before execution - The role
e2e_adminmust be available in the environment