Bite 30L.1 30L.2 — Manual Promotion Test Suite - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki
ERS Bite 30L.1 + 30L.2 — Manual Promotion Test Suite
Branch: 820-30l2
Committed HEAD SHA: cc5a95e9ed0e37b6df2bdb286ba5786ccb90da38
Purpose: Manual promotion verification for 30L.1 — Multi-Tenant Identity and Confidentiality E2E and 30L.2 — Identity Lifecycle and Delegated Authorization E2E after local and CI automation are green.
Promotion rule
Promote 30L.1 + 30L.2 only if all five tests PASS. Any wrong Tenant context, leaked other-Tenant identity, loss of the surviving Tenant session, incorrect Account/session lifecycle, lost Person self-service after delegated-role revocation, or incorrect Collaborator Journey lifecycle is promotion-blocking.
0. Prerequisites and deterministic local fixtures
0.1 Confirm the committed source
From the repository root:
git rev-parse HEAD
Expected:
cc5a95e9ed0e37b6df2bdb286ba5786ccb90da38
PASS: the SHA matches exactly.
BLOCK PROMOTION: stop if it does not match.
0.2 Start the backend with the deterministic 30L E2E identities provisioned
Stop any currently running local backend first. For this manual promotion suite, use a dedicated disposable database rather than your normal backend/data/app.db. This prevents fixture provisioning from colliding with historical local identities such as an [email protected] Account already bound to bootstrap-admin.
For the first start of the manual-test backend, from the repository root run:
ERS_DATABASE_PATH=data/manual-30l.db \
ERS_RESET_DATABASE=true \
ERS_PROVISION_E2E_ADMIN=true \
AUTHZ_BOOTSTRAP_ENABLED=false \
[email protected] \
E2E_ADMIN_PASSWORD='Local-E2E-Administrator-28D!' \
make local-backend
Leave that terminal running. ERS_RESET_DATABASE=true deletes only backend/data/manual-30l.db; it does not touch your normal backend/data/app.db.
If you need to restart the backend while continuing the same manual suite, preserve the manual-test data by omitting the reset flag:
ERS_DATABASE_PATH=data/manual-30l.db \
ERS_PROVISION_E2E_ADMIN=true \
AUTHZ_BOOTSTRAP_ENABLED=false \
[email protected] \
E2E_ADMIN_PASSWORD='Local-E2E-Administrator-28D!' \
make local-backend
Do not point this fixture-provisioning command at an existing developer database whose [email protected] login is already bound to another Actor. The provisioner intentionally stops on login ownership conflicts instead of silently relinking an Authentication Account.
This provisioning creates/reconciles the identities used below, including:
| Role | Login | Password |
|---|---|---|
| Application Administrator | [email protected] |
Local-E2E-Administrator-28D! |
| Default Tenant Administrator | [email protected] |
Local-E2E-Administrator-28D! |
| Multi-Tenant Person | [email protected] |
Local-E2E-Administrator-28D! |
| Tenant A Administrator | [email protected] |
Local-E2E-Administrator-28D! |
| Tenant B Administrator | [email protected] |
Local-E2E-Administrator-28D! |
The deterministic multi-Tenant identity is:
| Item | Expected value |
|---|---|
| Global Person | e2e-multi-tenant-person |
| Tenant A | E2E Multi Tenant A / E2EMULTIA |
| Tenant A Membership | e2e-multi-tenant-membership-e2e-multi-tenant-a |
| Tenant A Actor | e2e-multi-tenant-actor-e2e-multi-tenant-a |
| Tenant B | E2E Multi Tenant B / E2EMULTIB |
| Tenant B Membership | e2e-multi-tenant-membership-e2e-multi-tenant-b |
| Tenant B Actor | e2e-multi-tenant-actor-e2e-multi-tenant-b |
0.3 Start the frontend
In a second terminal:
make local-frontend
Open the normal local frontend in the browser.
0.4 Browser-session rule for these tests
Where a test requires two identities at the same time, use two independent browser sessions, for example:
- one normal browser window/profile;
- one Incognito/InPrivate window or a different browser profile.
Do not reuse the same cookie jar for two simultaneous identities.
Test 01 — One Account switches between Tenant A and Tenant B without leaking the other Tenant relationship
Identity and context
Sign in as: [email protected]
Password: Local-E2E-Administrator-28D!
Steps
- Open the application login page.
- Enter the exact login and password above.
- Click Sign in.
- In the top bar, locate the Tenant selector.
- Click the collapsed Tenant selector.
- Verify the selection panel initially shows both:
- E2E Multi Tenant A (
E2EMULTIA) - E2E Multi Tenant B (
E2EMULTIB)
- E2E Multi Tenant A (
- Select E2E Multi Tenant A.
- Confirm the selector closes and the top bar now shows E2E Multi Tenant A.
- Click People in the application navigation.
- Open the signed-in Person's own Person record if it is not already displayed.
- Record the displayed Membership ID.
- Verify it is exactly:
e2e-multi-tenant-membership-e2e-multi-tenant-a
- On that Person screen, look for any visible value containing any of the following Tenant B identifiers:
e2e-multi-tenant-b
e2e-multi-tenant-membership-e2e-multi-tenant-b
e2e-multi-tenant-actor-e2e-multi-tenant-b
- Verify none of those Tenant B identifiers is visible.
- Open the Tenant selector again.
- Verify reopening the selector shows the full unfiltered list again.
- Select E2E Multi Tenant B.
- Confirm the selector closes and the top bar now shows E2E Multi Tenant B.
- Open People and the signed-in Person's own Person record.
- Record the displayed Membership ID.
- Verify it is exactly:
e2e-multi-tenant-membership-e2e-multi-tenant-b
- Verify none of these Tenant A identifiers is visible:
e2e-multi-tenant-a
e2e-multi-tenant-membership-e2e-multi-tenant-a
e2e-multi-tenant-actor-e2e-multi-tenant-a
- Confirm you were not required to sign in again when switching from Tenant A to Tenant B.
Expected result
The same Authentication Account can use both Tenant contexts, but each Tenant context exposes only its own Membership projection. Switching Tenant changes operating context without changing Account session.
PASS criteria
- Both Tenant choices are available.
- Selecting a Tenant closes the selector and changes the visible current Tenant.
- Tenant A shows only Membership A.
- Tenant B shows only Membership B.
- No other-Tenant Membership/Actor identifiers are exposed.
- No re-login is required between Tenant A and Tenant B.
Promotion-blocking conditions
BLOCK PROMOTION if the wrong Membership appears, both Memberships appear together, another Tenant's Actor/Membership is disclosed, Tenant switching signs the Account out, or the selected Tenant in the top bar does not match the Person projection.
Test 02 — Deactivating Tenant Actor A leaves Tenant B usable in the same Account session, then reactivation restores Tenant A
Identities and browser sessions
Browser session 1 — Multi-Tenant Person
Login: [email protected]
Password: Local-E2E-Administrator-28D!
Browser session 2 — Tenant A Administrator
Login: [email protected]
Password: Local-E2E-Administrator-28D!
Required Tenant context: E2E Multi Tenant A
Steps
-
In browser session 1, sign in as the Multi-Tenant Person.
-
Select E2E Multi Tenant B and confirm the application is usable.
-
Keep browser session 1 signed in.
-
In browser session 2, sign in as the Tenant A Administrator.
-
Confirm the top-bar Tenant is E2E Multi Tenant A.
-
Click Authorization in the application navigation.
-
In the Actors section, locate the field labeled Filter actors by Actor Key or display name.
-
Enter exactly:
e2e-multi-tenant-actor-e2e-multi-tenant-a -
Verify exactly the intended Tenant A Actor card remains visible.
-
Confirm the card currently shows Active.
-
Click Deactivate on that Actor card.
-
Wait until the same card shows Inactive and the action changes to Activate.
-
Return to browser session 1 without signing out.
-
Reload the current page once so the shell refreshes the Account's available Tenant options.
-
Verify you remain authenticated.
-
Open the Tenant selector.
-
Verify E2E Multi Tenant B remains available.
-
Verify E2E Multi Tenant A is no longer available while Actor A is inactive.
-
Select or retain E2E Multi Tenant B.
-
Click People and confirm the signed-in Person's self-service still loads successfully.
-
Return to browser session 2.
-
On the same Tenant A Actor card, click Activate.
-
Wait until the card shows Active again.
-
Return to browser session 1.
-
Reload the page once.
-
Open the Tenant selector.
-
Verify both E2E Multi Tenant A and E2E Multi Tenant B are available again.
-
Select E2E Multi Tenant A.
-
Confirm the application changes to Tenant A successfully without asking for credentials again.
-
Open People and confirm self-service loads in Tenant A.
Values to record
Record:
- whether the Person Account remained signed in while Actor A was inactive;
- whether Tenant B remained selectable and usable;
- whether Tenant A disappeared while inactive;
- whether Tenant A returned after reactivation without a new login.
PASS criteria
All four observations must be Yes.
Promotion-blocking conditions
BLOCK PROMOTION if deactivating Actor A invalidates the whole Account session, disables Tenant B, leaves Tenant A selectable as if active, or if reactivation requires a new login before Tenant A becomes usable again.
Test 03 — Revoking a delegated Role Grant removes operator authority but preserves Person self-service
Identities and browser sessions
Browser session 1 — Multi-Tenant Person
Login: [email protected]
Password: Local-E2E-Administrator-28D!
Tenant: E2E Multi Tenant A
Browser session 2 — Tenant A Administrator
Login: [email protected]
Password: Local-E2E-Administrator-28D!
Tenant: E2E Multi Tenant A
Steps
-
In browser session 2, sign in as the Tenant A Administrator.
-
Confirm E2E Multi Tenant A is selected.
-
Open Authorization.
-
Filter Actors by:
e2e-multi-tenant-actor-e2e-multi-tenant-a -
On that Actor card, use the Role selector and choose:
EXPENSE_OPERATOR -
Verify Grant tenant displays the Tenant A binding and is not editable.
-
Click Grant Role.
-
Verify the Actor card displays an active
EXPENSE_OPERATORgrant. -
In browser session 1, sign in as the Multi-Tenant Person and select E2E Multi Tenant A.
-
Reload once so navigation reflects the new effective authorization.
-
Verify the application exposes the Expenses navigation/workspace that comes from the delegated Expense Operator role.
-
Verify People self-service is also available.
-
Return to browser session 2.
-
On the same Actor card, locate the active
EXPENSE_OPERATORgrant. -
Click Revoke for that grant.
-
Wait until the active
EXPENSE_OPERATORgrant is no longer shown as active. -
Return to browser session 1.
-
Reload once.
-
Verify the Account remains signed in.
-
Verify the delegated Expenses capability/navigation is no longer available to this Person.
-
Verify People remains available.
-
Open the signed-in Person's own Person record and confirm it loads successfully.
-
Open the Tenant selector and verify Tenant A remains a valid Tenant context; the Role revocation must not remove the Account→Actor→Membership identity binding.
Expected result
Revoking EXPENSE_OPERATOR removes only delegated Expense Operator authority. It does not deactivate the Actor, remove the Membership, invalidate the Account session, or remove intrinsic Person self-service.
PASS criteria
EXPENSE_OPERATORcan be granted and then revoked.- Expense-operator UI capability disappears after revocation.
- The Account remains authenticated.
- Tenant A remains selectable.
- People self-service still works.
Promotion-blocking conditions
BLOCK PROMOTION if revocation signs the Person out, removes Tenant A, disables the Actor, removes the Membership, or prevents the Person from opening their own People/self-service view.
Test 04 — Temporary password, Account security suspension/reactivation, session invalidation, and administrator-issued reset
This test creates a disposable Person/Account through the UI so the deterministic 30L fixtures are not left with a changed password.
Test data
Use exactly these values:
| Field | Value |
|---|---|
| First Name | Manual30L2 |
| Last Name | Lifecycle |
| Nickname | M30L2 Lifecycle |
| CPF | 16180339805 |
| RG | M30L2-LIFECYCLE-001 |
| Cellular | 11987654321 |
| Email / login | [email protected] |
| Initial temporary password | Manual-30L2-Temp-1! |
| First permanent password | Manual-30L2-Permanent-2! |
| Reset password | Manual-30L2-Reset-3! |
Phase A — Create the Person in Default Tenant
Identity
Sign in as: [email protected]
Password: Local-E2E-Administrator-28D!
Tenant: Default Tenant (DEFAULT)
Steps
- Sign in as the Default Tenant Administrator.
- Confirm the top-bar Tenant is Default Tenant.
- Open People.
- Choose the UI action to create a new Person.
- Enter the exact Personal values from the table above.
- Set Status to Active.
- Click Create Person.
- Find
M30L2 Lifecyclein People and open the record. - Confirm the Person exists and is ACTIVE in Default Tenant.
Phase B — Create the Authentication Account with a temporary password
Identity
Sign in as: [email protected]
Password: Local-E2E-Administrator-28D!
Administration context: global/Application Administration (*)
Steps
-
In a separate browser session, sign in as the Application Administrator.
-
Confirm the top bar shows the Administration context, not a Tenant operating context.
-
Open Authentication.
-
In the create-account form, choose Default Tenant as the target Tenant.
-
Enter exact Person login email:
[email protected] -
Enter temporary password:
Manual-30L2-Temp-1! -
Click Create account.
-
In Actor/account filter, search for
[email protected]. -
Confirm one Authentication Account card appears.
-
Confirm the card identifies the linked Person and a Tenant Actor for Default Tenant.
-
Confirm the card indicates Password change required.
Phase C — First login must force a password change
-
In a new Incognito/InPrivate browser session, open the login page.
-
Sign in as
[email protected]withManual-30L2-Temp-1!. -
Verify the application sends the user to Change password before normal application use.
-
Enter:
Current password
Manual-30L2-Temp-1!New password
Manual-30L2-Permanent-2!Confirm new password
Manual-30L2-Permanent-2! -
Click Change password.
-
Confirm the Person reaches normal authenticated self-service.
Phase D — Security suspension invalidates the active session and uses the explicit reactivation workflow
-
Return to the Application Administrator browser session.
-
On the filtered Authentication Account card for
[email protected], click Security suspend. -
Confirm the account card now shows Security suspended.
-
Return to the Person browser session.
-
Attempt normal navigation, for example click People or reload the current protected page.
-
Verify the existing session is no longer accepted and the browser is returned to Sign in.
-
Attempt to sign in with:
[email protected] Manual-30L2-Permanent-2! -
Verify login is rejected with the security-suspension message.
-
Verify Request reactivation is offered.
-
Click Request reactivation.
-
Verify the page shows Reactivation requested and explains that an Application Administrator must review the request.
-
Return to the Application Administrator browser session.
-
Open Tenants if necessary to expose the pending-request alert.
-
Find Pending account reactivation requests and click Review requests.
-
In Account reactivation requests, find the card for
[email protected]. -
Enter Review reason:
Manual 30L.2 lifecycle promotion verification -
Click Approve reactivation.
-
Confirm the request disappears from the pending list.
-
Return to the Person browser session.
-
Click Return to sign in if that button is shown.
-
Sign in using
Manual-30L2-Permanent-2!. -
Confirm normal Person self-service is restored.
Phase E — Administrator-issued reset invalidates the old credential/session
-
Return to the Application Administrator browser session.
-
Open Authentication and filter for
[email protected]. -
On that Account card, click Issue reset token.
-
Verify a panel appears with heading One-time reset token for [email protected].
-
Click Open reset page.
-
Confirm the reset page contains the issued token automatically.
-
Enter New password and Confirm new password as:
Manual-30L2-Reset-3! -
Click Reset password.
-
Return to the previously authenticated Person browser session.
-
Attempt protected navigation or reload.
-
Verify the pre-reset session is no longer accepted.
-
Attempt login with the old permanent password:
Manual-30L2-Permanent-2! -
Verify it is rejected.
-
Sign in with:
Manual-30L2-Reset-3! -
Verify authentication succeeds and Person self-service loads.
PASS criteria
- Temporary-password login forces Change password.
- New permanent password works.
- Security suspension invalidates the existing session.
- Suspended login is denied with a clear review/reactivation path.
- Reactivation request can be reviewed and approved by Application Administrator.
- The same Account works again after approval.
- Administrator-issued reset invalidates the old session/credential.
- Old password fails after reset.
- New reset password succeeds.
Promotion-blocking conditions
BLOCK PROMOTION for any failure in the sequence above, including a suspended Account retaining an active session, password reset leaving an old session usable, reactivation silently restoring delegated authorization incorrectly, or an Application Administrator being forced into Tenant standing identity to perform review.
Test 05 — Close a zero-balance Collaborator Journey and create a new Journey for the same canonical Membership
Identity and context
Sign in as: [email protected]
Password: Local-E2E-Administrator-28D!
Tenant: Default Tenant (DEFAULT)
Test Person values
| Field | Value |
|---|---|
| First Name | Manual30L2 |
| Last Name | Journey |
| Nickname | M30L2 Journey |
| CPF | 31415926590 |
| RG | M30L2-JOURNEY-001 |
| Cellular | 11987654322 |
[email protected] |
|
| Street 1 | Rua Manual 30L2 200 |
| State | Pará |
| City | Manual City |
| CEP | 66000-000 |
| Bank Name | Manual Bank |
| Bank Number | 001 |
| Checking Account | M30L2-002 |
| PIX | [email protected] |
| Emergency Contact Name | Manual Emergency |
| Emergency Cellular | 11999990002 |
| Emergency Email | [email protected] |
Phase A — Create and complete the Person
- Sign in as the Default Tenant Administrator.
- Confirm Default Tenant is selected.
- Open People and create a new Person.
- Enter the exact Personal values above and set Status to Active.
- Click Create Person.
- Find and open
M30L2 Journey. - Open the Address tab and enter the exact Address values above.
- Click Save Changes.
- Open the Bank tab and enter the exact Bank values above.
- Click Save Changes.
- Open the Emergency tab and enter the exact Emergency values above.
- Click Save Changes.
- Confirm the page indicates the Person is eligible to become a Collaborator.
- Record the displayed Membership ID. Call this recorded value
MEMBERSHIP-30L2for the remainder of the test.
Phase B — Create Journey #1
-
Open Collaborators.
-
Choose the UI action to create a new Collaborator.
-
In Find eligible Person by nickname, type:
M30L2 Journey -
Select the matching Person.
-
Confirm the UI says Selected Person is complete.
-
Enter/select:
Field Value Journey Start Date 2026-09-11Status ActiveSector MiningLocation Main MineTask MinerPayment Method Daily wagePayment Value 100Notes Manual 30L.2 first Journey -
Click Create Collaborator.
-
Open the new Collaborator Journey detail.
-
Record:
- Journey ID as
JOURNEY-1; - Membership ID displayed on the Journey.
- Journey ID as
-
Verify the Journey Membership ID exactly equals
MEMBERSHIP-30L2. -
Locate Journey Settlement.
-
Confirm the settlement state indicates all Journey balances are zero and closure is allowed.
-
Confirm Close Journey is enabled.
Phase C — Close Journey #1 through the real settlement UI
-
Click Close Journey.
-
In the sensitive-action form choose Reason code:
End-of-journey closure -
Enter Reason text:
Manual 30L.2 zero-balance Journey closure verification. -
Click Confirm reauthentication.
-
If the page says second-person approval is Required, stop this test and first change Administration → Account settings → Second-person approval to Optional, recording the previous value so you can restore it afterward. Then return to the Journey and repeat the closure action.
-
Click the final Close Journey button.
-
Verify a success dialog titled Journey Closed appears and contains:
Journey closed successfully. -
Click Continue.
-
Verify the Journey detail now prominently shows Journey Closed and a Closed At value.
-
Verify the closed Journey still displays Membership ID
MEMBERSHIP-30L2. -
Record the Closed At value.
Phase D — Create Journey #2 for the same Membership
-
Return to Collaborators.
-
Choose the UI action to create a new Collaborator.
-
Search eligible People for
M30L2 Journeyagain. -
Verify the Person is eligible again after Journey #1 is closed.
-
Select that Person.
-
Enter/select:
Field Value Journey Start Date 2026-09-12Status ActiveSector MiningLocation Main MineTask MinerPayment Method Daily wagePayment Value 125Notes Manual 30L.2 second Journey -
Click Create Collaborator.
-
Open the new Journey detail.
-
Record its Journey ID as
JOURNEY-2. -
Verify
JOURNEY-2is different fromJOURNEY-1. -
Verify its Membership ID still equals
MEMBERSHIP-30L2. -
Verify its Status is active/open rather than closed.
-
Open Journey Settlement.
-
Verify the new Journey begins with zero Journey balances and is independently eligible for closure.
-
If you changed the Second-person approval setting in step 32, restore the original setting now.
PASS criteria
- Journey #1 is created against the canonical Membership.
- Zero-balance closure succeeds only through the sensitive settlement flow.
- The closed Journey keeps the same Membership ID and records Closed At.
- The Person becomes eligible for a new Journey after closure.
- Journey #2 has a new Journey ID but the same Membership ID.
- Journey #2 starts with zero balances rather than inheriting Journey #1 financial state.
Promotion-blocking conditions
BLOCK PROMOTION if Journey #1 cannot close at zero balance, if closure changes/removes the canonical Membership identity, if the Person cannot be re-onboarded after closure, if Journey #2 reuses Journey #1's ID, or if Journey #2 inherits prior Journey balances/history as current balance.
Final promotion decision
Mark each test:
- Test 01 — Multi-Tenant selection and confidentiality — PASS
- Test 02 — Tenant Actor deactivate/reactivate with surviving Tenant session — PASS
- Test 03 — Role Grant revoke while self-service survives — PASS
- Test 04 — Account/session/password/reset lifecycle — PASS
- Test 05 — Collaborator Journey close/re-onboard lifecycle — PASS
Promote 30L.1 + 30L.2 only when all five boxes are checked and no promotion-blocking condition was observed.
Manual-suite tooling impact
No DevTools commands are required.
No direct API calls are required.
No SQL commands are required.
The only non-UI setup is deterministic local E2E fixture provisioning through the normal provision-e2e-admin path before the UI tests begin.