Closed erikdonohoo closed 9 years ago
Are you setting ingnoreSynchronisation to true when on the login page?
This will stop protractor looking for an angular app. I'm assuming here that login page is not an angular app.
It is indeed not an angular app. Where do you tell protractor to use ignoreSyncronisation
? In protractor.conf.js? I just browsed through the docs site and didn't see how to use that option
UPDATE
Found browser.ignoreSyncronization = true;
Will try that
My onPrepare
looks like this now...
onPrepare: function () {
// This will navigate to the project and sign on through lds auth
browser.ignoreSyncronization = true;
browser.get('/');
browser.sleep(250);
var loginUsername = browser.driver.findElement(by.id('IDToken1'));
loginUsername.sendKeys(browser.params.login.username);
var loginPassword = browser.driver.findElement(by.id('IDToken2'));
loginPassword.sendKeys(browser.params.login.password);
var signInButton = browser.driver.findElement(by.name('Login.Submit'));
signInButton.click();
browser.sleep(1000);
browser.ignoreSyncronization = false;
}
Still having same issue
What is the error message that you get?
Our onPrepare
is sending the app to /
to trigger the app to redirect to authenticate. After clicking sign in from the onPrepare code, it goes back to the app and runs the tests, being fully authenticated. This worked on 1.8.0. All I have to change is the version and it works again.
When the tests run do you see the login happen? and / or do you see the login screen appear?
Yes, the login screen appears, and then the window dies immediately with that error.
+1 Same issue,
onPrepare function is not execute correctly before my specs. My code works on protractor 1.8.0 but not with 2.0.0.
Something was missing in my conf file, sorry.
@felixbillon what was missing?
I change my html and forgot to change 'rootElement' in my protractor file conf. Not related to your issue.
It's spelled ignoreSynchronization
. Let me know if that fixes the problem
Closing stale issues. Please open a new issue if you feel there is still a general bug.
having the same, is this because I am bootstrapping angularjs manually (no ng-app in page)?
Not sure if this was a design change for 2.0.0 or not, but 1.8.0 and previous worked in our situation.
Basically, our app triggers a login to a 3rd party Oauth2 provider. We have been using an
onPrepare
block in ourprotractor.conf.js
to login and trigger the flow back to the app. But now protractor dies as soon as it arrives there because it can't find theng-app
attribute. Any suggestions or workarounds to achieve the old behavior on2.0.0
?