This repository provides automated testing infrastructure for WebViews on Android and iOS platforms, specifically designed to run the mdn-bcd-collector and upload results to the webview-bcd-results repository.
- Platform: Android WebView
- Apps Tested: CanIAndroidWebView
- Method: Direct CDP (Chrome DevTools Protocol) WebSocket connection
- What it does:
- Launches the Android app in an emulator
- Connects to the WebView via CDP
- Navigates to collector.openwebdocs.org
- Waits 30s for the collector to gather browser feature data
- Captures the BCD (Browser Compatibility Data) results
- Saves results to
test-results/android-results.json
- Platform: iOS WKWebView
- Apps Tested: CanIWKWebView
- Method: Appium + XCUITest for simulator automation
- What it does:
- Boots an iOS simulator
- Launches the iOS app via Appium
- Connects to the app's WebView context
- Navigates to collector.openwebdocs.org
- Waits 30s for the collector to gather browser feature data
- Captures the BCD results
- Saves results to
test-results/ios-results.json
- Runs weekly on Sundays at 2 AM UTC
- Can also be triggered manually via
workflow_dispatch
- Android: API levels 29, 30, 33, 34
- iOS: Latest available version on macos-26 runner
- Setup Node.js, Java, Android SDK
- Clone and build CanIAndroidWebView app
- Start Android emulator with the specified API level
- Install the app
- Run tests via
npm run test:android - Upload results to webview-bcd-results (if
RESULTS_UPLOAD_TOKENis set) - Archive test artifacts
- Setup Node.js and Appium
- Clone and build CanIWKWebView app
- Boot iOS simulator
- Install the app
- Start Appium server
- Run tests via
npm run test:ios - Upload results to webview-bcd-results (if
RESULTS_UPLOAD_TOKENis set) - Archive test artifacts
- Downloads all test artifacts
- Creates a comprehensive summary showing:
- Test status (✅ passed / ❌ failed) for each platform/version
- Device information
- Number of BCD features collected
- Link to the results repository
- Co-author attribution notice
Results are automatically uploaded to the webview-bcd-results repository with:
- Timestamped filename:
results/{platform}-{timestamp}.json - Latest result:
results/latest-{platform}.json - Commit message includes device info and WebView version
- All commits include co-author attribution:
Co-authored-by: GitHub Copilot <copilot@github.com>
- Tests properly propagate errors from
beforeAllsetup - Failed tests return non-zero exit codes
- Results are saved even if tests fail
- CI jobs fail properly when tests fail
# Setup
npm run setup:android-app
cd apps/CanIAndroidWebView && ./gradlew assembleDebug
# Run tests (requires emulator or device)
npm run test:android# Setup
npm run setup:ios-app
cd apps/CanIWKWebView
xcodebuild -project CanIWKWebView.xcodeproj \
-scheme CanIWKWebView \
-configuration Debug \
-sdk iphonesimulator
# Run tests (requires booted simulator)
npm run test:iosRESULTS_UPLOAD_TOKEN: GitHub personal access token withreposcope for uploading to webview-bcd-results
- Commit template configured with
.gitmessage-copilotfor co-author attribution - All future commits in this repo will automatically include Copilot co-author
✅ Simplified Tests: Single test per platform focused on BCD collection
✅ Proper Error Handling: Failures are correctly detected and reported
✅ Comprehensive Results: Captures device info, WebView version, and full BCD data
✅ Automated Uploads: Results automatically pushed to dedicated repository
✅ Attribution: All work properly credited with co-author tags
✅ CI/CD Ready: Full GitHub Actions workflow with matrix testing
✅ Summary Reports: Human-readable test summaries in GitHub Actions UI
{
"timestamp": "2024-03-28T10:00:00.000Z",
"platform": "android",
"osVersion": "11",
"deviceModel": "Google Pixel 5",
"webviewVersion": "83.0.4103.120",
"testUrl": "https://collector.openwebdocs.org/",
"results": {
"bcd-collection": {
"status": "passed",
"duration": 35000,
"data": {
"userAgent": "Mozilla/5.0 ...",
"dataSize": 125000,
"bcdCount": 1500,
"resourceCount": 250
}
}
},
"metadata": {
"collectorData": {
"userAgent": "...",
"bcd": { /* full BCD data */ },
"resources": { /* resource data */ }
}
}
}- ✅ Setup complete
- ✅ Tests simplified and working
- ✅ Error handling fixed
- ✅ Co-author attribution configured
- 🔄 Monitor weekly runs
- 📊 Analyze collected BCD data in webview-bcd-results repo