-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Expect condition inside the .then won't execute #4787
Comments
Why not use async/await since you are using TypeScript, your code will be more clearly. BTW, you better post your question to stackoverflow. |
@awarecan ! Thanks. I tried it with async/await but nothing changed. I'm doubtful about using await condition when i've promises inside promises. For example, If i just use await with |
Hi, @iamhaseebiqbal ! As @awarecan mentioned, with async/await your code will be clearly. But if you want to use promises try this code snippet:
|
@IgorSasovets Thanks mate. Got your point. I implemented it in different specs and its working fine. 👍 |
I'm using PageObjects in Protractor tests. Structure looks like this,
I'm returning Promises from methods inside PageObject file. And then inside spec file in it blocks i've Expect conditions.
A sample code is like,
After execution, all the tests pass and i get following output in log.
In practical i've multiple tests so control just moves to next tests and at the end tells that all tests passed successfully.
Now i understand that control is putting the commands in queue and moving forward. How can i handle this situation? What i'm doing wrong? Thanks.
The text was updated successfully, but these errors were encountered: