Front-end Testing Options

This page covers Front-end Testing options for the applications which support Clue Ride.

Edit Image:

Front-end testing options

Functional Testing

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.

Ionic Serve

The Ionic application is intended to be deployed to an actual device and runs as an App. However, it is possible to debug the application as a web-based JavaScript application (Angular) using ‘ionic serve’.

This allows:

  • 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.

ionic browser

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.

Unit Testing

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.

ionic device

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.



Leave a Reply

Your email address will not be published. Required fields are marked *