13

In the introtokarma app, I changed the karma-e2e-config.js file as follows:

module.exports = function(config) {
  config.set({
    basePath : '../',
      files : ['tests/e2e/**/*.js'],
      frameworks: ['ng-scenario'],
      autoWatch : false,
      browsers : ['Chrome'],
      singleRun : true,
      proxies : {
        '/': 'http://localhost:8000/'
      },
      junitReporter : {
        outputFile: 'test_out/e2e.xml',
        suite: 'e2e'
      }
  });
};

When running the code, I get the following output:

C:\Project\introtokarma\config>karma start karma-e2e.conf.js
INFO [karma]: Karma v0.10.1 server started at localhost:9877/
INFO [launcher]: Starting browser Chrome
WARN [launcher]: The path should not be quoted.
Normalized the path to C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
INFO [Chrome 28.0.1500 (Windows 7)]: Connected on socket id pfBNNRs-3wAdgT-QsheL
Chrome 28.0.1500 (Windows 7): Executed 0 of 0 ERROR (0.207 secs / 0 secs)

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
Mel
  • 245
  • 5
  • 15

5 Answers5

26

For karma v0.10.2 and latest angular-phonecat try next command:

npm install -g karma-ng-scenario karma-junit-reporter

rkshnsk
  • 261
  • 2
  • 2
  • I tried all of the other suggestions, and was missing karma-junit-reporter. – matt weiss Sep 24 '13 at 22:43
  • 2
    the important thing is: use the `-g` flag to install it globally instead of locally: `npm help install` – scheffield Nov 16 '13 at 18:27
  • This helped! I wonder why this dependency is not mentioned in Angularjs tutorial. It's a step-by-step tutorial, I wonder why'd they oversee this clearly needed module. – ioleo Dec 30 '13 at 08:52
  • this needs to be in tutorial for sure. http://docs.angularjs.org/tutorial/step_03 – baskint Jan 11 '14 at 18:23
4

You need to change the files key array of the config block and add a frameworks key.

the files key looks like this:

files: [
    ANGULAR_SCENARIO,
    ANGULAR_SCENARIO_ADAPTER,
    'test/e2e/**/*.js'
]

Remove the ANGULAR_SCENARIO, and ANGULAR_SCENARIO_ADAPTER lines.

So, in the end, it just looks like this:

files: [
    'test/e2e/**/*.js'
]

Then add a framkeworks key with an array and one value of ng-scenario:

frameworks: ['ng-scenario']

Hope that helps.

Saran
  • 3,845
  • 3
  • 37
  • 59
1

Besides installing the karma-ng-scenario node module as @rkshnsk said, I also had to add it to the plugins array:

  plugins : ['karma-ng-scenario'],
Bernát
  • 1,362
  • 14
  • 19
0

It should be "test" instead of "tests" in

      files : ['tests/e2e/**/*.js'],
jrouquie
  • 4,315
  • 4
  • 27
  • 43
0

Thanks for your replies. I switched to karma 0.8.7 and everything works now.

Mel
  • 245
  • 5
  • 15