Apache Cordova Testing Guide (Legacy Hybrid Apps)
Cordova apps were the hybrid-mobile standard 2012-2018. Many apps remain on Cordova in 2026. Testing them requires working with a legacy framework that is still maintained but no longer the default fo
Cordova apps were the hybrid-mobile standard 2012-2018. Many apps remain on Cordova in 2026. Testing them requires working with a legacy framework that is still maintained but no longer the default for new projects. This guide covers practical approaches for existing Cordova apps.
What Cordova is
Web app (HTML + JS) wrapped in a WebView, with plugins exposing native functionality. Similar to Ionic's Capacitor but older and more rough around the edges.
Most Cordova apps in 2026:
- Are maintained but not new features
- Have deferred migration (to Capacitor, React Native, Flutter)
- Have accumulated technical debt
- Still need to work
Testing them is about confidence in legacy code.
Unit tests
Web code in Cordova is testable with Jest / Jasmine / Mocha like any web app:
import { login } from './auth';
test('login with valid creds', async () => {
const mockApi = { post: jest.fn().mockResolvedValue({success: true}) };
const result = await login('test@example.com', 'correct', mockApi);
expect(result.success).toBe(true);
});
Mock Cordova plugins (cordova-plugin-device, etc.) — all have global cordova.plugin.xxx references.
E2E testing
Browser testing (without Cordova)
Run the web app in a plain browser. Most flows work with native plugins stubbed. Playwright / Cypress drive the app.
Appium for full Cordova
Appium + WebView context switching:
// After launching app, switch to WebView context
await driver.switchContext('WEBVIEW_com.example');
// Now use web-style selectors
await driver.$('#email').setValue('test@example.com');
WebView context switch is idiosyncratic; requires enabled Chrome DevTools debugging for Android, Safari Developer Tools for iOS.
Plugin testing
Each Cordova plugin is a bridge to native. Testing the plugin in isolation:
- Native tests per platform (Objective-C / Swift for iOS, Java for Android)
- JS integration: plugin exposes API; unit tests call API with plugin mocked
Legacy challenges
Cordova + old OS versions
Older Cordova plugins may not support current iOS / Android. Fix: update plugin versions or migrate.
WebView quirks
Android System WebView varies by Android version. Older Android WebViews have weaker support. Test on minimum Android version.
Plugin deprecation
Many Cordova plugins abandoned. If using, risk is high. Consider Capacitor equivalents.
Build breakage
Gradle / CocoaPods updates often break Cordova builds. Periodic maintenance required.
Testing matrix
Minimum:
- iOS 13+
- Android 9+
- Chrome current + 1 back
Full:
- iOS 13, 15, 17
- Android 9, 11, 13, 14
- Samsung / Pixel / Xiaomi
Migration testing
When migrating off Cordova (to Capacitor, React Native, Flutter):
- Contract tests between old and new: same API responses
- UI parity tests: snapshots from old vs new
- Gradual rollout: Cordova and new co-exist, compare metrics
How SUSA tests Cordova apps
SUSA drives Cordova-built native apps like any other. WebView context is handled:
susatest-agent test cordovaapp.apk --persona curious --steps 200
Exploration surfaces bugs regardless of underlying framework. For Cordova specifically, WebView rendering differences vs current web are common findings.
Common bugs in maintained Cordova apps
- Plugin version incompatibility with new OS — feature broken after OS update
- WebView CSS differences — works in Chrome, broken on old Android WebView
- Cordova CLI version bumps — build fails
- XML parser differences in plugin configuration
- Certificate pinning plugin incompatible with newer TLS
Cordova still works in 2026, but its stewardship is low. If possible, migrate. If not, test conservatively and maintain plugin versions deliberately.
Test Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free