mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
Rebrand to Syncfuse
This commit is contained in:
parent
0a09df5470
commit
92025c9dba
144 changed files with 1796 additions and 1977 deletions
|
|
@ -1,125 +1,125 @@
|
|||
describe('User API tests', () => {
|
||||
describe("User API tests", () => {
|
||||
Cypress.session.clearAllSavedSessions();
|
||||
|
||||
before(() => {
|
||||
cy.login(Cypress.env('umami_user'), Cypress.env('umami_password'));
|
||||
cy.login(Cypress.env("syncfuse_user"), Cypress.env("syncfuse_password"));
|
||||
});
|
||||
|
||||
let userId;
|
||||
|
||||
it('Creates a user.', () => {
|
||||
cy.fixture('users').then(data => {
|
||||
it("Creates a user.", () => {
|
||||
cy.fixture("users").then((data) => {
|
||||
const userCreate = data.userCreate;
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: '/api/users',
|
||||
method: "POST",
|
||||
url: "/api/users",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
body: userCreate,
|
||||
}).then(response => {
|
||||
}).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');
|
||||
expect(response.body).to.have.property("username", "cypress1");
|
||||
expect(response.body).to.have.property("role", "user");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Returns all users. Admin access is required.', () => {
|
||||
it("Returns all users. Admin access is required.", () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
url: '/api/admin/users',
|
||||
method: "GET",
|
||||
url: "/api/admin/users",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body.data[0]).to.have.property('id');
|
||||
expect(response.body.data[0]).to.have.property('username');
|
||||
expect(response.body.data[0]).to.have.property('password');
|
||||
expect(response.body.data[0]).to.have.property('role');
|
||||
expect(response.body.data[0]).to.have.property("id");
|
||||
expect(response.body.data[0]).to.have.property("username");
|
||||
expect(response.body.data[0]).to.have.property("password");
|
||||
expect(response.body.data[0]).to.have.property("role");
|
||||
});
|
||||
});
|
||||
|
||||
it('Updates a user.', () => {
|
||||
cy.fixture('users').then(data => {
|
||||
it("Updates a user.", () => {
|
||||
cy.fixture("users").then((data) => {
|
||||
const userUpdate = data.userUpdate;
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
url: `/api/users/${userId}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
body: userUpdate,
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
userId = response.body.id;
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('id', userId);
|
||||
expect(response.body).to.have.property('username', 'cypress1');
|
||||
expect(response.body).to.have.property('role', 'view-only');
|
||||
expect(response.body).to.have.property("id", userId);
|
||||
expect(response.body).to.have.property("username", "cypress1");
|
||||
expect(response.body).to.have.property("role", "view-only");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Gets a user by ID.', () => {
|
||||
it("Gets a user by ID.", () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
url: `/api/users/${userId}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('id', userId);
|
||||
expect(response.body).to.have.property('username', 'cypress1');
|
||||
expect(response.body).to.have.property('role', 'view-only');
|
||||
expect(response.body).to.have.property("id", userId);
|
||||
expect(response.body).to.have.property("username", "cypress1");
|
||||
expect(response.body).to.have.property("role", "view-only");
|
||||
});
|
||||
});
|
||||
|
||||
it('Deletes a user.', () => {
|
||||
it("Deletes a user.", () => {
|
||||
cy.request({
|
||||
method: 'DELETE',
|
||||
method: "DELETE",
|
||||
url: `/api/users/${userId}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('ok', true);
|
||||
expect(response.body).to.have.property("ok", true);
|
||||
});
|
||||
});
|
||||
|
||||
it('Gets all websites that belong to a user.', () => {
|
||||
it("Gets all websites that belong to a user.", () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
url: `/api/users/${userId}/websites`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('data');
|
||||
expect(response.body).to.have.property("data");
|
||||
});
|
||||
});
|
||||
|
||||
it('Gets all teams that belong to a user.', () => {
|
||||
it("Gets all teams that belong to a user.", () => {
|
||||
cy.request({
|
||||
method: 'GET',
|
||||
method: "GET",
|
||||
url: `/api/users/${userId}/teams`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: Cypress.env('authorization'),
|
||||
"Content-Type": "application/json",
|
||||
Authorization: Cypress.env("authorization"),
|
||||
},
|
||||
}).then(response => {
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200);
|
||||
expect(response.body).to.have.property('data');
|
||||
expect(response.body).to.have.property("data");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue