Skip to main content

Testing Strategy

Testing this library requires a multi-layered approach:
  1. Unit tests — Flutter tests with mocked MethodChannel
  2. Manual QA — Testing on real devices across scenarios

Unit Tests

Running Tests

Test Structure

Unit tests use Flutter’s test framework with a mocked MethodChannel:

Testing Error Handling

Manual QA Testing

Manual testing must be performed on real devices because the SEON SDKs require actual hardware.

Prerequisites

  • Real iOS device (iOS 13+)
  • Real Android device (API 26+)
  • Valid SEON API credentials
  • Debug and release builds

Test Checklist

Initialization Tests

  • Initialize with valid credentials (both platforms)
  • Initialize with invalid baseUrl (should fail gracefully)
  • Initialize with invalid token (should fail gracefully)
  • Initialize with optional parameters (language, theme)
  • Call startVerification() before initialize() (should error with E_NOT_INITIALIZED)

Complete Flow Tests

  • Complete full verification flow successfully (both platforms)
  • Complete flow with pending status
  • Complete flow with failed status
  • Verify result object contains correct status

Cancellation Tests

  • Cancel verification mid-flow (should return interruptedByUser status)
  • Cancel at different stages (document capture, selfie, liveness)

Error Scenarios

  • Deny camera permission (should fail appropriately)
  • Deny location permission (Android: should return missingLocationPermission)
  • Deny microphone permission (should fail appropriately)
  • Call startVerification() twice simultaneously (should error with E_VERIFICATION_IN_PROGRESS)
  • Network error during verification (should return error status with message)

UI/UX Tests

  • Verify SDK UI appears correctly on both platforms
  • Verify theme setting works (light/dark)
  • Verify language setting works
  • Check UI transitions are smooth
  • Verify navigation controller handling on iOS
  • Verify transparent Activity on Android (no visual flicker)

State Management

  • App backgrounds during verification
  • App is interrupted by phone call
  • Low memory scenarios
  • Device rotation during verification

Test App Template

Device Requirements

  • Test on real iPhone or iPad
  • Test on iOS 13, 14, 15, and latest version
  • Test on different device sizes (iPhone SE, standard, Pro Max)
  • Test in both portrait and landscape orientations
The SEON SDKs require real device hardware and will not work on simulators or emulators. Always test on physical devices.

Continuous Integration

Unit tests can be automated in CI. Device testing cannot be automated due to real device requirements.