I use Protractor with Angular 1.x. I would like to migrate to Angular 2.0 step by step but I don't see Protractor in the docs.
Has protractor been dropped since Angular 2? Should I write my tests without using Protractor, using Jasmine instead (or others)?
Since Protractor was initially designed to support AngularJS, many of its features like locators and mock modules are specific to AngularJS. These features only work in AngularJS and not Angular. They will no longer be relevant once development on AngularJS ceases by December 31, 2021.
Protractor is a wrapper around Selenium Webdriver that provides an automation test framework, which simulates user interaction with an Angular web application for a range of browsers and mobile devices. It provides all features of Selenium WebDriver along with Angular specific features for seamless end to end testing.
You can test Angular 2 applications with Protractor
(starting from Protractor 2.5.0).
For Protractor 5.0.0+, you don't have to do anything specific, Protractor will auto-detect the Angular version used in the application under test.
For Protractor >= 2.5.0 and <= 4.0.14, you would only need to add useAllAngular2AppRoots: true
to your config. Here is a sample.
Note that several built-in Protractor matchers would not yet work with Angular2, see:
There is also that Protractor+Angular2 problem in Firefox (still unresolved), see:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With