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

Awaited assert doesn't work inside other commands #3301

Closed
garg3133 opened this issue Jul 25, 2022 · 2 comments · Fixed by #3328
Closed

Awaited assert doesn't work inside other commands #3301

garg3133 opened this issue Jul 25, 2022 · 2 comments · Fixed by #3328
Assignees

Comments

@garg3133
Copy link
Member

garg3133 commented Jul 25, 2022

If we use await browser.assert.<some-assertion> inside other commands like a custom-command (see #3286) or inside debug interface, the promise for the assertion is never resolved and the test gets stuck after the assertion.

Please note that the assert command currently works correctly inside the debug() interface because of a workaround (we replace assert with verify) but this needs to be fixed as we'll revert the workaround once #3275 is merged.

@gravityvi
Copy link
Member

gravityvi commented Jul 25, 2022

Actually asserts are not designed to use with await. async/await is Nightwatch to get the values from Nightwatch commands and assert commands never return a value. We can have a look if we can make this work

@garg3133
Copy link
Member Author

Actually asserts do return a value. Like if browser.assert.title() is called, value of browser.title() (that is, the command executed as part of performing assert) is returned back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants