You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Team, We are using the WebdriverIO with the Jasmine framework for our test automation project. We observed the afterTest() hook in the WebdriverIO shows the passed value as true for the spec that failed with an expectation. Due to this issue, we cannot take a screenshot of the failed spec and attach it to the allure report. Please find the below framework details.
WebdriverIO version: 8.20.2
Framework: Jasmine
Language: Javascript
Mode: [WDIO Testrunner]
If WDIO Testrunner, running sync/async: [async]
Node.js version: [18.15.0]
NPM version: [9.5.0]
Browser name and version: [Chrome 119]
Platform name and version: [Windows 10
We even tried to use the below check in afterTest() hook, but still, the screenshot is not captured in the allure report failed spec.
afterTest: async function (test, context, { error, result, duration, passed, retries }) {
if (!passed || error) {
await browser.takeScreenshot()
}
}
Attached is the allure report screenshot
What is your expected behavior?
The afterTest() hook should return the correct passed value as true/false for the spec passed/failed due to expectation/assertion
How to reproduce the bug.
Attached is the sample project created to reproduce this issue. The project contains two specs, one will pass and the other will fail due to expectations.
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!
BorisOsipov
changed the title
Unable to capture failed WebdriverIO - Jasmine spec screenshot in Allure Report due to afterTest() hook returning incorrect value for failed spec as passed=true
Jasmine afterTest() wdio hook returns wrong passed value for failed spec as passed=true
Nov 19, 2023
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
8.20.2
Node.js Version
8.15.0
Mode
WDIO Testrunner
Which capabilities are you using?
What happened?
Hi Team, We are using the WebdriverIO with the Jasmine framework for our test automation project. We observed the afterTest() hook in the WebdriverIO shows the passed value as true for the spec that failed with an expectation. Due to this issue, we cannot take a screenshot of the failed spec and attach it to the allure report. Please find the below framework details.
WebdriverIO version: 8.20.2
Framework: Jasmine
Language: Javascript
Mode: [WDIO Testrunner]
If WDIO Testrunner, running sync/async: [async]
Node.js version: [18.15.0]
NPM version: [9.5.0]
Browser name and version: [Chrome 119]
Platform name and version: [Windows 10
We even tried to use the below check in afterTest() hook, but still, the screenshot is not captured in the allure report failed spec.
afterTest: async function (test, context, { error, result, duration, passed, retries }) {
if (!passed || error) {
await browser.takeScreenshot()
}
}
Attached is the allure report screenshot
What is your expected behavior?
The afterTest() hook should return the correct passed value as true/false for the spec passed/failed due to expectation/assertion
How to reproduce the bug.
Attached is the sample project created to reproduce this issue. The project contains two specs, one will pass and the other will fail due to expectations.
JasmineProject.zip
Relevant log output
Code of Conduct
Is there an existing issue for this?
The text was updated successfully, but these errors were encountered: