Skip to content

Commit 90156c8

Browse files
test: adjust cypress tests for updated @nextcloud/password-confirmation
Co-authored-by: Ferdinand Thiessen <[email protected]> Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 2de1030 commit 90156c8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cypress/e2e/files_external/files-user-credentials.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
6666
storageDialog.should('not.exist')
6767

6868
// Storage dialog now closed, the user auth dialog should be visible
69-
const authDialog = cy.findByRole('dialog', { name: 'Confirm your password' })
69+
const authDialog = cy.findByRole('dialog', { name: 'Authentication required' })
7070
authDialog.should('be.visible')
7171
handlePasswordConfirmation(user1.password)
7272

@@ -115,7 +115,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
115115
.should('not.exist')
116116

117117
// Storage dialog now closed, the user auth dialog should be visible
118-
cy.findByRole('dialog', { name: 'Confirm your password' })
118+
cy.findByRole('dialog', { name: 'Authentication required' })
119119
.as('authDialog')
120120
.should('be.visible')
121121
handlePasswordConfirmation(user2.password)

cypress/e2e/settings/usersUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ export function toggleEditButton(user: User, toEdit = true) {
7272
*/
7373
export function handlePasswordConfirmation(adminPassword = 'admin') {
7474
const handleModal = (context: Cypress.Chainable) => {
75-
return context.contains('.modal-container', 'Confirm your password')
75+
return context.contains('.modal-container', 'Authentication required')
7676
.if()
7777
.within(() => {
7878
cy.get('input[type="password"]').type(adminPassword)
79-
cy.get('button').contains('Confirm').click()
79+
cy.findByRole('button', { name: 'Confirm' })
80+
.click()
8081
})
8182
}
8283

0 commit comments

Comments
 (0)