Skip to content

Commit 26f5879

Browse files
committed
chore(cypress): Try to analyze failures
Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
1 parent bfa6608 commit 26f5879

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cypress/e2e/files/FilesUtils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,15 @@ export function moveFile(fileName: string, dirPath: string) {
230230
.findByRole('button', { name: 'All files' })
231231
.should('be.visible')
232232
.click()
233+
// [picker-diag] log the exact button texts to see the root label
234+
cy.get('button').then(($b) => cy.task('log', '[picker-diag] move buttons=' + JSON.stringify(Array.from($b).map((x) => (x as HTMLElement).textContent)), { log: false }))
233235
// Click move. Match the confirm button EXACTLY as "Move": the picker
234236
// labels it "Move to {folder}" while inside a folder and only "Move"
235237
// once it has navigated to the home root. A loose `contains('Move')`
236238
// would match the stale "Move to {folder}" button before the "All
237239
// files" navigation above has landed, moving the file into the wrong
238240
// folder. The exact match makes cypress wait for the root button.
239-
cy.contains('button', /^Move$/).should('be.visible').click()
241+
cy.contains('button', /^\s*Move\s*$/).should('be.visible').click()
240242
} else if (dirPath === '.') {
241243
// click move
242244
cy.contains('button', 'Copy').should('be.visible').click()
@@ -274,14 +276,16 @@ export function copyFile(fileName: string, dirPath: string) {
274276
.findByRole('button', { name: 'All files' })
275277
.should('be.visible')
276278
.click()
279+
// [picker-diag] log the exact button texts to see the root label
280+
cy.get('button').then(($b) => cy.task('log', '[picker-diag] copy buttons=' + JSON.stringify(Array.from($b).map((x) => (x as HTMLElement).textContent)), { log: false }))
277281
// Click copy. Match the confirm button EXACTLY as "Copy": the picker
278282
// labels it "Copy to {folder}" while inside a folder and only "Copy"
279283
// once it has navigated to the home root. A loose `contains('Copy')`
280284
// would match the stale "Copy to {folder}" button before the "All
281285
// files" navigation above has landed, copying the file into the wrong
282286
// folder (deduplicated as "… (1)"). The exact match makes cypress
283287
// wait for the root button.
284-
cy.contains('button', /^Copy$/).should('be.visible').click()
288+
cy.contains('button', /^\s*Copy\s*$/).should('be.visible').click()
285289
} else if (dirPath === '.') {
286290
// click copy
287291
cy.contains('button', 'Copy').should('be.visible').click()

0 commit comments

Comments
 (0)