Friday, March 11, 2016

promises, promises

At work I've been learning Protractor by the time-honored method of "pick stuff up on the fly from existing code" without taking the time to sit and read much.

A coworker used the same technique, so together I was able to correct their code... if you're reading from an input element, maybe one selected like this:
this.dealNameField = element(by.model(''));

You probably want

and NOT

(I was surprised there wasn't a convenience function ala .getValue() , akin to what's there in jQuery land)

More significantly, I was harshly reminded that Protractor deals with promises, and if you try to do a lot of poking around with the requisite expect() type code, you're in for a world of confusion.

Also, note to future self,
is a pretty useful construct (where widget.alertMessage was the element css selector thingy)

No comments:

Post a Comment