Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Aug 4, 2025

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.

@susnux susnux force-pushed the test/fix-cypress branch 5 times, most recently from 1b90e1f to 0579832 Compare August 5, 2025 18:40
@susnux susnux added 2. developing Work in progress tests Related to tests CI labels Aug 5, 2025
@susnux susnux force-pushed the test/fix-cypress branch from 0579832 to 88be308 Compare August 5, 2025 21:49
@susnux susnux marked this pull request as ready for review August 6, 2025 09:29
@susnux susnux requested a review from a team as a code owner August 6, 2025 09:29
@susnux susnux requested review from come-nc, nfebe, skjnldsv and sorbaugh and removed request for a team August 6, 2025 09:29
}

// eslint-disable-next-line no-unused-expressions
expect(menuButtonId).not.to.be.undefined
Copy link
Contributor Author

@susnux susnux Aug 6, 2025

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.

Comment on lines +19 to +21
return getActionButtonForFileId(fileid)
.should('have.attr', 'aria-controls')
.then((menuId) => cy.get(`#${menuId}`).find(`[data-cy-files-list-row-action="${CSS.escape(actionId)}"]`))
Copy link
Contributor Author

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.

@skjnldsv
Copy link
Member

skjnldsv commented Aug 6, 2025

image

It's beautiful

@susnux
Copy link
Contributor Author

susnux commented Aug 6, 2025

It's beautiful

Especially because its first run 🤩

@susnux susnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 6, 2025
@skjnldsv skjnldsv enabled auto-merge August 6, 2025 09:48
@skjnldsv skjnldsv merged commit 48dc04b into master Aug 6, 2025
128 checks passed
@skjnldsv
Copy link
Member

skjnldsv commented Aug 6, 2025

Backports ? :)

@skjnldsv skjnldsv deleted the test/fix-cypress branch August 6, 2025 09:48
@susnux
Copy link
Contributor Author

susnux commented Aug 6, 2025

Backports

Just want to wait if it really fixed all of them then we can backport (so lets wait until stable* is unfrozen again)

@susnux
Copy link
Contributor Author

susnux commented Aug 11, 2025

Looks good to me - we cannot merge but I will create the requests so I do not forget about it

@susnux
Copy link
Contributor Author

susnux commented Aug 11, 2025

/backport to stable31

@backportbot
Copy link

backportbot bot commented Aug 11, 2025

The backport to stable31 failed. Please do this backport manually.

# 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/stable31

Error: 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.

@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
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 backport-request CI tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants