> npm install -g generator-protractor
> yo protractor
> npm install grunt-protractor-runner --save-dev
grunt.loadNpmTasks('grunt-protractor-runner');
protractor:
test: true;
options: { configFile: "protractor.conf.js", keepAlive: true, // If false,grunt stops when the test fails. noColor: false, // If true, not use colors in output. args: { // Arguments passed to the command } }, chrome: { options: { args: { browser: "chrome" // phantomJS, Safari, etc } } } }
./node_modules/protractor/bin/webdriver-manager start
./node_modules/protractor/bin/webdriver-manager update
chromeDriver: './node_modules/protractor/selenium/chromedriver', |
speeds up your tests a lot and AngularJS uses tricks like these in their core code to reduce about one trillion CPU cycles each time the testing suite is run ($httpBackend for example is used to mock HTTP responses for routes, templates and AJAX calls).
$httpBackend
browser.debug()