We are using Protractor to test our AngularJS application. We need to import and use other Javascript libraries like Underscore and Chance(random generator) in my Protractor Test cases. Can someone please let me know how to do the same - thanks.
Asked
Active
Viewed 1,204 times
1 Answers
4
Add the dependency:
npm install underscore --save
Then use it in your test:
var _ = require('underscore');
describe('', function(){
it('should use underscore', function(){
_.
});
});

Andres D
- 8,910
- 2
- 26
- 31
-
Add `_ = require('underscore')` to protractor.conf.js for global configuration. – KevinO Nov 18 '16 at 20:16