Skip to content

Add E2E tests for copying and moving shared groupfolders#3185

Merged
artonge merged 1 commit intomasterfrom
add-e2e-tests-for-copying-and-moving-shared-groupfolders
Sep 8, 2025
Merged

Add E2E tests for copying and moving shared groupfolders#3185
artonge merged 1 commit intomasterfrom
add-e2e-tests-for-copying-and-moving-shared-groupfolders

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Sep 9, 2024

This pull request adds E2E tests for the issue fixed in nextcloud/server#47847 (some scenarios are fixed by that pull request, other scenarios work fine already but were added for completion).

[skip ci] was used for now until the fix is merged, as otherwise running one of the scenarios would recursively copy the data directory of the Nextcloud server and maybe cause issues in CI.

@danxuliu danxuliu added the 2. developing Items that are currently under development label Sep 9, 2024
@danxuliu danxuliu force-pushed the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch from 3d36454 to e04cf6e Compare September 9, 2024 13:33
@danxuliu danxuliu force-pushed the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch from e04cf6e to d89ff42 Compare October 29, 2024 14:51
@danxuliu danxuliu added 3. to review Items that need to be reviewed tests feature: sharing Items related to the NC sharing feature and removed 2. developing Items that are currently under development labels Oct 29, 2024
@danxuliu danxuliu marked this pull request as ready for review October 29, 2024 18:14
@come-nc come-nc requested a review from artonge November 25, 2024 13:53
@artonge
Copy link
Contributor

artonge commented Dec 2, 2024

They seem to be failing though

@provokateurin
Copy link
Member

@danxuliu can you rebase and check if everything passes now?

@danxuliu danxuliu force-pushed the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch from d89ff42 to d05b6a7 Compare June 29, 2025 22:20
@danxuliu
Copy link
Member Author

In the rebase the helper functions were updated to the latest server version (so they now take into account the change in how internal shares are created since Nextcloud 31) and it was no longer needed to add one of them (createFolder) as it was added to the cypress code of groupfolders in the meantime. The tests themselves were not modified.

The tests were run locally several times and they always passed, let's see what CI says 🤞

@danxuliu
Copy link
Member Author

The tests were run locally several times and they always passed, let's see what CI says 🤞

Well, all tests failed 🤷 The problems seem to be that showing the list of possible shares takes more than 4 seconds and... that the session is lost while creating the share so a new one is started, but the following requests fail as being unauthenticated due to the new session not being logged in? I do not have any idea of what is going on 🥲

@artonge artonge force-pushed the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch 2 times, most recently from 160d7d3 to 8877ed2 Compare September 5, 2025 14:00
New filesUtils functions adjusted from
cypress/e2e/files_sharing/filesSharingUtils.ts of Nextcloud server at
commit 30f3cbf5f8578ef8cb6a77ecd304df83089985f0; note that
"shareSettings" is not used, so there is no need to include the hack in
"createShare" nor add the "updateShare" function.

Besides that the helper functions to copy and move a file now support
using as destination a directory that is not a descendant of the current
directory (as that requires to first navigate to the Home folder in the
file picker, which was not supported before, to then descend to the
final destination).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@artonge artonge force-pushed the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch from e1892c1 to 33555a4 Compare September 8, 2025 10:30
@artonge
Copy link
Contributor

artonge commented Sep 8, 2025

I used saveState/restoreState to reduce the amount of duplicate operations during the setup phase. I also raised the timeout, it seems to work for now.

@artonge artonge added this to the Nextcloud 33 milestone Sep 8, 2025
@artonge artonge merged commit 1455407 into master Sep 8, 2025
47 checks passed
@artonge artonge deleted the add-e2e-tests-for-copying-and-moving-shared-groupfolders branch September 8, 2025 12:15
Comment on lines +54 to +63
createGroup(groupName1)
.then(() => {
addUserToGroup(groupName1, setupInfo.user1.userId)
createGroupFolder(groupFolderName1, groupName1, [PERMISSION_READ, PERMISSION_WRITE, PERMISSION_SHARE, PERMISSION_DELETE])
})
createGroup(groupName2)
.then(() => {
addUserToGroup(groupName2, setupInfo.user2.userId)
createGroupFolder(groupFolderName2, groupName2, [PERMISSION_READ, PERMISSION_WRITE, PERMISSION_SHARE, PERMISSION_DELETE])
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI on master and stable32 is failing because these groups (and groupfolders) are not deleted after each test, so the next test fails the setup because they already exist. @danxuliu @artonge can you fix it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more precise, they are only not deleted at the end of this test group. I'll fix it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should do it: #3987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed feature: sharing Items related to the NC sharing feature tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants