Skip to content
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

waitForAngularRequestsToFinish() not working as expected when window.angular is not initialized yet #108

Closed
gifflet opened this issue Mar 8, 2021 · 7 comments

Comments

@gifflet
Copy link

gifflet commented Mar 8, 2021

Do you know the best way to wait for window.angular to be available in an AngularJS application? Currently, at the beginning of waitForAngular1 there is some delay to get the angular object initialized in this site: https://www.advantageonlineshopping.com/#/

At this line:

The app is not considered an AngularJS app because of window.angular initialization delay. So ngWebDriver.waitForAngularRequestsToFinish() seems that is not enough to wait the page get loaded. What is the best approach to handle this situation?

@paul-hammant
Copy link
Owner

What site?

@gifflet
Copy link
Author

gifflet commented Mar 8, 2021

@paul-hammant
Copy link
Owner

paul-hammant commented Mar 8, 2021 via email

@gifflet
Copy link
Author

gifflet commented Mar 8, 2021

I am not a Hacker. I'm working on a mobile/web test framework that needs to use this project as a dependency. The site https://www.advantageonlineshopping.com is not maintained by my company but it is for test purpose only.

When I run these commands (from clientesidescripts.js):
image

I get undefined when running tryEl(document.body). If body is the element that holds the angular, why we get undefined from method return?

@gifflet
Copy link
Author

gifflet commented Mar 8, 2021

Removing injectorPlease solved the problem. Not setting this argument in getNg1Hooks()

@paul-hammant
Copy link
Owner

The JavaScript is unchanged from the same file in Protractor. Have you found an enhancement to make the clientesidescripts.js file? If yes, then it should be contributed to the Protractor project.

@paul-hammant
Copy link
Owner

Happy customer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants