E2E Testing with Protractor
Protractor is the UI testing tool for testing AngularJS apps. It uses Selenium to automate the browser.
To write your own e2e tests, check our example e2e scenarios in scenarioo-client\test\protractorE2E\specs
.
For more infos on Protractor see Protractor API documentation.
Run all e2e tests
Prerequisites
Have a well configured and running Scenarioo server (Java backend)
- The server has to use the newest version of demo configuration that is checked in here:
scenarioo-server/src/main/resources/config-for-demo/config.xml
You should copy the newest version of this file to your Scenarioo configuration directory before running the e2e tests. - Make sure you use the newest version of demo data generated by running JUnit tests in scenarioo-docu-generation-example before running the e2e tests (to be sure that there is now outdated old files it might be better to do a clean build of this project first!)
- Make sure the configuration of your server has the directory configured to the directory where you generated the example demo data (change it accordingly!)
- The server has to use the newest version of demo configuration that is checked in here:
Have protractor installed (done in quickstart, by npm install)
Have the chrome webdriver installed (make sure your chromebrowser is up-to-date, > v30.x). This is done automatically if you use
npm run pretest-e2e
If there's a problem with the webdriver, try the following commands:
On Unix systems:
./node_modules/protractor/bin/webdriver-manager update --chrome
On Windows:
node ./node_modules/protractor/bin/webdriver-manager update
or
node node_modules\protractor\node_modules\webdriver-manager update
Run the tests
Open your console and change into the client directory.
cd scenarioo-client
Serve the client using gulp:
npm start
or
gulp serve
Open a 2nd console and run the tests:
gulp test-e2e-scenarioo
If you do not want to generate a scenarioo docu from the tests, run this:
npm run test-e2e
or
gulp test-e2e
Gulp runs the e2e tests according to the config file protractor-e2e.conf.js
(no Scenarioo documentation) or protractor-e2e-scenarioo.conf.js
(with Scenarioo documentation).
This should open a new browser window, run all tests and log test-information to the console.