diff options
author | Christopher Ng <chrng8@gmail.com> | 2023-08-02 11:38:48 -0700 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2023-08-08 17:20:25 -0700 |
commit | cd38017724c60d114b0400614967fbcb0056f9fa (patch) | |
tree | 85757bca11cbc59bf68587d5cf99ffb82b49f853 /cypress | |
parent | 780ece032fd42ec099d888a46a5349d8dea48dc2 (diff) | |
download | nextcloud-server-cd38017724c60d114b0400614967fbcb0056f9fa.tar.gz nextcloud-server-cd38017724c60d114b0400614967fbcb0056f9fa.zip |
fix(cypress): Can delete a user
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/settings/users.cy.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cypress/e2e/settings/users.cy.ts b/cypress/e2e/settings/users.cy.ts index 3a96f7546db..9bc0c8ad657 100644 --- a/cypress/e2e/settings/users.cy.ts +++ b/cypress/e2e/settings/users.cy.ts @@ -150,6 +150,20 @@ describe('Settings: Create and delete users', function() { cy.get('.action-item__popper .action').contains('Delete user').should('exist').click() // And confirmation dialog accepted cy.get('.oc-dialog button').contains(`Delete ${jdoe.userId}`).click() + + // Ignore failure if modal is not shown + cy.once('fail', (error) => { + expect(error.name).to.equal('AssertionError') + expect(error).to.have.property('node', '.modal-container') + }) + // Make sure no confirmation modal is shown + cy.get('body').find('.modal-container').then(($modal) => { + if ($modal.length > 0) { + cy.wrap($modal).find('input[type="password"]').type(admin.password) + cy.wrap($modal).find('button').contains('Confirm').click() + } + }) + // deleted clicked the user is not shown anymore cy.get(`tbody.user-list__body tr td[data-test="${jdoe.userId}"]`).parents('tr').should('not.be.visible') }) |