boatcoder
boatcoder

Reputation: 18107

How do I include lodash in my protractor test specs?

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

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

I'm not asking how to use it in my app, but in the actual running protractor scripts

Upvotes: 3

Views: 2681

Answers (1)

Andres D
Andres D

Reputation: 8900

You can use the native Array.forEach(). If you need lodash do this:

Get the node dependency.

npm install lodash --save-dev

Then use it in your test.

var _ = require('lodash');

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

Upvotes: 4

Related Questions