This page covers Front-end Testing options for the applications which support Clue Ride.
Edit Image: https://sketchboard.me/bAKpG1QLVeKG#/
Also called “End-to-End” or “Integration” testing since the tests exercise not only the front-end, but also the supporting back-end services.
Behavior-Driven Development (BDD)
This is implemented using Gherkin, a language that supports tests written in the User’s Language and centered on the value provided to the actors in a given User Story. Underneath, Python-wrapped Selenium API calls out to the browser to test the Front-end server running against an actual back-end server. “Ionic Serve” spins up the front-end within a Browser so the BDD code can find it.
- Running under the Chrome debugger.
- Checking CSS Styling dynamically (“WYSIWYG”)
- Rapid development via Webpack: change the code, reload the browser and the changes show up.
If the native API needs to be exercised, there is the option to run the code using the browser as the “device”. This may limit what the device is able to do (GPS and orientation, for example may be missing on a desktop browser), but at least the native APIs won’t completely fail.
Once Jasmine tests are written (and configured to run under Karma), the npm command to test can be kicked off. This provides running the entire suite of Jasmine tests, code coverage reports, and ability to automate as part of a build.
If the Jasmine tests need to exercise the native device’s functionality, it is possible to run the code on the device and connect the chrome browser’s debugger to that device.