mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
update cypress tests, update zod validation error messaging to UI
This commit is contained in:
parent
72ac97c5d9
commit
b1901c7278
18 changed files with 221 additions and 41 deletions
29
cypress/e2e/api.cy.ts
Normal file
29
cypress/e2e/api.cy.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
describe('Website tests', () => {
|
||||
Cypress.session.clearAllSavedSessions();
|
||||
|
||||
beforeEach(() => {
|
||||
cy.login(Cypress.env('umami_user'), Cypress.env('umami_password'));
|
||||
});
|
||||
|
||||
//let userId;
|
||||
|
||||
it('creates a user.', () => {
|
||||
cy.fixture('users').then(data => {
|
||||
const userPost = data.userPost;
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: '/api/users',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
},
|
||||
body: userPost,
|
||||
}).then(response => {
|
||||
//userId = response.body.id;
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('username', 'cypress1');
|
||||
expect(response.body).to.have.property('role', 'User');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue