Closed dprevost-LMI closed 1 day ago
FYI: Will be fixed when https://github.com/webdriverio/webdriverio/pull/13922 is merged
Thanks for reporting!
We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
9.3.1
Node.js Version
v18.20.4
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
One line: Some
afterCommand
events are not triggered when a request fails!In short, the problem is that we do not have the same number of calls to the beforeCommand and afterCommand. For example, the allure-reporter starts more steps than it can end, which generates a weird report and can even make the generation step hang!
The problem is related to the GET request of isElementEnabled, which returned a 404 with the error stale element reference (See log below). In this case, it throws an error here so the then of the request.makeRequest here will not proceed and will not do the required emit('result') that trigger the afterCommand. In consequence, we will lose a endStephave a different
What is your expected behavior?
All
beforeCommand
trigger a equivalentafterCommand
even when a request fails!In short, I assume that the request.makeRequest here needs a catch that will do the this.emit('result' for the afterCommand to get triggered.
However, doing so will result in an error that people may not expect, so I wonder about the impact.
Anyway, I added the below catch for fun, finally making all the startStep and endStep even.
If someone can guide me on the proper changes, I can try to open a PR. The options I'm seeing:
How to reproduce the bug.
I have not yet found a way to reduce my example so that it can be shared. I'll try soon to share reproducible bug!
Relevant log output
Code of Conduct
Is there an existing issue for this?