Files
projectmycelium/tests/frontend_ux

Frontend UX Tests

Overview

Complete UX testing framework for Project Mycelium covering all user capabilities defined in the Concrete UX List. These tests validate the complete user experience across all marketplace features.

Test Status

VALIDATED WORKING TESTS:

  • SSH Key Management (reference template)
  • Public Access (documentation pages)
  • Settings Management (/dashboard/settings)

🔧 REWRITTEN TESTS (PENDING VALIDATION):

  • Credits Wallet
  • Purchase Cart
  • Authentication
  • Marketplace Categories
  • Provider Dashboards

Individual Test Execution

Run individual UX test modules with detailed output:

1. SSH Key Management ( Working)

cargo test --test ssh_key_frontend_ux --features="ux_testing" -- --nocapture

2. Public Access ( Working)

cargo test --test public_access_ux --features="ux_testing" -- --nocapture

3. Settings Management ( Working)

cargo test --test settings_management_ux --features="ux_testing" -- --nocapture

4. Credits Wallet (🔧 Pending Validation)

cargo test --test credits_wallet_ux --features="ux_testing" -- --nocapture

5. Purchase Cart (🔧 Pending Validation)

cargo test --test purchase_cart_ux --features="ux_testing" -- --nocapture

6. Authentication (🔧 Pending Validation)

cargo test --test authentication_ux --features="ux_testing" -- --nocapture

7. Marketplace Categories (🔧 Pending Validation)

cargo test --test marketplace_categories_ux --features="ux_testing" -- --nocapture

8. Provider Dashboards (🔧 Pending Validation)

cargo test --test provider_dashboards_ux --features="ux_testing" -- --nocapture

Complete Test Suite Execution

Run all UX tests together (when all are validated):

cargo test --features="ux_testing" -- --nocapture

Or run all tests matching the pattern:

cargo test --features="ux_testing" --test "*_ux" -- --nocapture

Test Architecture

Canonical UX Test Pattern (adopted)

All tests follow this canonical pattern:

  • Direct service calls using .builder().build() (no HTTP/session mocking)
  • Persistent data via UserPersistence under user_data/{email}.json
  • Deterministic cleanup: remove user_data/{email}.json before/after
  • Per-step runner with catch_unwind to print / and aggregate failures
  • Structured logging via env_logger (use -- --nocapture to see logs)

Key Features

  • Isolated Test Environment: Uses --features="ux_testing" flag
  • Persistent Data Testing: Real data operations without mocking
  • Cross-Reference Testing: Manual testing validates automated results
  • Complete User Workflows: End-to-end UX validation

Current adoption of the per-step runner

  • tests/frontend_ux/settings_management_ux_test.rs
  • tests/frontend_ux/public_access_ux_test.rs

File Organization

tests/frontend_ux/
├── README.md                           # This file
├── mod.rs                             # Test module configuration
├── test_runner.rs                     # Comprehensive test suite runner
├── ssh_key_frontend_ux_test.rs        # ✅ SSH key management (working)
├── public_access_ux_test.rs           # ✅ Public access (working)
├── settings_management_ux_test.rs     # ✅ Settings management (working)
├── credits_wallet_ux_test.rs          # 🔧 Credits wallet (pending)
├── purchase_cart_ux_test.rs           # 🔧 Purchase cart (pending)
├── authentication_ux_test.rs          # 🔧 Authentication (pending)
├── marketplace_categories_ux_test.rs  # 🔧 Marketplace categories (pending)
└── provider_dashboards_ux_test.rs     # 🔧 Provider dashboards (pending)

Dashboard Settings UX (/dashboard/settings)

Overview

  • Scope: Validates 6 settings operations
    • Profile update (name, country, timezone)
    • Password change workflow validation
    • SSH key management integration
    • Notification preferences management
    • Currency display preferences
    • Account management workflow (soft delete + permanent delete with persistence verification)
  • Services used: UserService, CurrencyService, SSHKeyService, UserPersistence via .builder().build()
  • Persistence: Real data under user_data/{email}.json
  • Feature flag: Requires --features ux_testing

How to run

cargo test --test settings_management_ux --features="ux_testing" -- --nocapture

Expected output (snippet)

🎯 Settings Management - Complete UX Workflow Test
📋 Testing all 6 operations: Profile → Password → SSH → Notifications → Currency → Account
...
🎯 Settings Management UX Workflow Test Results:
✅ Profile Update Operations - WORKING
✅ Password Change Workflow - WORKING
✅ SSH Key Management Integration - WORKING
✅ Notification Settings Management - WORKING
✅ Currency Preferences Management - WORKING
✅ Account Management (soft delete + permanent delete) - WORKING
✅ All 6 settings management capabilities validated successfully!

Manual Testing checklist

  • Profile update: Change name, country, timezone; save; refresh page; verify values persist and reflect in UI and user_data/ file.
  • Password change: Attempt invalid current password (error), weak new password (strength warning), mismatched confirmation (error), and valid change (success toast). No actual password stored in dev.
  • SSH keys: Add a valid public key; set as default; edit label; delete; verify duplicate fingerprint is rejected and invalid key format shows UI error. Persistence reflects changes.
  • Notifications: Toggle email, push, SMS, Slack, Discord; validate Slack webhook URL format; ensure toggles persist after reload and are saved to NotificationSettings.
  • Currency: Switch between USD/EUR/CAD; verify amounts re-render with correct symbol and formatting; rounding to 2 decimals; preference persists across sessions.
  • Account management:
    • Start delete flow; confirmation dialog appears; explain retention/backup steps; cancel keeps data.
    • Soft delete: confirm; verify user_data/{email}.json contains "deleted": true and a deleted_at timestamp; UI should reflect a disabled/deleted state.
    • Permanent delete: confirm final warning; verify user_data/{email}.json is removed from disk; user can no longer sign in.
    • Caution: This test environment performs real deletions. Back up the JSON file first if you need to preserve data.
  • Performance/UX: Page loads without jank; settings actions respond quickly; no console errors; network requests minimal and succeed.
  • Data integrity: After full workflow, check user_data/{email}.json shows updated profile, notifications, currency, and SSH keys without duplicates.

Expected Output

When working correctly, tests show detailed UX workflow validation:

🎯 SSH Key Management - Complete UX Workflow Test
📋 Testing all 4 operations: Create → Set Default → Edit → Delete
...
🎯 SSH Key UX Workflow Test Results:
✅ Create Operation - WORKING
✅ Set Default Operation - WORKING
✅ Edit Operation - WORKING
✅ Delete Operation - WORKING
✅ All 4 SSH key operations validated successfully!

Next Steps

  1. Validate remaining 5 test modules using proven SSH key pattern
  2. Run complete test suite once all tests are validated
  3. Document any integration issues discovered during validation
  4. Complete UX testing framework for production readiness

Technical Notes

  • Compilation Errors Fixed: All session mocking removed, persistent data pattern adopted
  • Builder Pattern Compliance: All services use .builder().build() construction
  • Currency Service Integration: Uses convert_usd_to_display_currency method
  • File System Persistence: Tests use user_data/{email}.json for data operations