Replies: 2 comments 2 replies
-
As you can see this is currently not supported. I am not sure how good of an idea it is to allow dynamic retries as it can make the behavior of the test runner very confusing. I will let others chime in on that. That said, it is certainly not impossible to implement it. |
Beta Was this translation helpful? Give feedback.
-
Hi It looks like you're trying to implement a dynamic test retry mechanism in your WebDriverIO tests using Mocha. Please try this https://webdriver.io/docs/retry/ Other references: If this is something specific to BrowserStack you can raise a ticket with them: https://www.browserstack.com/contact#technical-support |
Beta Was this translation helpful? Give feedback.
-
Howdie!
I'm looking for a way to dynamically retry individual tests using hooks, e.g
afterCommand: async function (commandName, args, result, error) { if(error){ this.retries(2); //using mocha retry } },
This (obviously) doesn't work but I hope you get the idea on what I'm trying to achieve
ERROR @wdio/utils:shim: TypeError: this.retries is not a function
I'm trying to mitigate an issue that sometimes appears when using Browserstack. Instead of re-running an enitre spec-file using the "specFileRetries" flag, I would like to look for a specific error and retry the specific test causing this issue, e.g
afterCommand: async function (commandName, args, result, error) { if(String(error).includes('The specific error that I'm looking for')){ this.retries(2); //using mocha retry } },
Any input would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions