While trying to migrate a legacy app to Angular, we encountered an issue where the legacy app loads the new app in an iframe. Testing this integration with Protractor has proven challenging due to the fact that the legacy app is not built on Angular.
If the legacy app was built using Angular, testing would be straightforward. However, since it's not, Protractor struggles to switch context into the iframe where the Angular app is embedded.
What is the best approach to address this?
Update: Protractor encounters issues when attempting to SwitchTo() frame.
Even after switching to the iframe and executing
browser.switchTo().frame(...);
Protractor fails to locate elements within the iframe. Interestingly, outside the iframe, Protractor successfully identifies buttons, links, and fields in the Angular app. Yet, within the iframe, these elements are seemingly invisible.