(docs): saveScreenshot requires afterTest hook to be async#11005
(docs): saveScreenshot requires afterTest hook to be async#11005christian-bromann merged 2 commits intowebdriverio:mainfrom
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 |
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
afterTestI would sometime lack a screenshot file. I eventually foundbrowser.saveScreenshotis async and the hook has to be explicitly definedasync: #5545 (comment)Add an example for using
browser.saveScreenshotin theafterTesthook with the hook being setasyncexplicitly. This would have saved me a bit of troubleshooting time.Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers