Skip to content

Commit e2f0ffd

Browse files
committed
fix: make cypress create user more informative
Without this commit cypress may sat it has created a user when that is not the case. Nextcloud returns a 200 HTTP code with a status set to "failure" Signed-off-by: Robbert Gurdeep Singh <[email protected]> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent ee0c787 commit e2f0ffd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cypress/support/commands.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
6565
Authorization: `Basic ${btoa('admin:admin')}`,
6666
},
6767
}).then(response => {
68-
cy.log(`Created user ${user}`, response.status)
68+
if(response.body.ocs.meta.status.toLowerCase() == "ok"){
69+
cy.log(`Created user ${user}`, response.status)
70+
} else {
71+
throw new Error(`Unable to create user`)
72+
}
6973
})
7074
})
7175

0 commit comments

Comments
 (0)