-
Notifications
You must be signed in to change notification settings - Fork 19
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
Flexible screenshot strategy #36
Comments
Sorry if this thread is for something else. I can open a ticket if any. Take screen shot has bugs with async mode. Issue is in the hooks of the service:
This code pretend to be sync in async mode, so screen shot is taken in next test. As states the docs : https://webdriver.io/docs/customservices.html you should do it async and in sync mode it would be handled by wdio to be (pseudo)sync, but in async mode your code will be handled by node js itself and so code will work in both modes. So fix is simple:
Same here
|
@benzaremean I'm sorry that I didn't respond earlier. Somehow this didn't come to my attention. What I was trying to achieve was to gather screenshots after each step in order to document actual results, so my pull request meets my needs. I like @zhibek's change to allow multiple strategies. Other screenshot strategies that might be helpful:
|
@Gordiievskyi: @benzaremean is the expert on this, so I'll defer to him, but I'm not following what you're requesting. The documentation you linked to indicates that the function does not need to return a promise, and the documeentation for takeScreenshot indicates that it is not async. What am I missing? |
@nemesisridiculii I don't want to say all, but I didn't find any wdio command that is sync(an its logical, node js is best in async network operation and webdriver is nothing more then http requests from client(wdio) to server(selenium or browser driver aka chomedriver ). The takeScreenshot particularly is async. So your code works only in sync mode when wdio handles it and other promise based code for you. You can check if wdio code is async just by console.log it in async mode. The documentation I refer to (comment particularly):
This code above work in both sync and async mode in the same way. But code below will fail in async mode if in TODO section there is any async code( promise in our case)
|
@zhibek @nemesisridiculii Just opening this issue so we could discuss flexible screenshot strategies. It is something I've planned to look into for a while and since you both raised PRs in the same area I thought we could discuss in an issue some requirements.
What else do you think we should cover in addition to what you raised in your PRs?
The text was updated successfully, but these errors were encountered: