protractor icon indicating copy to clipboard operation
protractor copied to clipboard

protractor.getInstance() broken after updating from 1.4.0 to 1.5.0

Open tempoc opened this issue 11 years ago • 5 comments

My environment used to use gulp-protractor 0.0.11 to run protractor. It doesn't have a constraint on protractor version so it always downloaded the latest. As of protractor 1.4.0 my tests run fine.

When protractor 1.5.0 came our a fresh build broke my tests until I went and specifically asked npm for protractor 1.4.0. I checked the change list but can't find anything relating to the problem I see.

_protractor.getInstance is no longer available, all else being the same, with 1.5.0 instead of 1.4.0_

tempoc avatar Dec 09 '14 17:12 tempoc

This is intended, but you are correct that it is missing from the Changelog. I apologize, I did the changelog update for this version and should have noted it. Will submit an update noting the change.

juliemr avatar Dec 09 '14 18:12 juliemr

Also - we should investigate why gulp-protractor uses getInstance, and submit a PR to update.

juliemr avatar Dec 09 '14 18:12 juliemr

Thanks for the quick response. A couple of notes:

  • gulp-protractor doesn't use getInstance (that I know of). It just fails to specify a version of protractor making builds non-deterministic unless you specify the version yourself.
  • We were using getInstance in our project to, for example:
var instance = protractor.getInstance();
instance.actions().sendKeys(...).perform();

What is the suggested approach?

tempoc avatar Dec 09 '14 18:12 tempoc

Changelog is now updated. You should be able to just use browser, i.e.

browser.actions().sendKeys(...).perform();

juliemr avatar Dec 09 '14 18:12 juliemr

I confirmed that gulp-protractor is not using getInstance. I believe this issue can now be closed - please open up a new one if there are issues getting stuff working on 1.5!

juliemr avatar Dec 09 '14 18:12 juliemr