This document describes the initial setup for E2E testing infrastructure for Movie Star using Flutter’s integration_test package.
For day-to-day testing usage, see TESTING_GUIDE.md.
Movie Star uses integration_test for cross-platform E2E testing on Windows, Linux, macOS, web, Android, and iOS.
Add the following to pubspec.yaml:
dev_dependencies:
integration_test:
sdk: flutter
puppeteer: ^3.19.0 # Browser automation for POD OAuth testing
pointycastle: ^3.9.1 # RSA key generation for DPoP
Run flutter pub get to install dependencies.
flutter config --enable-linux-desktop
flutter create --platforms=linux .
flutter config --enable-windows-desktop
flutter create --platforms=windows .
flutter config --enable-macos-desktop
flutter create --platforms=macos .
integration_test/
├── fixtures/ # Test data and auth tokens (gitignored)
│ ├── test_credentials.json
│ ├── auth_tokens.json
│ └── complete_auth_data.json
├── helpers/ # Test utilities
│ ├── credential_injector.dart
│ ├── pod_auth_automator.dart
│ ├── oauth_helpers.dart
│ └── test_constants.dart
├── utils/ # Development tools
│ ├── delays.dart
│ ├── extract_tokens.dart
│ ├── extract_complete_auth.dart
│ └── discover_oauth_params.dart
├── workflows/ # E2E workflow tests
│ ├── pod_favorites_real_test.dart
│ └── visual_login_test.dart
├── app_test.dart # Basic integration test
└── app_hive_test.dart # Hive initialization test
Create integration_test/fixtures/test_credentials.json:
{
"email": "test@anu.edu.au",
"password": "YOUR_TEST_PASSWORD",
"securityKey": "1234",
"webId": "https://pods.dev.solidcommunity.au/healthpod-test/profile/card#me",
"podUrl": "https://pods.dev.solidcommunity.au/healthpod-test/",
"issuer": "https://pods.dev.solidcommunity.au/"
}
YOUR_TEST_PASSWORD with your actual test account passwordemail, webId, and podUrl if using a different test accountEnsure these files are NOT committed:
# Integration test auth data (contains sensitive tokens)
integration_test/fixtures/auth_tokens.json
integration_test/fixtures/complete_auth_data.json
integration_test/fixtures/test_credentials.json
Before running POD-authenticated tests, extract complete auth data:
# Automated extraction (recommended)
dart run integration_test/utils/extract_tokens.dart
# Manual extraction (if automation fails)
flutter run integration_test/utils/extract_complete_auth.dart -d linux
This generates:
integration_test/fixtures/complete_auth_data.json - Complete auth data with RSA keysintegration_test/fixtures/auth_tokens.json - Legacy tokens (for backwards compatibility)Token Expiration: OAuth tokens expire after 1 hour. Re-run extraction if tests fail with invalid_grant errors.
The solidpod package requires complete authentication data including:
Legacy token injection (basic access_token/id_token only) will fail with:
OpenIdException(invalid_grant): grant request is invalid
The extraction tools generate RSA keypairs and build the complete auth structure:
{
"web_id": "https://pods.dev.solidcommunity.au/healthpod-test/profile/card#me",
"logout_url": "https://pods.dev.solidcommunity.au/logout",
"rsa_info": "{...RSA keypair in PEM format...}",
"auth_response": {
"access_token": "eyJhbGc...",
"id_token": "eyJhbGc...",
"token_type": "DPoP",
...
}
}
The automated extraction performs:
complete_auth_data.jsonDuration: ~15-20 seconds
test_credentials.jsonFor continuous integration environments:
complete_auth_data.jsondart run integration_test/utils/extract_tokens.dart before testsIMPORTANT:
✅ DO:
.gitignore❌ DON’T:
test_credentials.json with real passwordsProblem: extract_tokens.dart fails to find browser
Solution:
# Linux
sudo apt install chromium-browser
# macOS
brew install chromium
# Windows
# Download Chrome from https://www.google.com/chrome/
Problem: Browser automation times out
Solution:
# Run with visible browser to debug
dart run integration_test/utils/extract_tokens.dart --no-headless
Problem: Login fails during extraction
Solution:
test_credentials.jsonProblem: flutter test fails with “No device found”
Solution:
# Check enabled platforms
flutter config
# Enable desktop platform
flutter config --enable-linux-desktop # or --enable-windows-desktop
# Verify devices available
flutter devices
After completing setup:
flutter test integration_test/app_test.dart -d linuxflutter test integration_test/workflows/pod_favorites_real_test.dart -d linuxmake qtest.all for quick automated testing