-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add missing waits and asserts in acceptance tests #25975
Merged
rullzer
merged 9 commits into
master
from
add-missing-waits-and-asserts-in-acceptance-tests
Mar 8, 2021
Merged
Add missing waits and asserts in acceptance tests #25975
rullzer
merged 9 commits into
master
from
add-missing-waits-and-asserts-in-acceptance-tests
Mar 8, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As no timeout was specified the elements were tried to be found just once. This caused the steps to fail if the elements did not appear yet in the page when they were tried to be found. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
WaitFor::element... calls only perform the waiting and return whether the condition succeeded or not, but that result needs to be explicitly checked to prevent further steps from being executed if the wait failed. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Adding some missing asserts showed that the "delete user" acceptance test was silently failing, as the deletion was not being confirmed in the dialog and thus the user was not being deleted. The dialog button contains a single quote ("user0's"), so the XPath expression had to be adjusted (it seems that it is not possible to escape a single quote in a string enclosed in single quotes in XPath 1.0). Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
"Actor::find" is a more robust way to look for elements, as it handles some exceptions that may be thrown. Therefore, even if the elements are not actually used and it is only checked whether they exist or not using the actor is the preferred way when possible (and it also makes it consistent with the rest of the acceptance tests). Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Instead of looking for the bundle button and then checking its value now the expected value is included in the locator and the button is checked similarly to other elements. No "Disable all" locator was added as it was not currently needed anywhere. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Although if the element could not be found an exception would be thrown and the test aborted if an element is in the DOM but hidden it would be found and the test would pass. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The input element is always hidden, so the check always ended falling back to the label. Moreover, the label is the element that the user interacts with, so it must be the one used. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
/backport to stable21 |
/backport to stable20 |
danxuliu
added
3. to review
Waiting for reviews
and removed
2. developing
Work in progress
labels
Mar 6, 2021
kesselb
approved these changes
Mar 6, 2021
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.
🎉
rullzer
approved these changes
Mar 8, 2021
This was referenced Mar 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request should make some acceptance tests more robust as now it will be properly waited for the elements. Additionally, as some asserts were added too, it should make the tests fail at the right step if something does not pass. Ironically adding the missing asserts could cause some tests to start failing sometimes if they were flaky, but based on a few runs it should be fine. I hope :-)
Due to all that and as it only touches the acceptance tests I would suggest to backport it (but if the backport fails feel free to ignore it).