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

[stable21] Add missing waits and asserts in acceptance tests #25993

Merged
merged 9 commits into from
Mar 8, 2021

Conversation

backportbot-nextcloud[bot]
Copy link

backport of #25975

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]>
@backportbot-nextcloud backportbot-nextcloud bot added this to the Nextcloud 21.0.1 milestone Mar 8, 2021
@rullzer rullzer added the 3. to review Waiting for reviews label Mar 8, 2021
@juliusknorr juliusknorr merged commit ecb6438 into stable21 Mar 8, 2021
@juliusknorr juliusknorr deleted the backport/25975/stable21 branch March 8, 2021 09:57
@rullzer rullzer mentioned this pull request Mar 26, 2021
2 tasks
@rullzer rullzer mentioned this pull request Apr 8, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants