Skip to content

test(files): migrate copy/move e2e from Cypress to Playwright#61165

Open
pringelmann wants to merge 2 commits into
masterfrom
test/migrate-files-copy-move-playwright
Open

test(files): migrate copy/move e2e from Cypress to Playwright#61165
pringelmann wants to merge 2 commits into
masterfrom
test/migrate-files-copy-move-playwright

Conversation

@pringelmann

Copy link
Copy Markdown
Contributor

Summary

Migrates the files and files_sharing copy/move specs. Adds a CopyMoveDialogPage file-picker section, an OCS share helper, and an owner/recipient fixture for the sharing cases.

NOTE: The sharing "move without delete permission" case is omitted: the recipient's permission view propagates too inconsistently to assert reliably (the cypress original was flaky for the same reason). Noted for a follow-up PR.

Checklist

  • Sign-off message is added to all commits
  • Tests are included
  • Documentation has been updated or is not required

AI (if applicable)

  • The content of this PR was partly generated using AI

@pringelmann pringelmann self-assigned this Jun 10, 2026
@pringelmann pringelmann added CI tests Related to tests labels Jun 10, 2026
@pringelmann pringelmann added this to the Nextcloud 35 milestone Jun 10, 2026
Comment thread tests/playwright/support/utils/dav.ts
const response = await request.fetch(davUrl(user, parentPath), {
method: 'PROPFIND',
headers: { requesttoken, Depth: '1' },
data: '<?xml version="1.0"?><d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:prop><oc:permissions/></d:prop></d:propfind>',

@pringelmann pringelmann Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got Claude to help me with this part, but I'm still learning WebDAV so cannot easily judge if this is good. Would appreciate feedback.

baseURL,
// send: 'always' — the OCS API doesn't issue a Basic auth challenge, so
// credentials must be sent preemptively (DAV would challenge, OCS won't)
httpCredentials: { username: owner.userId, password: owner.password, send: 'always' },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since this is a once-off API seeding action, I decided to keep it simple and use http auth. (as opposed to creating a context for the second user)

Happy to debate

@pringelmann pringelmann force-pushed the test/migrate-files-copy-move-playwright branch from bcea929 to 92ca014 Compare June 11, 2026 10:04
@pringelmann pringelmann added the 3. to review Waiting for reviews label Jun 11, 2026
@pringelmann pringelmann marked this pull request as ready for review June 11, 2026 10:05
@pringelmann pringelmann requested a review from a team as a code owner June 11, 2026 10:05
@pringelmann pringelmann requested review from artonge, nfebe, sorbaugh and susnux and removed request for a team June 11, 2026 10:05
@pringelmann pringelmann force-pushed the test/migrate-files-copy-move-playwright branch from 92ca014 to 0150af1 Compare June 11, 2026 15:29
Comment thread tests/playwright/support/utils/sharing.ts Outdated
@pringelmann pringelmann requested a review from a team as a code owner June 11, 2026 16:42
@pringelmann pringelmann requested review from leftybournes and removed request for a team June 11, 2026 16:42
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the test/migrate-files-copy-move-playwright branch from cd0bf3f to 7bfe733 Compare June 11, 2026 16:43
@susnux

susnux commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Now its broken again 🙈

Error: SyntaxError: The requested module '../../support/utils/sharing.ts' does not provide an export named 'SharePermission'

@pringelmann

Copy link
Copy Markdown
Contributor Author

Now its broken again 🙈

Error: SyntaxError: The requested module '../../support/utils/sharing.ts' does not provide an export named 'SharePermission'

Sorry about that, was losing focus last night. Will fix

@pringelmann pringelmann added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 12, 2026
@pringelmann

Copy link
Copy Markdown
Contributor Author

Now its broken again 🙈

Error: SyntaxError: The requested module '../../support/utils/sharing.ts' does not provide an export named 'SharePermission'

Sorry about that, was losing focus last night. Will fix

This is a bit more complicated to fix. We cannot import from modules that reference window within the playwright spec. This will likely come up more frequently so I will read the docs and try to find a solution.

@susnux

susnux commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Oh wait thats because of my suggestion with @nextcloud/files? 👀
In that case if you do not find an easy solution ignore my comment from before and duplicate it?

@pringelmann

Copy link
Copy Markdown
Contributor Author

Oh wait thats because of my suggestion with @nextcloud/files? 👀 In that case if you do not find an easy solution ignore my comment from before and duplicate it?

Duplicating it will be my last resort yes, but it was a good suggestion and I would like to apply it

@pringelmann

Copy link
Copy Markdown
Contributor Author

Oh wait thats because of my suggestion with @nextcloud/files? 👀 In that case if you do not find an easy solution ignore my comment from before and duplicate it?

Duplicating it will be my last resort yes, but it was a good suggestion and I would like to apply it

@susnux so I can technically fix it by partially type-checking the duplicated const. This way we prevent drift but its also a little bit complicated:

export const SharePermission = {
	READ: 1,
	UPDATE: 2,
	CREATE: 4,
	DELETE: 8,
	SHARE: 16,
} as const satisfies Partial<typeof import('@nextcloud/files').Permission>

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
@pringelmann pringelmann force-pushed the test/migrate-files-copy-move-playwright branch from 8ddc72f to aad5729 Compare June 12, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress CI tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants