This repository includes the blank starter template that is installed through the Ionic-CLI with:
$ ionic start blank --v2 --ts
.
It also includes preconfigured karma and protractor configuration files and test templates.
$ git clone https://github.com/bhoward-mlock/Ionic2-Blank-Karma-Protractor.git
$ cd Ionic2-Blank-Karma-Protractor
$ npm install
$ npm install -g ionic@beta cordova karma-cli protractor webdriver-manager
$ webdriver-manager update
- All unit tests should be added as app/**/.spec.ts
- This is the Angular2 convention.
- See testing/template.spec.ts for a template.
- In the terminal, run
karma start testing/karma.conf.js
- Test results are reported in the terminal window.
- They are also saved to the disk at /testing/unit-tests/results/*.html
- All end to end tests should be added as app/**/.e2e.js
- See testing/template.e2e.js for a template.
- In a new terminal window, run
webdriver-manager start
.
- This starts the selenium server. Keep this window open.
- In a new terminal window, run
ionic serve
. - In a new terminal window, run
protractor testing/protractor.conf.js
. - Test results are reported in the terminal window.
- They are also saved to the disk at /testing/end-to-end-tests/.html