-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Testing hybrid Angular 1+2 app always fail #2944
Comments
I'm unfamiliar with hybrid angular, could you provide a small reproducible example that we can use to investigate? |
Sure! This is a simple hybrid app, do you need anything else?: A hybrid app is actually an Angular 1 app that can read angular 2 components. There is no big change from Angular 1 app expect the app bootstrapping:
instead of having The hybrid bootstraping is asynch, I guess it's the problem.. |
Unfortunately, this is a known issue. We plan on adding support for hybrid apps soon, though. |
Fixed with angular/angular#7603 If you need a work around now you can use the version of |
@bringking I havn't set it up yet .. |
Hello everyone, I ran in a similar issue, Starting from an angular 1.5 app, I am redirected to an angular 2 app. I can't get the config file to work properly. useAllAngular2AppRoots: true My tests on the angular1 app fails with: Failed: Cannot assign to read only property 'stack' of Error while waiting for Protractor to sync with the page: "window.getAllAngularTestabilities is not a function" and if I don't, my test on the ng2 app fails with: Failed: Error while waiting for Protractor to sync with the page: "Could not find testability for element." I need to keep all tests with the same protractor conf, because I cannot predict the url I'll be redirected to (It is a signed url generated by a server when I click on a button in the angular 1.5 app) Do you guys have any idea how I could get this working ? Thank you in advance, |
angular/angular#10084 should fix this problem |
All the little pieces needing to be fixed for this are now done - see our example against a hybrid app here: https://github.com/angular/protractor/blob/master/spec/hybrid/async_spec.js#L3 Note that this will only work with a recent version of Angular2 and with zone.js 0.6.25 or higher. |
Protractor works well on Angular 1 but after upgrading my app to an hybrid Angular 1+2 I get this error:
It seems a common error when you don't have a ng-app tag
<div ng-app=myAppManager">
in your Angular 1 app and can be easily fixed with rootElement : 'html' in your protractor config file but it doesn't seem to change anything on hybrid app.I tried
rootElement : 'html'
or evenuseAllAngular2AppRoots: true
.I heavily suspect the problem comes from the asynchronous loading of the hybrid angular (from the upgrade doc):
my config file:
The text was updated successfully, but these errors were encountered: