OpenSlides/integration/cypress/integration/committee-update.spec.js
Sean 85c0e50c21 Integration tests using cypress
Test client integration (client loads)
Test auth integration (client logs in)
Test backend integration (accept request)
  - broken
Test autoupdate integration (sends au to client)

Add manual cypress tests
Add dockered cypress tests

Add Readme
Add test execution to makefile
Add test execution to github-actions

TODO:
- Create user for tests
- flush db after every test
2021-09-16 17:16:51 +02:00

44 lines
1.1 KiB
JavaScript

describe("Update a committee", () => {
let committeeName;
let committeeId;
beforeEach(() => {
cy.login();
committeeName = `Cypress ${Date.now().toString()}`;
const committeeData = {
organization_id: 1,
name: committeeName,
manager_ids: [1],
};
cy.os4request("committee.create", committeeData).then((res) => {
committeeId = res.id;
});
cy.visit("/committees/");
});
it("Has new Committee", () => {
cy.visit(`/committees/${committeeId}`);
cy.url().should("include", committeeId);
cy.get("h1").contains(committeeName);
});
/**
* Some bugs
*/
// it("Can just update a new Committee", () => {
// cy.visit(`/committees/${committeeId}/edit-committee`);
// cy.url().should("include", `${committeeId}/edit-committee`);
// cy.get(".title-slot").contains("Edit committee");
// cy.get("#mat-input-0").type("edit");
// // cy.intercept({
// // method: "POST",
// // url: "/system/action/handle_request",
// // }).as("au");
// // cy.wait("@au");
// cy.get("form").submit();
// cy.url().should("not.include", `edit-committee`);
// });
});