test(files): migrate copy/move e2e from Cypress to Playwright#61165
test(files): migrate copy/move e2e from Cypress to Playwright#61165pringelmann wants to merge 2 commits into
Conversation
| 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>', |
There was a problem hiding this comment.
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' }, |
There was a problem hiding this comment.
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
bcea929 to
92ca014
Compare
92ca014 to
0150af1
Compare
Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
cd0bf3f to
7bfe733
Compare
7bfe733 to
8ddc72f
Compare
|
Now its broken again 🙈
|
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 |
|
Oh wait thats because of my suggestion with |
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>
8ddc72f to
aad5729
Compare
Summary
Migrates the
filesandfiles_sharingcopy/move specs. Adds aCopyMoveDialogPagefile-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
AI (if applicable)