Skip to content
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

Request to Add Soft Assertion on wdio-cucumberjs-json-reporter #255

Closed
anandmdas opened this issue Aug 10, 2023 · 2 comments
Closed

Request to Add Soft Assertion on wdio-cucumberjs-json-reporter #255

anandmdas opened this issue Aug 10, 2023 · 2 comments

Comments

@anandmdas
Copy link

anandmdas commented Aug 10, 2023

Is your feature request related to a problem? Please describe.
When we are performing E2E executions we may need to perform a textual validations or some validation which doesnt need to stop the execution but mark the step and scenario as failed.
As currently the only way to mark a step and scenario as failed is only once we use a throw statement the execution stops there

Example: Take a scenario as you are performing an E2E regression and you need to perform some content validation. Say the content validation is failed, but I can still perform the functionality is working fine or not. But in this case with the current implementation I have to use a throw statement to report failure, which will stop the execution. Instead create a method with which we can mark the testcase as failed with a description

Proposed Solution
Approach 1:
Create a static method with which we can mark the step and scenario as failed

Approach 2:
Make the current step object and scenario object assessable from any where in the project so we can create a mapping and the step can be marked as fail using after hooks

I will prefer approach 1 as that is more user friendly and the approach 2 we may still need to terminate the execution after the step fails

Reference link on similar feature for playwright and cypress
https://playwright.dev/docs/test-assertions
https://medium.com/@pipulpant/leveraging-hard-and-soft-assertions-for-effective-testing-48dc36e3451c
https://docs.cypress.io/guides/references/assertions
https://github.com/elaichenkov/playwright-expect

@anandmdas anandmdas changed the title Request to Request to Add Soft Aug 10, 2023
@anandmdas anandmdas changed the title Request to Add Soft Request to Add Soft Assertion on wdio-cucumberjs-json-reporter Aug 10, 2023
@christian-bromann
Copy link
Contributor

Duplicate of webdriverio/expect-webdriverio#227 ?

@christian-bromann
Copy link
Contributor

Closing as duplicate then. Please get involved if you like this feature to land. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants