Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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]>
  • Loading branch information
beardhatcode committed Apr 20, 2021
commit abecd79fbb49c66d8e7f1a972f453db533d3e015
6 changes: 5 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
Authorization: `Basic ${btoa('admin:admin')}`,
},
}).then(response => {
cy.log(`Created user ${user}`, response.status)
if(response.body.ocs.meta.status.toLowerCase() == "ok"){
cy.log(`Created user ${user}`, response.status)
} else {
throw new Error(`Unable to create user`)
}
})
})

Expand Down