-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
(docs): saveScreenshot requires afterTest hook to be async #11005
Conversation
I am making this contribution with a shared copyright between me as an individual and @wikimedia foundation. I don't know whether this contribution is copyrightable or subject to CLA, if it can be opted out feel free to merge it in. Meanwhile I will reach out to @wikimedia legal department to review and sign the OpenJS CCLA which I can not sign in name of the organization. |
@hashar I have contacted @wikimedia legal team while working on #7999. I think the CLA is signed. They will probably know what to do, but as far as I remember, you have to add your wikimedia email to your github profile and sign the commit with it. |
When requesting a screenshot in the `afterTest` hook, I would sometime not have any screenshot generated. I eventually found `browser.saveScreenshot` is an async function and the hook has to be explicitly defined `async`: webdriverio#5545 (comment) Add an example to the `browser.saveScreenshot` documentation showing how to use it in the `afterTest` hook. Signed-off-by: Antoine Musso <amusso@wikimedia.org>
I have amended the commit message to add:
But EasyCLA still fails. That is now pending approval of my account by the Wikimedia Legal team :) |
Honestly this applies to all commands you use, not just in a hook but everywhere, so I don't really see a benefit in explicitly adding this. It also applies to all hooks that they have to be async when awaiting any promise. |
Any updates @hashar ? |
I went ahead and signed an individual CLA since I have shared copyright for the work I am doing while working for Wikimedia. I will still reach out to our the organization legal team to find out how to get added to the corporate CLA as well. I have no idea how to retrigger EasyCLA verification :) |
I guess the issue I have is I am not familiar with JavaScript and got caught on calling the |
It is actually passing now, thanks for getting the approval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
As a follow-up, I got added to the Wikimedia Foundation contributors and signed the corporate CLA through EasyCLA. Success! |
Nice 🎉 looking forward to more contributions then 😉 |
Proposed changes
When requesting a screenshot in
afterTest
I would sometime lack a screenshot file. I eventually foundbrowser.saveScreenshot
is async and the hook has to be explicitly definedasync
: #5545 (comment)Add an example for using
browser.saveScreenshot
in theafterTest
hook with the hook being setasync
explicitly. This would have saved me a bit of troubleshooting time.Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers