Lines 125-133
describe("Agreement CRUD operations", () => {
Link Here
|
125 |
beforeEach(() => { |
125 |
beforeEach(() => { |
126 |
cy.login(); |
126 |
cy.login(); |
127 |
cy.title().should("eq", "Koha staff interface"); |
127 |
cy.title().should("eq", "Koha staff interface"); |
128 |
|
|
|
129 |
cy.intercept("GET", "/api/v1/authorised_value_categories*").as("avs"); |
130 |
cy.intercept("GET", "/api/v1/acquisitions/vendors*").as("vendors"); |
131 |
}); |
128 |
}); |
132 |
|
129 |
|
133 |
after(() => { |
130 |
after(() => { |
Lines 140-146
describe("Agreement CRUD operations", () => {
Link Here
|
140 |
statusCode: 500, |
137 |
statusCode: 500, |
141 |
error: "Something went wrong", |
138 |
error: "Something went wrong", |
142 |
}); |
139 |
}); |
143 |
cy.visit("/cgi-bin/koha/erm/erm.pl"); |
140 |
cy.visit_and_wait("/cgi-bin/koha/erm/erm.pl"); |
144 |
cy.get("#navmenulist").contains("Agreements").click(); |
141 |
cy.get("#navmenulist").contains("Agreements").click(); |
145 |
cy.get("main div[class='dialog alert']").contains( |
142 |
cy.get("main div[class='dialog alert']").contains( |
146 |
/Something went wrong/ |
143 |
/Something went wrong/ |
Lines 180-187
describe("Agreement CRUD operations", () => {
Link Here
|
180 |
}); |
177 |
}); |
181 |
|
178 |
|
182 |
// Click the button in the toolbar |
179 |
// Click the button in the toolbar |
183 |
cy.visit("/cgi-bin/koha/erm/agreements"); |
180 |
cy.visit_and_wait("/cgi-bin/koha/erm/agreements"); |
184 |
cy.wait(["@avs", "@vendors"]); |
|
|
185 |
cy.contains("New agreement").click(); |
181 |
cy.contains("New agreement").click(); |
186 |
cy.get("#agreements_add h2").contains("New agreement"); |
182 |
cy.get("#agreements_add h2").contains("New agreement"); |
187 |
|
183 |
|
Lines 379-385
describe("Agreement CRUD operations", () => {
Link Here
|
379 |
"X-Total-Count": "1", |
375 |
"X-Total-Count": "1", |
380 |
}, |
376 |
}, |
381 |
}).as("get-single-agreement-search-result"); |
377 |
}).as("get-single-agreement-search-result"); |
382 |
cy.visit("/cgi-bin/koha/erm/agreements"); |
378 |
cy.visit_and_wait("/cgi-bin/koha/erm/agreements"); |
383 |
|
379 |
|
384 |
// Intercept request after edit click |
380 |
// Intercept request after edit click |
385 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( |
381 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( |
Lines 470-476
describe("Agreement CRUD operations", () => {
Link Here
|
470 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( |
466 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( |
471 |
"get-agreement" |
467 |
"get-agreement" |
472 |
); |
468 |
); |
473 |
cy.visit("/cgi-bin/koha/erm/agreements"); |
469 |
cy.visit_and_wait("/cgi-bin/koha/erm/agreements"); |
474 |
let name_link = cy.get( |
470 |
let name_link = cy.get( |
475 |
"#agreements_list table tbody tr:first td:first a" |
471 |
"#agreements_list table tbody tr:first td:first a" |
476 |
); |
472 |
); |
Lines 506-512
describe("Agreement CRUD operations", () => {
Link Here
|
506 |
}, |
502 |
}, |
507 |
}); |
503 |
}); |
508 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement); |
504 |
cy.intercept("GET", "/api/v1/erm/agreements/*", agreement); |
509 |
cy.visit("/cgi-bin/koha/erm/agreements"); |
505 |
cy.visit_and_wait("/cgi-bin/koha/erm/agreements"); |
510 |
|
506 |
|
511 |
cy.get("#agreements_list table tbody tr:first") |
507 |
cy.get("#agreements_list table tbody tr:first") |
512 |
.contains("Delete") |
508 |
.contains("Delete") |