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

StepEventBus.getEventBus.enableSoftAssert() is not working for cucumber test #2858

Closed
remyanekkuth opened this issue Jun 28, 2022 · 5 comments

Comments

@remyanekkuth
Copy link

remyanekkuth commented Jun 28, 2022

@wakaleo
I have a cucumber test in which we want to validate some negative scenarios but with enableSoftAssert() and didableSoftAssert(). Expectation is even though one step fails the test will continue, but actual is the first assertion fails, the test failed and skipped rest of the lines.

We have same scenarios written in jUnit and enableSoftAssert() and disableSoftAssert() working as expected.

We are using serenity-cucumber 6 : version 2.3.10

Need some help on how to make this work for cucumber tests.

@remyanekkuth
Copy link
Author

remyanekkuth commented Jul 1, 2022

Can anyone help on this. Appreciate some inputs

@wakaleo
Copy link
Member

wakaleo commented Jul 1, 2022

Soft assertions across steps are not supported.

@remyanekkuth
Copy link
Author

@wakaleo is it only with the version. How can I use soft assert in cucumber in this case. Please provide some guidelines

@wakaleo
Copy link
Member

wakaleo commented Jul 11, 2022

Cucumber does not support this either. If you want soft asserts you can place all of your expectations in a tabular format, e.g.

    Scenario: Mandatory fields for registration
      Given Candy does not have a Frequent Flyer account
      When she wants to register as a Frequent Flyer member
      Then the following information should be mandatory:
        | Field     | Error Message If Missing     |
        | email     | Please enter your email      |
        | password  | Please enter your password   |
        | firstName | Please enter your first name |
        | lastName  | Please enter your last name  |
        | address   | Please enter your address    |
        | country   | Please enter a valid country |

If you have many steps with verifications your scenario may be a bit long.

@wakaleo
Copy link
Member

wakaleo commented Aug 22, 2022

Closing presumed answered

@wakaleo wakaleo closed this as completed Aug 22, 2022
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