aboutsummaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-11-12 16:03:39 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2023-11-17 13:42:51 +0100
commitb06951ed3be85d23c8f3557d586d49e1c2a08484 (patch)
tree4a4e038013ad4e9df481e4aa97de73c0fd9ba3bb /cypress
parent8c24a32fda99715fdcb4020eb6f0231d13eb6e79 (diff)
downloadnextcloud-server-b06951ed3be85d23c8f3557d586d49e1c2a08484.tar.gz
nextcloud-server-b06951ed3be85d23c8f3557d586d49e1c2a08484.zip
fix(cypress): Make new-users test less flaky by using test isolation
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/settings/users.cy.ts19
1 files changed, 6 insertions, 13 deletions
diff --git a/cypress/e2e/settings/users.cy.ts b/cypress/e2e/settings/users.cy.ts
index 7c4b7f9df1e..48d518e58c7 100644
--- a/cypress/e2e/settings/users.cy.ts
+++ b/cypress/e2e/settings/users.cy.ts
@@ -27,23 +27,16 @@ const admin = new User('admin', 'admin')
const john = new User('john', '123456')
describe('Settings: Create and delete users', function() {
- before(function() {
- cy.login(admin)
- // open the User settings
- cy.visit('/settings/users')
- })
-
beforeEach(function() {
- cy.login(admin)
cy.listUsers().then((users) => {
- cy.login(admin)
if ((users as string[]).includes(john.userId)) {
// ensure created user is deleted
- cy.deleteUser(john).login(admin)
- // ensure deleted user is not present
- cy.reload().login(admin)
+ cy.deleteUser(john)
}
})
+ cy.login(admin)
+ // open the User settings
+ cy.visit('/settings/users')
})
it('Can create a user', function() {
@@ -64,7 +57,7 @@ describe('Settings: Create and delete users', function() {
// see that the password is 123456
cy.get('input[type="password"]').should('have.value', john.password)
// submit the new user form
- cy.get('button[type="submit"]').click()
+ cy.get('button[type="submit"]').click({ force: true })
})
// Make sure no confirmation modal is shown
@@ -98,7 +91,7 @@ describe('Settings: Create and delete users', function() {
cy.get('input[type="password"]').type(john.password)
cy.get('input[type="password"]').should('have.value', john.password)
// submit the new user form
- cy.get('button[type="submit"]').click()
+ cy.get('button[type="submit"]').click({ force: true })
})
// Make sure no confirmation modal is shown