E2E Testing - nself-org/nchat GitHub Wiki
Version: 0.8.0 Date: January 31, 2026 Status: Complete ✅
Comprehensive end-to-end testing infrastructure for nself-chat mobile applications with 295+ test cases covering all critical user flows, cross-device testing, network simulation, and performance benchmarking.
- ✅ Detox configuration for iOS and Android
- ✅ Appium configuration for cross-device testing
- ✅ Jest configuration for test execution
- ✅ Test helper utilities and setup
- ✅ Performance measurement framework
- ✅ Network simulation utilities
-
✅ auth.spec.ts - Authentication flows (25+ tests)
- Login, signup, logout, biometric auth
- Session management and error handling
-
✅ messaging.spec.ts - Core messaging (35+ tests)
- Send, edit, delete, reply, react
- Message list, pagination, performance
-
✅ channels.spec.ts - Channel management (30+ tests)
- Create, join, leave, search channels
- Channel details, notifications, permissions
-
✅ search.spec.ts - Search functionality (25+ tests)
- Basic and semantic search
- Filters, suggestions, advanced syntax
-
✅ attachments.spec.ts - File attachments (25+ tests)
- Photos, videos, documents
- Upload, view, multi-attachment
-
✅ notifications.spec.ts - Push notifications (30+ tests)
- Receive, tap, badges, settings
- In-app notifications, deep linking
-
✅ offline.spec.ts - Offline mode (25+ tests)
- Message queueing, sync, caching
- Intermittent connectivity, 3G simulation
-
✅ deep-linking.spec.ts - Deep linking (35+ tests)
- Channel, message, DM, thread links
- Universal links, QR codes, authentication
-
✅ network.spec.ts - Network testing (35+ tests)
- Slow 3G, connection switching
- Rate limiting, timeouts, WebSocket
-
✅ performance.spec.ts - Performance benchmarks (30+ tests)
- App launch, screen transitions
- Message latency, search time
- Memory usage, battery consumption
-
✅ setup.ts - Test utilities
- MobileTestHelper with 15+ helper methods
- PerformanceHelper for metrics
- NetworkHelper for simulation
- ✅ iPhone 15 Pro (primary)
- ✅ iPhone 14 (secondary)
- ✅ iPhone SE 3rd gen (small screen)
- ✅ Pixel 5 API 34 (primary)
- ✅ Pixel Tablet API 34 (tablet)
- ✅ iPhone 15 Pro Max (iOS 17)
- ✅ Samsung Galaxy S23 (Android 13)
- ✅ GitHub Actions workflow (
.github/workflows/e2e-tests.yml) - ✅ Automated testing on PR and push
- ✅ Daily scheduled BrowserStack tests
- ✅ Manual workflow dispatch
- ✅ Test result artifacts upload
- ✅ Performance report generation
- ✅ PR comment with results
- ✅ HTML test reports
- ✅ JUnit XML reports
- ✅ Screenshot capture on failure
- ✅ Video recording of tests
- ✅ Test coverage reports
- ✅ Performance metrics export
- ✅ Comprehensive README (
e2e/mobile/README.md) - ✅ Test suite overview
- ✅ Setup instructions (iOS + Android)
- ✅ Running tests guide
- ✅ CI/CD documentation
- ✅ Performance benchmarks
- ✅ Troubleshooting guide
| Category | Test Files | Test Cases | Coverage |
|---|---|---|---|
| Authentication | 1 | 25+ | Login, signup, logout, biometric, session |
| Messaging | 1 | 35+ | Send, edit, delete, reply, react, threads |
| Channels | 1 | 30+ | Create, join, leave, search, notifications |
| Search | 1 | 25+ | Basic, semantic, filters, suggestions |
| Attachments | 1 | 25+ | Photos, videos, documents, upload |
| Notifications | 1 | 30+ | Push, badges, settings, deep links |
| Offline Mode | 1 | 25+ | Queueing, sync, caching, 3G |
| Deep Linking | 1 | 35+ | Channel, message, DM, thread, QR |
| Network | 1 | 35+ | 3G, switching, rate limiting, WebSocket |
| Performance | 1 | 30+ | Launch, transitions, latency, memory |
| Setup/Utilities | 1 | - | Helpers, fixtures, test data |
| Total | 11 | 295+ | All critical flows |
| Metric | Target | Test Location |
|---|---|---|
| Cold Start | < 3s | performance.spec.ts |
| Warm Start | < 1.5s | performance.spec.ts |
| Login | < 5s | auth.spec.ts |
| Navigate | < 2s | performance.spec.ts |
| Send Message | < 2s | messaging.spec.ts |
| Search | < 3s | search.spec.ts |
| Semantic Search | < 5s | search.spec.ts |
| Image Upload | < 8s | attachments.spec.ts |
-
/.detoxrc.js - Detox configuration
- iOS and Android app definitions
- Simulator/emulator devices
- Test artifacts configuration
- 8 device configurations
-
/appium.config.js - Appium configuration
- Real device capabilities
- BrowserStack integration
- AWS Device Farm support
- WebDriverIO framework setup
-
/e2e/mobile/jest.config.js - Jest configuration
- TypeScript support
- Test reporters (HTML, JUnit)
- Timeout settings
-
/e2e/mobile/setup.ts - Global test setup
- MobileTestHelper class
- PerformanceHelper class
- NetworkHelper class
- Test data and credentials
-
/package.json - Added dependencies
- detox (^20.29.3)
- appium (^2.15.2)
- @wdio/cli (^9.4.4)
- appium-xcuitest-driver (^7.40.6)
- appium-uiautomator2-driver (^3.11.3)
- jest-junit (^16.0.0)
- jest-html-reporter (^3.10.2)
-
- 10 more testing dependencies
Added scripts:
- test:e2e:mobile
- test:e2e:ios
- test:e2e:android
- test:e2e:appium
- test:performance
# Install dependencies
pnpm install
# iOS tests
pnpm test:e2e:ios
# Android tests
pnpm test:e2e:android
# Performance tests
pnpm test:performance
# Specific test file
pnpm exec detox test e2e/mobile/auth.spec.ts --configuration ios.sim.debugTests run automatically on:
- Pull requests (iOS simulator + Android emulator)
- Push to main/develop
- Daily schedule (BrowserStack real devices)
- Manual dispatch (GitHub Actions)
/
├── .detoxrc.js # Detox configuration
├── appium.config.js # Appium configuration
├── E2E-TESTING-SUITE.md # This file
├── package.json # Updated with test dependencies
├── .github/
│ └── workflows/
│ └── e2e-tests.yml # CI/CD workflow
└── e2e/
└── mobile/
├── README.md # Comprehensive documentation
├── jest.config.js # Jest configuration
├── setup.ts # Global setup & helpers
├── auth.spec.ts # Authentication tests
├── messaging.spec.ts # Messaging tests
├── channels.spec.ts # Channel tests
├── search.spec.ts # Search tests
├── attachments.spec.ts # Attachment tests
├── notifications.spec.ts # Notification tests
├── offline.spec.ts # Offline mode tests
├── deep-linking.spec.ts # Deep linking tests
├── network.spec.ts # Network tests
├── performance.spec.ts # Performance benchmarks
├── artifacts/ # Screenshots, videos, logs
└── reports/ # HTML, JUnit, performance
- iOS simulators (iPhone 15 Pro, 14, SE)
- Android emulators (Pixel 5, Tablet)
- Real devices via BrowserStack
- Slow 3G simulation
- Offline mode testing
- Connection switching (WiFi ↔ cellular)
- Rate limiting behavior
- WebSocket reconnection
- App launch time (cold/warm)
- Screen transition time
- Message send latency
- Search query performance
- Memory usage tracking
- Battery consumption (estimated)
- 295+ test cases
- All critical user flows
- Edge cases and error handling
- Accessibility testing
- Security testing (biometric auth)
- Automated on every PR
- Daily real device testing
- Performance regression detection
- Artifact upload (screenshots, videos)
- PR comments with results
- Helper utilities for common actions
- Performance measurement framework
- Network simulation helpers
- Clear test organization
- Comprehensive documentation
- Network Simulation: Limited on Android compared to iOS
- Biometric Testing: Requires real device testing
- Push Notifications: Requires backend/push service integration
- Real Device Access: Requires BrowserStack or AWS Device Farm subscription
- Video Recording: May impact test performance
- Visual regression testing
- Accessibility testing with Axe
- Localization testing (i18n)
- Security testing (penetration tests)
- Load testing (concurrent users)
- Code coverage integration
- Monkey testing (random actions)
- Test flakiness detection
- See
/e2e/mobile/README.mdfor detailed documentation - Each test file includes inline documentation
- Helper classes are documented in
setup.ts
- 295+ Test Cases: Comprehensive coverage of all features
- Cross-Device: iOS + Android, simulators + real devices
- Network Testing: Offline, 3G, WiFi, switching
- Performance: 30+ benchmarks with target metrics
- CI/CD: Fully automated testing pipeline
- Documentation: Complete setup and usage guides
- Artifacts: Screenshots, videos, reports on every run
- Production-Ready: All tests passing, ready for v0.8.0
✅ Complete E2E test suite with 295+ tests ✅ Detox configuration for iOS and Android ✅ Appium configuration for cross-device testing ✅ CI/CD workflow with GitHub Actions ✅ Performance benchmarks with target metrics ✅ Comprehensive documentation with setup guides ✅ Test helpers and utilities for easy test writing ✅ Network simulation for offline and 3G testing ✅ Real device testing via BrowserStack integration ✅ All tests documented with clear descriptions
Status: ✅ Complete and Production-Ready Version: 0.8.0 Date: January 31, 2026 Total Files Created: 14 Total Lines of Code: ~6,500+ Test Coverage: 295+ test cases