|
Lines 162-175
describe("Agreement CRUD operations", () => {
Link Here
|
| 162 |
cy.left_menu_active_item_is("Agreements"); |
162 |
cy.left_menu_active_item_is("Agreements"); |
| 163 |
|
163 |
|
| 164 |
// Fill in the form for normal attributes |
164 |
// Fill in the form for normal attributes |
| 165 |
cy.get("#agreements_add").contains("Submit").click(); |
165 |
cy.get("#agreements_add").contains("Save").click(); |
| 166 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
166 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
| 167 |
"have.length", |
167 |
"have.length", |
| 168 |
2 |
168 |
2 |
| 169 |
); |
169 |
); |
| 170 |
cy.get("#name").type(agreement.name); |
170 |
cy.get("#name").type(agreement.name); |
| 171 |
cy.get("#description").type(agreement.description); |
171 |
cy.get("#description").type(agreement.description); |
| 172 |
cy.get("#agreements_add").contains("Submit").click(); |
172 |
cy.get("#agreements_add").contains("Save").click(); |
| 173 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
173 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
| 174 |
"have.length", |
174 |
"have.length", |
| 175 |
1 |
175 |
1 |
|
Lines 208-214
describe("Agreement CRUD operations", () => {
Link Here
|
| 208 |
); |
208 |
); |
| 209 |
|
209 |
|
| 210 |
cy.contains("Add new period").click(); |
210 |
cy.contains("Add new period").click(); |
| 211 |
cy.get("#agreements_add").contains("Submit").click(); |
211 |
cy.get("#agreements_add").contains("Save").click(); |
| 212 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
212 |
cy.get("input:invalid,textarea:invalid,select:invalid").should( |
| 213 |
"have.length", |
213 |
"have.length", |
| 214 |
1 |
214 |
1 |
|
Lines 295-301
describe("Agreement CRUD operations", () => {
Link Here
|
| 295 |
cy.intercept("POST", "/api/v1/erm/agreements", { |
295 |
cy.intercept("POST", "/api/v1/erm/agreements", { |
| 296 |
statusCode: 500, |
296 |
statusCode: 500, |
| 297 |
}); |
297 |
}); |
| 298 |
cy.get("#agreements_add").contains("Submit").click(); |
298 |
cy.get("#agreements_add").contains("Save").click(); |
| 299 |
cy.get("main div[class='alert alert-warning']").contains( |
299 |
cy.get("main div[class='alert alert-warning']").contains( |
| 300 |
"Something went wrong: Error: Internal Server Error" |
300 |
"Something went wrong: Error: Internal Server Error" |
| 301 |
); |
301 |
); |
|
Lines 305-311
describe("Agreement CRUD operations", () => {
Link Here
|
| 305 |
statusCode: 201, |
305 |
statusCode: 201, |
| 306 |
body: agreement, |
306 |
body: agreement, |
| 307 |
}); |
307 |
}); |
| 308 |
cy.get("#agreements_add").contains("Submit").click(); |
308 |
cy.get("#agreements_add").contains("Save").click(); |
| 309 |
cy.get("main div[class='alert alert-info']").contains( |
309 |
cy.get("main div[class='alert alert-info']").contains( |
| 310 |
"Agreement created" |
310 |
"Agreement created" |
| 311 |
); |
311 |
); |
|
Lines 493-499
describe("Agreement CRUD operations", () => {
Link Here
|
| 493 |
delay: 1000, |
493 |
delay: 1000, |
| 494 |
}); |
494 |
}); |
| 495 |
}).as("edit-agreement"); |
495 |
}).as("edit-agreement"); |
| 496 |
cy.get("#agreements_add").contains("Submit").click(); |
496 |
cy.get("#agreements_add").contains("Save").click(); |
| 497 |
cy.get("main div[class='modal_centered']").contains("Submitting..."); |
497 |
cy.get("main div[class='modal_centered']").contains("Submitting..."); |
| 498 |
cy.wait("@edit-agreement"); |
498 |
cy.wait("@edit-agreement"); |
| 499 |
cy.get("main div[class='alert alert-warning']").contains( |
499 |
cy.get("main div[class='alert alert-warning']").contains( |
|
Lines 505-511
describe("Agreement CRUD operations", () => {
Link Here
|
| 505 |
statusCode: 200, |
505 |
statusCode: 200, |
| 506 |
body: agreement, |
506 |
body: agreement, |
| 507 |
}); |
507 |
}); |
| 508 |
cy.get("#agreements_add").contains("Submit").click(); |
508 |
cy.get("#agreements_add").contains("Save").click(); |
| 509 |
cy.get("main div[class='alert alert-info']").contains( |
509 |
cy.get("main div[class='alert alert-info']").contains( |
| 510 |
"Agreement updated" |
510 |
"Agreement updated" |
| 511 |
); |
511 |
); |