If we have E2E test cases written for an Angular2+ application using protactor, if we migrate the Angular2+ application to React, how difficult it will be to migrate those E2E test cases to work against the React application (after migration)?
If your tests were written correctly - then you'll have to replace your infrastructure layer with another module that would support React. You can estimate that task depending on the size and complexity of your existing module.
By "correctly" I mean the architectural separation between test definition layer and test adaptation/infrastructure (Protractor) layer.
Another point that you need to consider - is rewriting the angular specific locators (finding elements by ng-something), to more generic, that would suit the React UI as well.
In other words, as long as your test code/page objects do not contain plain calls to Protractor, and you are accessing it via your custom wrapper - you would only have to replace the content of the wrapper, without affecting the client code.
-
Thank you for your reply, will you be able to elaborate a little on your last para? – Kiran Jul 15 '20 at 7:20
-
1Protractor can drive any website, you wouldn't necessarily need to swap it out entirely to test a React site. – jonrsharpe Jul 15 '20 at 7:23
browser.waitForAngularEnabled(false)
. Have you tried anything? What happened? – jonrsharpe Jul 15 '20 at 6:28