From 90156c8037cdc4e82b255687a77f29b7b8bd1b63 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 13 Nov 2025 13:20:59 +0100 Subject: [PATCH] test: adjust cypress tests for updated `@nextcloud/password-confirmation` Co-authored-by: Ferdinand Thiessen Signed-off-by: Andy Scherzinger --- cypress/e2e/files_external/files-user-credentials.cy.ts | 4 ++-- cypress/e2e/settings/usersUtils.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/files_external/files-user-credentials.cy.ts b/cypress/e2e/files_external/files-user-credentials.cy.ts index 3f8d5a740d9..0bcb356c864 100644 --- a/cypress/e2e/files_external/files-user-credentials.cy.ts +++ b/cypress/e2e/files_external/files-user-credentials.cy.ts @@ -66,7 +66,7 @@ describe('Files user credentials', { testIsolation: true }, () => { storageDialog.should('not.exist') // Storage dialog now closed, the user auth dialog should be visible - const authDialog = cy.findByRole('dialog', { name: 'Confirm your password' }) + const authDialog = cy.findByRole('dialog', { name: 'Authentication required' }) authDialog.should('be.visible') handlePasswordConfirmation(user1.password) @@ -115,7 +115,7 @@ describe('Files user credentials', { testIsolation: true }, () => { .should('not.exist') // Storage dialog now closed, the user auth dialog should be visible - cy.findByRole('dialog', { name: 'Confirm your password' }) + cy.findByRole('dialog', { name: 'Authentication required' }) .as('authDialog') .should('be.visible') handlePasswordConfirmation(user2.password) diff --git a/cypress/e2e/settings/usersUtils.ts b/cypress/e2e/settings/usersUtils.ts index 7d8ea55d35b..96b19343be9 100644 --- a/cypress/e2e/settings/usersUtils.ts +++ b/cypress/e2e/settings/usersUtils.ts @@ -72,11 +72,12 @@ export function toggleEditButton(user: User, toEdit = true) { */ export function handlePasswordConfirmation(adminPassword = 'admin') { const handleModal = (context: Cypress.Chainable) => { - return context.contains('.modal-container', 'Confirm your password') + return context.contains('.modal-container', 'Authentication required') .if() .within(() => { cy.get('input[type="password"]').type(adminPassword) - cy.get('button').contains('Confirm').click() + cy.findByRole('button', { name: 'Confirm' }) + .click() }) }