Skip to content

Added seeFormErrorMessages function #67

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

Merged
merged 2 commits into from
Dec 20, 2020
Merged

Added seeFormErrorMessages function #67

merged 2 commits into from
Dec 20, 2020

Conversation

TavoNiievez
Copy link
Member

@TavoNiievez TavoNiievez commented Dec 7, 2020

It is also present in the Laravel module.

A validation was added to allow omitting => null in the array if you don't want to specify the error message.

@TavoNiievez TavoNiievez added this to the 1.5.0 milestone Dec 7, 2020
@TavoNiievez TavoNiievez mentioned this pull request Dec 7, 2020
11 tasks
@TavoNiievez TavoNiievez added the help wanted Extra attention is needed label Dec 9, 2020
@TavoNiievez TavoNiievez modified the milestones: 1.5.0, 1.6.0 Dec 10, 2020
@DavertMik
Copy link
Member

DavertMik commented Dec 12, 2020

Thanks @TavoNiievez for PR
Thanks @Naktibalda for a review

My biggest concern here that this method validates full error messages, which is useless in most of cases. Those error messages are either standard (so no reason to test the full message) or are subject to change in time.

Consider the case - we try to improve error messages, and we change them on each iteration adding more and more descriptinve erros and more and more polite languages, while keeping validation rules the same. Should we update test on each wording change? I prefer not. So personally I would assert for the error field to include some text.

However, not sure how to do this correctly with consistent API

@TavoNiievez
Copy link
Member Author

TavoNiievez commented Dec 12, 2020

@DavertMik if i understand you correctly, what you are asking is that an assertStringContainsString be made to be able to pass only a fragment of the error message instead of the whole message.

Edit: That is the current behavior of seeFormErrorMessage, more documentation was added explaining that you can include a part of the error message as well.

@TavoNiievez TavoNiievez modified the milestones: 9.9.9, 1.6.0 Dec 15, 2020
@TavoNiievez TavoNiievez removed the help wanted Extra attention is needed label Dec 18, 2020
@TavoNiievez
Copy link
Member Author

@Naktibalda @DavertMik I've made all the requested changes based on your feedback,

thanks to both of you.

@TavoNiievez TavoNiievez merged commit d802691 into Codeception:master Dec 20, 2020
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

Successfully merging this pull request may close these issues.

3 participants