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
Prevent unrelated error from being displayed if a scenario step has failed #6743
Prevent unrelated error from being displayed if a scenario step has failed #6743
Conversation
Unsure how to add a test for this as it only occurs on the failure of a test. I used the following test
Output before fix
Output after fix
|
Your change broke conditional assertions Codeception/src/Codeception/Scenario.php Line 79 in fcfa1d0
|
I think that the best way to compare if 2 variables contain the same test is to compare results of if ($lastFailure && Descriptor::getTestSignatureUnique($lastFailure->getTest()) === Descriptor::getTestSignatureUnique($this) For ideas how to implement test for your change see Codeception/tests/cli/RunCest.php Lines 606 to 669 in fcfa1d0
Codeception/tests/cli/OrderCest.php Lines 16 to 75 in fcfa1d0
|
…comparison due to cloning
Thanks for the feedback, your suggestion fixed the broken test. I have also refactored to avoid the loop when not needed. I will look at adding a new test in the next few days |
I have added a test to cover the new change, and fixed the code style check that failed in the last run |
And fix pushed for the code style in the tests |
Released as 5.1.2 |
This fixes #6716 which results in incorrect test failures being reported where a scenario has a failed assertion that has been caught within the test itself or via
expectException