Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS - Karma (e2e) : Executed 0 of 0 ERROR

I am experiencing a problem which I could not solve for some time, and getting very frustrating since I don't have an idea what I am doing wrong in it. :) Any help is much appreciated. I am using requirejs in my applications as well. This is basically what I am trying to build; https://github.com/Cengizism/base

When I try to start my e2e test I get this on my console;

INFO [karma]: Karma v0.10.0 server started at http://localhost:8080/_karma_/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 28.0.1500 (Mac OS X 10.8.4)]: Connected on socket id n-0AVRliCogs2nWBfgDz
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 0 of 0 ERROR (0.208 secs / 0 secs)

My configuration file looks like this;

module.exports = function(karma) {
    'use strict';

    karma.set({
        frameworks: ['jasmine', 'ng-scenario'],

        files: [
          'app/vendors/angular-scenario/angular-scenario.js',
          'test/e2e/*.js'
        ],

        basePath: '',

        exclude: [],

        reporters: ['progress'],

        port: 8080,

        runnerPort: 9100,

        colors: true,

        logLevel: karma.LOG_INFO,

        autoWatch: true,

        browsers: ['Chrome'],

        captureTimeout: 5000,

        singleRun: false,

        proxies: {
          '/': 'http://localhost:9000/'
        },

        urlRoot: '/_karma_/',

        plugins: [
          'karma-jasmine',
          'karma-ng-scenario',
          'karma-chrome-launcher',
          'karma-firefox-launcher',
          'karma-phantomjs-launcher'
        ]
    });
};

and finally the spec file;

describe('Simple E2e Test', function()
{
    it('Should open the front page and check', function()
    {
        browser().navigateTo('/#/partial1');

        sleep(1);

        expect(element('#test').html()).toEqual('Hi testUser1');
    });
});
like image 434
Cengiz Ulusoy Avatar asked Aug 07 '13 11:08

Cengiz Ulusoy


3 Answers

Maybe this could help you:

To fix it, the following line should be included in karma.conf.js

exclude: ['app/lib/angular/angular-scenario.js'],

Source : https://github.com/angular/angular-phonecat/issues/71

like image 57
Drahakar Avatar answered Nov 13 '22 19:11

Drahakar


I'm not exactly clear on this either, but after running into this issue I removed the file angular-scenario from loading and was able to get the tests to run. I believe the problem is the difference between unit testing and e2e testing configuration.

like image 4
Ty Danielson Avatar answered Nov 13 '22 19:11

Ty Danielson


I had this same error, and it went away once I started adding some tests. Is it possible the error just means there aren't any tests present?

like image 3
Brian Westrich Avatar answered Nov 13 '22 19:11

Brian Westrich