When I try to run Protractor tests from the command line, all my tests fail, because whenever I try to access the protractor object, I don't have the required methods. Exact error:
TypeError: Object # does not have a getInstance method
So this was apparently reported and fixed , but I seem to be unable to resolve my specific situation. This also looks like this question, but since it came up for me after updating my node_modules, I feel that my main problem is different. Prior to updating my Transporter, everything worked fine.
I installed it globally and used npm link protractor to link my local instance to my global instance (located in /usr/local/lib/node_modules/protractor ), but I still canβt understand for life whatβs wrong.
The exact code I'm calling protractor in is a page object file that looks like this:
module.exports = function() { var ptor = protractor.getInstance(); this.get = function() { browser.get('http://localhost'); this.title = ptor.getTitle(); }; };
The code that instantiates the page object is as follows:
var Login = require('./pageObjects/Login.po.js'); ... var LoginPage = new Login();
Aaron source share