Here's a quick example of a test that clicks a field to enter in some value:
it('should enter someValue into field', function() {
var field = $('.someField');
// Insert timer start function here
field.click();
this.switchToActiveElement().sendKeys('someValue');
this.hitEnter();
// Insert timer stop function here and output result!
assert.eventually.equal(field.getText(), 'someValue');
});
What I'd like to do is time how long it takes click the field and enter in some value, then output the execution time of this somehow. I was originally thinking I could just insert console.time()
and console.timeEnd()
functions but of course this won't work with protractor's control flow, right?
Any help with this would be very much appreciated. Thanks!