You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.7 KiB
1.7 KiB
Test API Server Setup
Overview
The Test API Server provides mock endpoints for testing the Daily Notification Plugin's network functionality, including ETag support, error handling, and content fetching.
Quick Setup
# Navigate to test-api directory
cd test-apps/test-api
# Install dependencies
npm install
# Start server
npm start
Integration with Test Apps
Update Test App Configuration
Add the API base URL to your test app configuration:
// In your test app's config
const API_CONFIG = {
baseUrl: 'http://localhost:3001', // Adjust for platform
endpoints: {
content: '/api/content',
health: '/health',
error: '/api/error',
metrics: '/api/metrics'
}
};
Platform-Specific URLs
- Web/Electron:
http://localhost:3001
- Android Emulator:
http://10.0.2.2:3001
- iOS Simulator:
http://localhost:3001
- Physical Devices:
http://[YOUR_IP]:3001
Testing Workflow
- Start API Server:
npm start
intest-apps/test-api/
- Start Test App: Run your platform-specific test app
- Test Scenarios: Use the test app to validate plugin functionality
- Monitor API: Check
/api/metrics
for usage statistics
Available Test Scenarios
Content Fetching
- Basic content retrieval
- ETag conditional requests
- Content updates and caching
Error Handling
- Network timeouts
- Server errors
- Rate limiting
- Authentication failures
Performance Testing
- Concurrent requests
- Memory usage monitoring
- Long-running scenarios
Next Steps
- Start the API server
- Configure your test apps to use the API
- Run through the test scenarios
- Validate plugin functionality across platforms