7CC005 Workshop w6

From mi-linux
Revision as of 16:43, 28 February 2017 by In9352 (talk | contribs)
Jump to navigationJump to search

Main Page >> Web Technologies >> Workbook >> Week 07 - Automated Web Testing

This is how to get the QuickStart project to work with Karma and PhantomJS.

Clone the repository

$ git clone https://github.com/angular/quickstart.git
$ cd quickstart

Install phantomjs and phantomjs launcher

$ npm install --save-dev phantomjs $ npm install --save-dev karma-phantomjs-launcher 3. Change karma.conf.js // First change require('karma-chrome-launcher') => require('karma-phantomjs-launcher') // Second change browsers: ['Chrome'] => browsers: ['PhantomJS'] 4. Install Quickstart App $ npm install 5. Run tests $ npm test

PhantomJS 2.1.1 (Linux 0.0.0) ERROR TypeError: undefined is not a function (evaluating 'System.config') at karma-test-shim.js:30 I have solved this issue appending system-polyfills.js to karma.conf.js: files: [

 // System.js for module loading
 'node_modules/systemjs/dist/system.src.js',
 'node_modules/systemjs/dist/system-polyfills.js',

THEN IT WORKED.