-
-
Notifications
You must be signed in to change notification settings - Fork 28
delete the added user so that the scenario can call repeatedly #82
delete the added user so that the scenario can call repeatedly #82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Astrid! Just those little corrections, and this can be merged.
Scenario: | ||
Delete user Given I have a user with user name "User Three" | ||
When I Delete the user "User Three" | ||
Then I should see "No Matching Results" for deleted user "User Three" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo: Should be
Scenario: Delete user
Given I have a user with user name "User Three"
When I Delete the user "User Three"
Then I should see "No Matching Results" for deleted user "User Three"
Please remember the newline at the end of the file!
Is the code style now OK? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge for me.
I hope I'm not annoying with my ideas. If you are all sure that the tests should be repeatable, I would change the following, too:
I would use it for the email, too:
If you like it, I will add it to this PR. |
@astridx To be honest the test data should probably be static, in order to be really repeatable (and always have the same data) and not generated by faker. The downside is that running tests on the same install (or single tests) would be impossible that way. This is the reason we currently randomized it. Having the mail also randomized for the later reasons is a good idea. Thank you! |
In this case we should not use Faker. We should use a static user name and delete this user in the end of the test. Are I am right? |
@astridx Please use Faker even for generating email's. I don't see any problem in that, also creating a user with Faker and then deleting the user in the end of the Tests should be the right way. |
@puneet Kala Thank you for your reply. If we delete the user in the end, we do not need Faker. Because then the tests are without Faker repeatable. |
Summary of Changes
When I ran ./tests/codeception/vendor/bin/codecept run ./tests/codeception/acceptance/users.feature twice, I got a failure.
The reason for this failure is, that in the first run an user is created and this user is not deleted. It is renamed, but the email address remains the same. So I had the idea to delete this user in the end of the scenario.
I add Scenario:
Delete user
Given I have a user with user name "User Three"
When I Delete the user "User Three"
Then I should see "No Matching Results" for deleted user "User Three"
to the end of my local file users_frontend.feature.
All respective methods are already in the step object.