зеркало из https://github.com/nextcloud/text.git
refs #2049 add deleteUser command
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Родитель
0e74b10dd0
Коммит
de69b33a26
|
@ -133,6 +133,7 @@ describe('Open test.md in viewer', function() {
|
|||
cy.openFile('test.md')
|
||||
cy.get('#viewer .modal-header button.header-close').click()
|
||||
cy.get('#viewer').should('not.exist')
|
||||
cy.nextcloudDeleteUser(randUser, 'password')
|
||||
})
|
||||
|
||||
})
|
||||
|
|
|
@ -62,6 +62,22 @@ Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
|
|||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('nextcloudDeleteUser', (user) => {
|
||||
cy.clearCookies()
|
||||
cy.request({
|
||||
method: 'DELETE',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v1.php/cloud/users/${user}`,
|
||||
form: true,
|
||||
auth: { user: 'admin', pass: 'admin' },
|
||||
headers: {
|
||||
'OCS-ApiRequest': 'true',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
}).then(response => {
|
||||
cy.log(`Deleted user ${user}`, response.status)
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('uploadFile', (fileName, mimeType, target) => {
|
||||
cy.fixture(fileName, 'base64')
|
||||
.then(Cypress.Blob.base64StringToBlob)
|
||||
|
|
Загрузка…
Ссылка в новой задаче