FeaturesAuth TestingOverview

Authentication Testing

Testing authentication is one of the hardest parts of QA automation. Passwords change, OTP codes expire in 30 seconds, magic links are one-time use, and 2FA tokens are unique per user. BugBrain automates it all.

Why Auth Testing Is Hard

Manual Testing:

  • Manually enter passwords → slow, error-prone
  • Wait for OTP email → 30-second window
  • Magic links expire → can’t reuse
  • 2FA codes change every 30 seconds → can’t share
  • Sessions expire → need constant re-login

Result: QA teams spend hours on auth testing, and it’s often skipped.

BugBrain Solution: Personas automate credential injection. No manual password entry. OTP retrieved automatically. Sessions cached for reuse.

Four Auth Types

How It Works

1. Create a Persona

A Persona is a saved login profile:

Persona: "QA Admin"
├─ Auth Type: Basic
├─ Email: qa-admin@example.com
├─ Password: ••••••••• (encrypted, AES-256)
└─ Project: Acme E-commerce

Credentials are encrypted at rest. Only you (and your team) can use them.

2. Use in Test

Reference the persona when running tests:

Test: "Admin can view dashboard"
├─ Use Persona: "QA Admin"
├─ Step 1: Navigate to login page
├─ Step 2: (AI automatically logs in using persona)
├─ Step 3: Verify dashboard page loads
└─ Execution: Success ✓

3. AI Handles Auth Automatically

During execution, the AI:

  1. Sees the login form
  2. Fills email and password fields automatically
  3. (For OTP) Calls Mailosaur API to retrieve latest OTP code
  4. (For TOTP) Calls pyotp to generate current 2FA code
  5. Clicks Sign In button
  6. Waits for successful login
  7. Caches session for next run

Result: No manual password entry. All auth flows are automated and repeatable.

Session Caching

After the first successful login, BugBrain caches the session (cookies + localStorage) for 8 hours:

Run 1 (first login):
  - Fill email + password
  - Click Sign In
  - Wait for redirect
  - [~8 seconds total]

Run 2 (same persona, cached):
  - Session automatically restored
  - Skip login, go straight to dashboard
  - [~1 second total]

Result: 8x faster authenticated tests on subsequent runs.

Multi-Persona Workflows

Test complex scenarios with multiple users:

Test: "Admin and user can share a document"
├─ Step 1: Login as Admin (Persona: "QA Admin")
├─ Step 2: Create document
├─ Step 3: Invite user (user@example.com)
├─ Step 4: Logout
├─ Step 5: Login as User (Persona: "QA User")
├─ Step 6: Accept invite
├─ Step 7: Verify document access
└─ Result: ✓ Pass

Use multiple personas in a single test to verify role-based features.

Common Challenges & Solutions

ChallengeProblemSolution
Wrong credentialsPersona email/password incorrectVerify credentials in admin panel; test manually
Session expiredCache expired (>8 hours)Sessions auto-clear after 8 hours; create new session
OTP too slowMailosaur retrieval takes timeIncrease timeout; ensure OTP is being sent
Magic link expiredLink is one-useDon’t click link in browser before test runs
2FA disabledUser removed 2FAUpdate persona auth type to basic
Locked accountToo many failed attemptsUnlock account in admin panel; verify credentials

Quick Start


Security

Your credentials are protected with military-grade encryption:

  • At rest: AES-256-GCM encryption
  • In transit: HTTPS/TLS
  • In logs: Passwords never logged; auth headers stripped
  • Access control: Only your organization can use your personas
  • Audit trail: All persona usage is logged and timestamped

Only you and your team members can see and use personas. BugBrain staff cannot access your credentials even if we wanted to.

Plan Availability

FeatureStarterGrowthPro
Basic Auth
Email OTP
Magic Links
TOTP / MFA
Session Caching
Personas per project520Unlimited

All plans support all auth types. Scaling limits vary by tier.


Next Steps