I am currently working on creating some basic end-to-end tests (e2e) for a Django/AngularJS application using Karma, and I've encountered an unusual error.
Below is the test code I have written:
# testacular-e2e.conf.js
describe('Log in tests', function() {
it('should show the disconnected home', function() {
browser().navigateTo('/#');
expect(browser().location().url()).toBe('/#');
});
});
Upon running this code, I receive the following output:
[DEPRECATED ERROR - left for reference only]
$>karma start testacular-e2e.conf.js
[2013-04-30 22:19:26.465] [WARN] config - "/" is proxied, you should probably change urlRoot to avoid conflicts
[2013-04-30 22:19:26.467] [DEBUG] config - autoWatch set to false, because of singleRun
INFO [karma]: Karma server started at
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9 (Mac)]: Connected on socket id cwhp0lnTraNa4ToQ0HkS
PhantomJS 1.9 (Mac) Log in tests should show the disconnected home FAILED
TypeError: 'undefined' is not a function (evaluating '$document.injector()')
PhantomJS 1.9 (Mac): Executed 1 of 1 (1 FAILED) (0.098 secs / 0.04 secs)
Would appreciate any assistance?
Thank you in advance :)
EDIT: Here is my updated Karma configuration file:
// Updated Karma configuration
// base path for files and excludes
basePath = '';
// frameworks used
frameworks = ['jasmine', 'ng-scenario'];
// list of files and patterns to load
files = [
'app/components/angular/angular.js',
'app/components/angular-complete/angular-resource.js',
'app/components/angular-complete/angular-cookies.js',
'app/components/angular-mocks/angular-mocks.js',
'app/components/ng-translate/translate.js',
'app/scripts/*.js',
'app/scripts/services/services.js',
'app/scripts/**/*.js',
'test/spec/**/*.js'
];
// other configurations...
For more information or details about specific files being imported, please let me know.