How to include lodash in protractor test specs?

I want to use lodash functions in protractor spec, I use _.forEach () to fill in a form with values.

How do I get lodash into my script protractor so I can use it?

I am not asking how to use it in my application, but in real protranggraph scenarios

+3


source to share


1 answer


You can use your own Array.forEach (). If you need lodash, do this:

Get the dependency node.

npm install lodash --save-dev

      



Then use it in your test.

var _ = require('lodash');

describe('foo', function() {
  it('should do stuff', function() {
    _.each();
  });
})

      

+4


source







All Articles