-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
test(cypress): split helpers for files actions to make tests less flaky #54237
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
Conversation
1b90e1f to
0579832
Compare
Signed-off-by: Ferdinand Thiessen <[email protected]>
0579832 to
88be308
Compare
| } | ||
|
|
||
| // eslint-disable-next-line no-unused-expressions | ||
| expect(menuButtonId).not.to.be.undefined |
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.
ℹ️ This would just fail and not be retried, so if the menu is not yet loaded (opened) and DOM was updated then this will fail forever in this test run.
| return getActionButtonForFileId(fileid) | ||
| .should('have.attr', 'aria-controls') | ||
| .then((menuId) => cy.get(`#${menuId}`).find(`[data-cy-files-list-row-action="${CSS.escape(actionId)}"]`)) |
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.
ℹ️ whereas here we assure a aria-controls is already available (because we do not need to check inline actions) and thus can assume in the then that the previous was retried until available.
Especially because its first run 🤩 |
|
Backports ? :) |
Just want to wait if it really fixed all of them then we can backport (so lets wait until stable* is unfrozen again) |
|
Looks good to me - we cannot merge but I will create the requests so I do not forget about it |
|
/backport to stable31 |
|
The backport to # Switch to the target branch and update it
git checkout stable31
git pull origin stable31
# Create the new backport branch
git checkout -b backport/54237/stable31
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 88be308b
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/54237/stable31Error: Failed to check for changes with origin/stable31: No changes found in backport branch Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |

This is a refactoring of the cypress tests to basically split triggering inline and menu actions.
From a e2e test perspective you also should already know what you want to do, so it should be known if inline or menu.
It is needed because the "magic" that allowed to handle both in one method was not retry-able meaning if it would fail because of precondition (e.g. still loading) then it cannot succeed with timeouts.