webdriverio icon indicating copy to clipboard operation
webdriverio copied to clipboard

[🐛 Bug]: <Scenarios with duplicated steps not failing>

Open josiasvfigueredo1985 opened this issue 1 year ago • 1 comments

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.35.1

Node.js Version

10.9.2

Mode

WDIO Testrunner

Which capabilities are you using?

browser: chrome-124.0.6367.118
windows 11

What happened?

Running tests with Cucumber, a duplicated step definition is causing the following behavior on Allure Report:

  • Test suddenly stops right after start execute duplicated step
  • Test pass successfully
  • All the remaining steps are skipped

image

What is your expected behavior?

Catch the error and print the cause in the log file, example: "Test has failed due following duplicated step! 'Step:I add attribute on xxxx Sidebar'"

How to reproduce the bug.

  1. Create a project with cucumber and Allure
  2. Create 2 step definitions with the same name
  3. Create 2 scenarios at least
  4. Add the duplicated steps on scenarios
  5. Run all the scenarios using the duplicated steps
  6. Run allure command to generate the report

Relevant log output

N/A

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [X] I have searched the existing issues

josiasvfigueredo1985 avatar Jun 19 '24 17:06 josiasvfigueredo1985

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!

wdio-bot avatar Jun 19 '24 18:06 wdio-bot

Hi @josiasvfigueredo1985, I tried to reproduce your issue. I had the error below in execution terminal and in allure report :

[chrome 127.0.6533.100 Windows 10 #0-0] Multiple step definitions match:
[chrome 127.0.6533.100 Windows 10 #0-0] Multiple step definitions match:
[chrome 127.0.6533.100 Windows 10 #0-0]   I fail test - file:\C:\2-gitlab\end-to-end-tests-wdio\src\steps\given.js:84
[chrome 127.0.6533.100 Windows 10 #0-0]   I fail test - file:\C:\2-gitlab\end-to-end-tests-wdio\src\steps\given.js:89

In allure

      "status": "broken",
      "statusDetails": {
        "message": "Multiple step definitions match:",
        "trace": "Multiple step definitions match:\n  I fail test - file:\\C:\\2-gitlab\\end-to-end-tests-wdio\\src\\steps\\given.js:84\n  I 
         fail test - file:\\C:\\2-gitlab\\end-to-end-tests-wdio\\src\\steps\\given.js:89"
      },

I think this error displayed matches with your expected behavior, isn't it? Or you have another behavior

lacell75 avatar Aug 13 '24 14:08 lacell75

Yes, that's the expect behavior, thank you!!!!

josiasvfigueredo1985 avatar Aug 13 '24 17:08 josiasvfigueredo1985

So, can we close this issue?

lacell75 avatar Aug 13 '24 20:08 lacell75

I think we can, thanks for the investigation @lacell75 🙏

christian-bromann avatar Aug 13 '24 20:08 christian-bromann

Thanks for raising this issue 🙏

Unfortunately we can't help you without a reproducible example in this matter. Please read our contributing guidelines on how to create a reproducible example. If you can't provide a reproducible example we will close this issue in 7 days.

If you have any questions please reach out to us on our Discord channel. We are happy to help you out there.

wdio-bot avatar Aug 13 '24 20:08 wdio-bot