Created
August 27, 2013 13:57
-
-
Save vtanathip/6353866 to your computer and use it in GitHub Desktop.
Sometime when you use yeoman you must add more config to Gruntfiles.js & karma-e2e.conf.js to complete it. the easiest to test e2e in angular is open server with grunt and add proxies to karma-e2e.conf.js then run it. By the way I found that sometimes when you use old version of angular-generator yo will fail when run test (it will start up but …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add this config to karma-e2e.conf.js | |
// Uncomment the following lines if you are using grunt's server to run the tests | |
proxies = { | |
'/': 'http://localhost:9000/' | |
}; | |
// URL root prevent conflicts with the site root | |
urlRoot = '_karma_'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
describe("E2E testing basic route", function() { | |
beforeEach(function() { | |
browser().navigateTo('/'); | |
}); | |
it('should navigate to somewhere ', function() { | |
expect(browser().location().url()).toBe("/"); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karma: { | |
//add this e2e for load config files | |
e2e: { | |
configFile: 'karma-e2e.conf.js', | |
singleRun: true | |
}, | |
unit: { | |
configFile: 'karma.conf.js', | |
singleRun: true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment