Reputation: 3731
I'm looking for a way to get access to the baseUrl I've passed via the command line. Eg.
protractor conf.js --baseUrl=http://myawesomesite.com
I've tried browser.baseUrl
returns me the baseUrl
set in my conf.js
, but seemingly not the one passed from the command line.
Upvotes: 3
Views: 1501
Reputation: 3731
browser.baseUrl
IS the way to get the baseUrl...
The reason I thought there might be a different way to get the command line baseUrl, was because my tests were failing on browserstack. It was either ignoring the baseUrl passed from the command line, and using the default in the config. Removing the default in the config, then failed because it was blank.
Not sure what the solution for this is... because it just started working again. Could have been caching (though I don't know where), or perhaps Jasmine2 (since the issue was called in a BeforeAll block)?
Anyway, wanted to update this and thank the answerers for their help!
Upvotes: 3
Reputation: 610
I do not see your conf.js, but if you have somehting like this:
params: {
screenWidth: 1920,
screenHeight: 1080,
}
In this case it should be done this way:
protractor conf.js --params.screenWidth=1024
Upvotes: 0