-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Protractor timeout must be set to >30 seconds when using auth #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @surajbarkale-dolby! This is an outstanding issue with Auth and Protractor.We could solve it by running certain parts of Auth outside of the Angular zone but it's going to take some time to flesh out. I'll look into it and see what I can do. |
@surajbarkale-dolby Another workaround is this community maintained plugin: https://www.npmjs.com/package/protractor-testability-plugin. Your specs may finish before Firebase, but you can use |
Hi @codediodeio, do you have any examples of |
Underlying cause is the same as #1347, closing this one |
Version info
Angular: 5.0.1
Firebase: 4.6.2
AngularFire: 5.0.0-rc.3
Other (e.g. Ionic/Cordova, Node, browser, operating system): Node 6.12, Chrome 62
How to reproduce these conditions
Steps to set up and reproduce
ng e2e
). It should complete successfully within a second.AngularFireModule.initializeApp()
&AngularFireAuthModule
to NgModule in app.module.tsconstructor(public af: AngularFireAuth) {}
line toAppComponent
class.Expected behavior
Executing e2e tests again should complete successfully
Actual behavior
Executing e2e tests produces following output:
Workaround
Set
allScriptsTimeout
to 35000 &defaultTimeoutInterval
to 60000 inprotractor.conf.js
. Since tests stat after 30 seconds.Root cause
The
AngularFireAuth
class subscribes foronAuthStateChanged()
andonIdTokenChanged()
when it is created. The firebase auth code initializes state and startsRedirectAuthEventProcessor
timer. All this is done in the angular zone causing it to block protractor till the timer is fired after 30 seconds.Fix
This should be fixed in AngularFire by subscribing to observers outside the angular zone. Sadly my Rx foo is not good enough to provide a patch to make this change.
The text was updated successfully, but these errors were encountered: