View | Details | Raw Unified | Return to bug 40051
Collapse All | Expand All

(-)a/t/cypress/integration/Acquisitions/Vendors_spec.ts (-3 / +2 lines)
Lines 200-206 describe("Vendor CRUD operations", () => { Link Here
200
        // Click the 'Edit' button from the list
200
        // Click the 'Edit' button from the list
201
        cy.get("#vendors_list table tbody tr:first").contains("Edit").click();
201
        cy.get("#vendors_list table tbody tr:first").contains("Edit").click();
202
        cy.wait("@get-vendor");
202
        cy.wait("@get-vendor");
203
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
204
        cy.get("#vendor_add h1").contains("Edit vendor");
203
        cy.get("#vendor_add h1").contains("Edit vendor");
205
204
206
        // Form has been correctly filled in
205
        // Form has been correctly filled in
Lines 229-236 describe("Vendor CRUD operations", () => { Link Here
229
                "X-Base-Total-Count": "1",
228
                "X-Base-Total-Count": "1",
230
                "X-Total-Count": "1",
229
                "X-Total-Count": "1",
231
            },
230
            },
232
        });
231
        }).as("get-vendors");
233
        cy.visit("/cgi-bin/koha/acquisition/vendors");
232
        cy.visit("/cgi-bin/koha/acquisition/vendors");
233
        cy.wait("@get-vendors");
234
        cy.intercept(
234
        cy.intercept(
235
            "GET",
235
            "GET",
236
            new RegExp("/api/v1/acquisitions/vendors/(?!config$).+"),
236
            new RegExp("/api/v1/acquisitions/vendors/(?!config$).+"),
Lines 242-248 describe("Vendor CRUD operations", () => { Link Here
242
        );
242
        );
243
        name_link.should("have.text", vendor.name + " (#" + vendor.id + ")");
243
        name_link.should("have.text", vendor.name + " (#" + vendor.id + ")");
244
        name_link.click();
244
        name_link.click();
245
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
246
        cy.get("#vendors_show h1").contains(vendor.name);
245
        cy.get("#vendors_show h1").contains(vendor.name);
247
246
248
        // TODO Test contracts table
247
        // TODO Test contracts table
(-)a/t/cypress/integration/AdditionalFields_spec.ts (-6 / +6 lines)
Lines 774-780 describe("Additional Fields operations", () => { Link Here
774
                "X-Base-Total-Count": "1",
774
                "X-Base-Total-Count": "1",
775
                "X-Total-Count": "1",
775
                "X-Total-Count": "1",
776
            },
776
            },
777
        });
777
        }).as("get-licenses");
778
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
778
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
779
            "get-license"
779
            "get-license"
780
        );
780
        );
Lines 804-812 describe("Additional Fields operations", () => { Link Here
804
        ).as("avcategories");
804
        ).as("avcategories");
805
805
806
        cy.visit("/cgi-bin/koha/erm/licenses");
806
        cy.visit("/cgi-bin/koha/erm/licenses");
807
        cy.wait("@get-licenses");
807
        cy.get("#licenses_list table tbody tr:first").contains("Edit").click();
808
        cy.get("#licenses_list table tbody tr:first").contains("Edit").click();
808
        cy.wait("@get-license");
809
        cy.wait("@get-license");
809
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
810
810
811
        // All additional fields should be pre-populated
811
        // All additional fields should be pre-populated
812
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
812
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
Lines 1167-1173 describe("Additional Fields operations", () => { Link Here
1167
                "X-Base-Total-Count": "1",
1167
                "X-Base-Total-Count": "1",
1168
                "X-Total-Count": "1",
1168
                "X-Total-Count": "1",
1169
            },
1169
            },
1170
        });
1170
        }).as("get-agreements");
1171
        cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as(
1171
        cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as(
1172
            "get-agreement"
1172
            "get-agreement"
1173
        );
1173
        );
Lines 1197-1207 describe("Additional Fields operations", () => { Link Here
1197
        ).as("avcategories");
1197
        ).as("avcategories");
1198
1198
1199
        cy.visit("/cgi-bin/koha/erm/agreements");
1199
        cy.visit("/cgi-bin/koha/erm/agreements");
1200
        cy.wait("@get-agreements");
1200
        cy.get("#agreements_list table tbody tr:first")
1201
        cy.get("#agreements_list table tbody tr:first")
1201
            .contains("Edit")
1202
            .contains("Edit")
1202
            .click();
1203
            .click();
1203
        cy.wait("@get-agreement");
1204
        cy.wait("@get-agreement");
1204
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
1205
1205
1206
        // All additional fields should be pre-populated
1206
        // All additional fields should be pre-populated
1207
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
1207
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
Lines 1574-1580 describe("Additional Fields operations", () => { Link Here
1574
                "X-Base-Total-Count": "1",
1574
                "X-Base-Total-Count": "1",
1575
                "X-Total-Count": "1",
1575
                "X-Total-Count": "1",
1576
            },
1576
            },
1577
        });
1577
        }).as("get-eholdings-packages");
1578
        cy.intercept(
1578
        cy.intercept(
1579
            "GET",
1579
            "GET",
1580
            "/api/v1/erm/eholdings/local/packages/*",
1580
            "/api/v1/erm/eholdings/local/packages/*",
Lines 1606-1614 describe("Additional Fields operations", () => { Link Here
1606
        ).as("avcategories");
1606
        ).as("avcategories");
1607
1607
1608
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
1608
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
1609
        cy.wait("@get-eholdings-packages");
1609
        cy.get("#packages_list table tbody tr:first").contains("Edit").click();
1610
        cy.get("#packages_list table tbody tr:first").contains("Edit").click();
1610
        cy.wait("@get-eholdings-package");
1611
        cy.wait("@get-eholdings-package");
1611
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
1612
1612
1613
        // All additional fields should be pre-populated
1613
        // All additional fields should be pre-populated
1614
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
1614
        cy.get("#additional_fields #additional_field_1 .vs__selected").contains(
(-)a/t/cypress/integration/ERM/Agreements_spec.ts (-5 / +4 lines)
Lines 440-446 describe("Agreement CRUD operations", () => { Link Here
440
            .contains("Edit")
440
            .contains("Edit")
441
            .click();
441
            .click();
442
        cy.wait("@get-agreement");
442
        cy.wait("@get-agreement");
443
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
444
        cy.get("#agreements_add h2").contains("Edit agreement");
443
        cy.get("#agreements_add h2").contains("Edit agreement");
445
        cy.left_menu_active_item_is("Agreements");
444
        cy.left_menu_active_item_is("Agreements");
446
445
Lines 499-508 describe("Agreement CRUD operations", () => { Link Here
499
                statusCode: 500,
498
                statusCode: 500,
500
                delay: 1000,
499
                delay: 1000,
501
            });
500
            });
502
        });
501
        }).as("edit-agreement");
503
        cy.get("#agreements_add").contains("Submit").click();
502
        cy.get("#agreements_add").contains("Submit").click();
504
        cy.get("main div[class='modal_centered']").contains("Submitting...");
503
        cy.get("main div[class='modal_centered']").contains("Submitting...");
505
        cy.wait(1000);
504
        cy.wait("@edit-agreement");
506
        cy.get("main div[class='alert alert-warning']").contains(
505
        cy.get("main div[class='alert alert-warning']").contains(
507
            "Something went wrong: Error: Internal Server Error"
506
            "Something went wrong: Error: Internal Server Error"
508
        );
507
        );
Lines 529-539 describe("Agreement CRUD operations", () => { Link Here
529
                "X-Base-Total-Count": "1",
528
                "X-Base-Total-Count": "1",
530
                "X-Total-Count": "1",
529
                "X-Total-Count": "1",
531
            },
530
            },
532
        });
531
        }).as("get-agreements");
533
        cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as(
532
        cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as(
534
            "get-agreement"
533
            "get-agreement"
535
        );
534
        );
536
        cy.visit("/cgi-bin/koha/erm/agreements");
535
        cy.visit("/cgi-bin/koha/erm/agreements");
536
        cy.wait("@get-agreements");
537
        let id_cell = cy.get("#agreements_list table tbody tr:first td:first");
537
        let id_cell = cy.get("#agreements_list table tbody tr:first td:first");
538
        id_cell.contains(agreement.agreement_id);
538
        id_cell.contains(agreement.agreement_id);
539
539
Lines 544-550 describe("Agreement CRUD operations", () => { Link Here
544
        name_link.should("have.text", agreement.name);
544
        name_link.should("have.text", agreement.name);
545
        name_link.click();
545
        name_link.click();
546
        cy.wait("@get-agreement");
546
        cy.wait("@get-agreement");
547
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
548
        cy.get("#agreements_show h2").contains(
547
        cy.get("#agreements_show h2").contains(
549
            "Agreement #" + agreement.agreement_id
548
            "Agreement #" + agreement.agreement_id
550
        );
549
        );
(-)a/t/cypress/integration/ERM/DataProviders_spec.ts (-7 / +6 lines)
Lines 168-174 describe("Data provider CRUD operations", () => { Link Here
168
                "X-Base-Total-Count": "1",
168
                "X-Base-Total-Count": "1",
169
                "X-Total-Count": "1",
169
                "X-Total-Count": "1",
170
            },
170
            },
171
        });
171
        }).as("get-data-providers");
172
        cy.intercept(
172
        cy.intercept(
173
            "GET",
173
            "GET",
174
            "/api/v1/erm/usage_data_providers/*",
174
            "/api/v1/erm/usage_data_providers/*",
Lines 188-198 describe("Data provider CRUD operations", () => { Link Here
188
        );
188
        );
189
189
190
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
190
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
191
        cy.wait("@get-data-providers");
191
        cy.get("#usage_data_providers_list table tbody tr:first")
192
        cy.get("#usage_data_providers_list table tbody tr:first")
192
            .contains("Edit")
193
            .contains("Edit")
193
            .click();
194
            .click();
194
        cy.wait("@get-data-provider");
195
        cy.wait("@get-data-provider");
195
        cy.wait(1000); // Cypress is too fast! Vue hasn't populated the form yet!
196
        cy.get("#data_providers_add h2").contains("Edit usage data provider");
196
        cy.get("#data_providers_add h2").contains("Edit usage data provider");
197
197
198
        // Form has been correctly filled in
198
        // Form has been correctly filled in
Lines 290-296 describe("Data provider CRUD operations", () => { Link Here
290
        );
290
        );
291
        name_link.click();
291
        name_link.click();
292
        cy.wait("@get-data-provider");
292
        cy.wait("@get-data-provider");
293
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
294
        cy.get("#usage_data_providers_show h2").contains(
293
        cy.get("#usage_data_providers_show h2").contains(
295
            "Data provider #" + dataProvider.erm_usage_data_provider_id
294
            "Data provider #" + dataProvider.erm_usage_data_provider_id
296
        );
295
        );
Lines 359-371 describe("Data provider CRUD operations", () => { Link Here
359
                "X-Base-Total-Count": "1",
358
                "X-Base-Total-Count": "1",
360
                "X-Total-Count": "1",
359
                "X-Total-Count": "1",
361
            },
360
            },
362
        });
361
        }).as("get-data-providers");
363
        cy.intercept(
362
        cy.intercept(
364
            "GET",
363
            "GET",
365
            "/api/v1/erm/usage_data_providers/*",
364
            "/api/v1/erm/usage_data_providers/*",
366
            dataProvider
365
            dataProvider
367
        ).as("get-data-provider");
366
        ).as("get-data-provider");
368
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
367
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
368
        cy.wait("@get-data-providers");
369
        let name_link = cy.get(
369
        let name_link = cy.get(
370
            "#usage_data_providers_list table tbody tr:first td:first a"
370
            "#usage_data_providers_list table tbody tr:first td:first a"
371
        );
371
        );
Lines 378-384 describe("Data provider CRUD operations", () => { Link Here
378
        );
378
        );
379
        name_link.click();
379
        name_link.click();
380
        cy.wait("@get-data-provider");
380
        cy.wait("@get-data-provider");
381
        cy.wait(500);
382
        cy.get("#usage_data_providers_show h2").contains(
381
        cy.get("#usage_data_providers_show h2").contains(
383
            "Data provider #" + dataProvider.erm_usage_data_provider_id
382
            "Data provider #" + dataProvider.erm_usage_data_provider_id
384
        );
383
        );
Lines 501-513 describe("Data provider tab options", () => { Link Here
501
                "X-Base-Total-Count": "1",
500
                "X-Base-Total-Count": "1",
502
                "X-Total-Count": "1",
501
                "X-Total-Count": "1",
503
            },
502
            },
504
        });
503
        }).as("get-data-providers");
505
        cy.intercept(
504
        cy.intercept(
506
            "GET",
505
            "GET",
507
            "/api/v1/erm/usage_data_providers/*",
506
            "/api/v1/erm/usage_data_providers/*",
508
            dataProvider
507
            dataProvider
509
        ).as("get-data-provider");
508
        ).as("get-data-provider");
510
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
509
        cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers");
510
        cy.wait("@get-data-providers");
511
        let name_link = cy.get(
511
        let name_link = cy.get(
512
            "#usage_data_providers_list table tbody tr:first td:first a"
512
            "#usage_data_providers_list table tbody tr:first td:first a"
513
        );
513
        );
Lines 520-526 describe("Data provider tab options", () => { Link Here
520
        );
520
        );
521
        name_link.click();
521
        name_link.click();
522
        cy.wait("@get-data-provider");
522
        cy.wait("@get-data-provider");
523
        cy.wait(500);
524
    });
523
    });
525
524
526
    it("Should display provider details", () => {
525
    it("Should display provider details", () => {
(-)a/t/cypress/integration/ERM/Licenses_spec.ts (-6 / +6 lines)
Lines 167-180 describe("License CRUD operations", () => { Link Here
167
                "X-Base-Total-Count": "1",
167
                "X-Base-Total-Count": "1",
168
                "X-Total-Count": "1",
168
                "X-Total-Count": "1",
169
            },
169
            },
170
        });
170
        }).as("get-licenses");
171
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
171
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
172
            "get-license"
172
            "get-license"
173
        );
173
        );
174
        cy.visit("/cgi-bin/koha/erm/licenses");
174
        cy.visit("/cgi-bin/koha/erm/licenses");
175
        cy.wait("@get-licenses");
175
        cy.get("#licenses_list table tbody tr:first").contains("Edit").click();
176
        cy.get("#licenses_list table tbody tr:first").contains("Edit").click();
176
        cy.wait("@get-license");
177
        cy.wait("@get-license");
177
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
178
        cy.get("#licenses_add h2").contains("Edit license");
178
        cy.get("#licenses_add h2").contains("Edit license");
179
        cy.left_menu_active_item_is("Licenses");
179
        cy.left_menu_active_item_is("Licenses");
180
180
Lines 241-251 describe("License CRUD operations", () => { Link Here
241
                "X-Base-Total-Count": "1",
241
                "X-Base-Total-Count": "1",
242
                "X-Total-Count": "1",
242
                "X-Total-Count": "1",
243
            },
243
            },
244
        });
244
        }).as("get-licenses");
245
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
245
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
246
            "get-license"
246
            "get-license"
247
        );
247
        );
248
        cy.visit("/cgi-bin/koha/erm/licenses");
248
        cy.visit("/cgi-bin/koha/erm/licenses");
249
        cy.wait("@get-licenses");
249
        let id_cell = cy.get("#licenses_list table tbody tr:first td:first");
250
        let id_cell = cy.get("#licenses_list table tbody tr:first td:first");
250
        id_cell.contains(license.license_id);
251
        id_cell.contains(license.license_id);
251
252
Lines 256-262 describe("License CRUD operations", () => { Link Here
256
        name_link.should("have.text", license.name);
257
        name_link.should("have.text", license.name);
257
        name_link.click();
258
        name_link.click();
258
        cy.wait("@get-license");
259
        cy.wait("@get-license");
259
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
260
        cy.get("#licenses_show h2").contains("License #" + license.license_id);
260
        cy.get("#licenses_show h2").contains("License #" + license.license_id);
261
        cy.left_menu_active_item_is("Licenses");
261
        cy.left_menu_active_item_is("Licenses");
262
    });
262
    });
Lines 319-329 describe("License CRUD operations", () => { Link Here
319
                "X-Base-Total-Count": "1",
319
                "X-Base-Total-Count": "1",
320
                "X-Total-Count": "1",
320
                "X-Total-Count": "1",
321
            },
321
            },
322
        });
322
        }).as("get-licenses");
323
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
323
        cy.intercept("GET", "/api/v1/erm/licenses/*", license).as(
324
            "get-license"
324
            "get-license"
325
        );
325
        );
326
        cy.visit("/cgi-bin/koha/erm/licenses");
326
        cy.visit("/cgi-bin/koha/erm/licenses");
327
        cy.wait("@get-licenses");
327
        let id_cell = cy.get("#licenses_list table tbody tr:first td:first");
328
        let id_cell = cy.get("#licenses_list table tbody tr:first td:first");
328
        id_cell.contains(license.license_id);
329
        id_cell.contains(license.license_id);
329
330
Lines 334-340 describe("License CRUD operations", () => { Link Here
334
        name_link.should("have.text", license.name);
335
        name_link.should("have.text", license.name);
335
        name_link.click();
336
        name_link.click();
336
        cy.wait("@get-license");
337
        cy.wait("@get-license");
337
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
338
        cy.get("#licenses_show h2").contains("License #" + license.license_id);
338
        cy.get("#licenses_show h2").contains("License #" + license.license_id);
339
339
340
        cy.get("#licenses_show #toolbar").contains("Delete").click();
340
        cy.get("#licenses_show #toolbar").contains("Delete").click();
(-)a/t/cypress/integration/ERM/Packages_spec.ts (-8 / +7 lines)
Lines 135-147 describe("Package CRUD operations", () => { Link Here
135
                "X-Base-Total-Count": "1",
135
                "X-Base-Total-Count": "1",
136
                "X-Total-Count": "1",
136
                "X-Total-Count": "1",
137
            },
137
            },
138
        });
138
        }).as("get-packages");
139
        cy.intercept(
139
        cy.intercept(
140
            "GET",
140
            "GET",
141
            "/api/v1/erm/eholdings/local/packages/*",
141
            "/api/v1/erm/eholdings/local/packages/*",
142
            erm_package
142
            erm_package
143
        ).as("get-package");
143
        ).as("get-package");
144
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
144
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
145
        cy.wait("@get-packages");
145
        // Intercept related agreements request after entering agreement edit
146
        // Intercept related agreements request after entering agreement edit
146
        cy.intercept("GET", "/api/v1/erm/agreements*", {
147
        cy.intercept("GET", "/api/v1/erm/agreements*", {
147
            statusCode: 200,
148
            statusCode: 200,
Lines 149-155 describe("Package CRUD operations", () => { Link Here
149
        }).as("get-related-agreements");
150
        }).as("get-related-agreements");
150
        cy.get("#packages_list table tbody tr:first").contains("Edit").click();
151
        cy.get("#packages_list table tbody tr:first").contains("Edit").click();
151
        cy.wait("@get-package");
152
        cy.wait("@get-package");
152
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
153
        cy.get("#packages_add h2").contains("Edit package");
153
        cy.get("#packages_add h2").contains("Edit package");
154
        cy.left_menu_active_item_is("Packages");
154
        cy.left_menu_active_item_is("Packages");
155
155
Lines 194-206 describe("Package CRUD operations", () => { Link Here
194
                "X-Base-Total-Count": "1",
194
                "X-Base-Total-Count": "1",
195
                "X-Total-Count": "1",
195
                "X-Total-Count": "1",
196
            },
196
            },
197
        });
197
        }).as("get-packages");
198
        cy.intercept(
198
        cy.intercept(
199
            "GET",
199
            "GET",
200
            "/api/v1/erm/eholdings/local/packages/*",
200
            "/api/v1/erm/eholdings/local/packages/*",
201
            erm_package
201
            erm_package
202
        ).as("get-package");
202
        ).as("get-package");
203
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
203
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
204
        cy.wait("@get-packages");
204
        let name_link = cy.get(
205
        let name_link = cy.get(
205
            "#packages_list table tbody tr:first td:first a"
206
            "#packages_list table tbody tr:first td:first a"
206
        );
207
        );
Lines 210-216 describe("Package CRUD operations", () => { Link Here
210
        );
211
        );
211
        name_link.click();
212
        name_link.click();
212
        cy.wait("@get-package");
213
        cy.wait("@get-package");
213
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
214
        cy.get("#packages_show h2").contains(
214
        cy.get("#packages_show h2").contains(
215
            "Package #" + erm_package.package_id
215
            "Package #" + erm_package.package_id
216
        );
216
        );
Lines 249-257 describe("Package CRUD operations", () => { Link Here
249
            }
249
            }
250
        ).as("get-resource");
250
        ).as("get-resource");
251
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages/1");
251
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages/1");
252
        cy.contains("Titles (1)");
253
        cy.wait("@get-resource");
252
        cy.wait("@get-resource");
254
        cy.wait(500);
253
        cy.contains("Titles (1)");
255
        cy.get("#title_list_result table").contains("A great title");
254
        cy.get("#title_list_result table").contains("A great title");
256
    });
255
    });
257
256
Lines 317-329 describe("Package CRUD operations", () => { Link Here
317
                "X-Base-Total-Count": "1",
316
                "X-Base-Total-Count": "1",
318
                "X-Total-Count": "1",
317
                "X-Total-Count": "1",
319
            },
318
            },
320
        });
319
        }).as("get-packages");
321
        cy.intercept(
320
        cy.intercept(
322
            "GET",
321
            "GET",
323
            "/api/v1/erm/eholdings/local/packages/*",
322
            "/api/v1/erm/eholdings/local/packages/*",
324
            erm_package
323
            erm_package
325
        ).as("get-package");
324
        ).as("get-package");
326
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
325
        cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
326
        cy.wait("@get-packages");
327
        let name_link = cy.get(
327
        let name_link = cy.get(
328
            "#packages_list table tbody tr:first td:first a"
328
            "#packages_list table tbody tr:first td:first a"
329
        );
329
        );
Lines 333-339 describe("Package CRUD operations", () => { Link Here
333
        );
333
        );
334
        name_link.click();
334
        name_link.click();
335
        cy.wait("@get-package");
335
        cy.wait("@get-package");
336
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
337
        cy.get("#packages_show h2").contains(
336
        cy.get("#packages_show h2").contains(
338
            "Package #" + erm_package.package_id
337
            "Package #" + erm_package.package_id
339
        );
338
        );
(-)a/t/cypress/integration/ERM/Titles_spec.ts (-10 / +9 lines)
Lines 44-50 describe("Title CRUD operations", () => { Link Here
44
            body: [],
44
            body: [],
45
        }).as("get-empty-packages");
45
        }).as("get-empty-packages");
46
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
46
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
47
        cy.wait(500);
47
        cy.wait("@get-empty-packages");
48
        cy.get("#toolbar a").contains("Import from list").click();
48
        cy.get("#toolbar a").contains("Import from list").click();
49
        cy.get("h2").contains("Import from a list");
49
        cy.get("h2").contains("Import from a list");
50
        cy.left_menu_active_item_is("Titles");
50
        cy.left_menu_active_item_is("Titles");
Lines 56-64 describe("Title CRUD operations", () => { Link Here
56
            body: get_packages_to_relate(),
56
            body: get_packages_to_relate(),
57
        }).as("get-related-packages");
57
        }).as("get-related-packages");
58
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
58
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
59
        cy.wait("@get-related-packages");
59
        cy.get("#toolbar a").contains("Import from list").click();
60
        cy.get("#toolbar a").contains("Import from list").click();
60
        cy.get("h2").contains("Import from a list");
61
        cy.get("h2").contains("Import from a list");
61
        cy.wait(500);
62
62
63
        // Prepare background job response to the POST
63
        // Prepare background job response to the POST
64
        cy.intercept("POST", "/api/v1/erm/eholdings/local/titles/import", {
64
        cy.intercept("POST", "/api/v1/erm/eholdings/local/titles/import", {
Lines 125-131 describe("Title CRUD operations", () => { Link Here
125
125
126
        // Click the button in the toolbar
126
        // Click the button in the toolbar
127
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
127
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
128
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
129
        cy.contains("New title").click();
128
        cy.contains("New title").click();
130
        cy.get("#titles_add h2").contains("New title");
129
        cy.get("#titles_add h2").contains("New title");
131
        cy.left_menu_active_item_is("Titles");
130
        cy.left_menu_active_item_is("Titles");
Lines 234-246 describe("Title CRUD operations", () => { Link Here
234
                "X-Base-Total-Count": "1",
233
                "X-Base-Total-Count": "1",
235
                "X-Total-Count": "1",
234
                "X-Total-Count": "1",
236
            },
235
            },
237
        });
236
        }).as("get-titles");
238
        cy.intercept(
237
        cy.intercept(
239
            "GET",
238
            "GET",
240
            "/api/v1/erm/eholdings/local/titles/*",
239
            "/api/v1/erm/eholdings/local/titles/*",
241
            erm_title
240
            erm_title
242
        ).as("get-title");
241
        ).as("get-title");
243
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
242
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
243
        cy.wait("@get-titles");
244
        // Intercept related packages request after entering title edit
244
        // Intercept related packages request after entering title edit
245
        cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", {
245
        cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", {
246
            statusCode: 200,
246
            statusCode: 200,
Lines 249-255 describe("Title CRUD operations", () => { Link Here
249
249
250
        cy.get("#titles_list table tbody tr:first").contains("Edit").click();
250
        cy.get("#titles_list table tbody tr:first").contains("Edit").click();
251
        cy.wait("@get-title");
251
        cy.wait("@get-title");
252
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
253
        cy.get("#titles_add h2").contains("Edit title");
252
        cy.get("#titles_add h2").contains("Edit title");
254
        cy.left_menu_active_item_is("Titles");
253
        cy.left_menu_active_item_is("Titles");
255
254
Lines 376-382 describe("Title CRUD operations", () => { Link Here
376
                "X-Base-Total-Count": "1",
375
                "X-Base-Total-Count": "1",
377
                "X-Total-Count": "1",
376
                "X-Total-Count": "1",
378
            },
377
            },
379
        });
378
        }).as("get-titles");
380
        // Title with empty resources.
379
        // Title with empty resources.
381
        cy.intercept(
380
        cy.intercept(
382
            {
381
            {
Lines 393-398 describe("Title CRUD operations", () => { Link Here
393
            }
392
            }
394
        ).as("get-title");
393
        ).as("get-title");
395
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
394
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
395
        cy.wait("@get-titles");
396
        let title_link = cy.get("#titles_list table tbody tr:first td:first a");
396
        let title_link = cy.get("#titles_list table tbody tr:first td:first a");
397
        title_link.should(
397
        title_link.should(
398
            "have.text",
398
            "have.text",
Lines 400-406 describe("Title CRUD operations", () => { Link Here
400
        );
400
        );
401
        cy.get("#titles_list table tbody tr:first td:first a").click();
401
        cy.get("#titles_list table tbody tr:first td:first a").click();
402
        cy.wait("@get-title");
402
        cy.wait("@get-title");
403
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
404
        cy.get("#eholdings_title_show h2").contains(
403
        cy.get("#eholdings_title_show h2").contains(
405
            "Title #" + erm_title.title_id
404
            "Title #" + erm_title.title_id
406
        );
405
        );
Lines 418-425 describe("Title CRUD operations", () => { Link Here
418
417
419
        // List packages
418
        // List packages
420
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles/1");
419
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles/1");
420
        cy.wait("@get-title");
421
        cy.contains("Packages (1)");
421
        cy.contains("Packages (1)");
422
        cy.wait(500);
423
422
424
        // Visit resource
423
        // Visit resource
425
        let related_package = erm_title.resources[0];
424
        let related_package = erm_title.resources[0];
Lines 485-491 describe("Title CRUD operations", () => { Link Here
485
                "X-Base-Total-Count": "1",
484
                "X-Base-Total-Count": "1",
486
                "X-Total-Count": "1",
485
                "X-Total-Count": "1",
487
            },
486
            },
488
        });
487
        }).as("get-titles");
489
        // Title with empty resources.
488
        // Title with empty resources.
490
        cy.intercept(
489
        cy.intercept(
491
            {
490
            {
Lines 502-507 describe("Title CRUD operations", () => { Link Here
502
            }
501
            }
503
        ).as("get-title");
502
        ).as("get-title");
504
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
503
        cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
504
        cy.wait("@get-titles");
505
        let title_link = cy.get("#titles_list table tbody tr:first td:first a");
505
        let title_link = cy.get("#titles_list table tbody tr:first td:first a");
506
        title_link.should(
506
        title_link.should(
507
            "have.text",
507
            "have.text",
Lines 509-515 describe("Title CRUD operations", () => { Link Here
509
        );
509
        );
510
        cy.get("#titles_list table tbody tr:first td:first a").click();
510
        cy.get("#titles_list table tbody tr:first td:first a").click();
511
        cy.wait("@get-title");
511
        cy.wait("@get-title");
512
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
513
        cy.get("#eholdings_title_show h2").contains(
512
        cy.get("#eholdings_title_show h2").contains(
514
            "Title #" + erm_title.title_id
513
            "Title #" + erm_title.title_id
515
        );
514
        );
(-)a/t/cypress/integration/InfiniteScrollSelect_spec.ts (-1 lines)
Lines 396-402 describe("Infinite scroll", () => { Link Here
396
            .contains("Edit")
396
            .contains("Edit")
397
            .click();
397
            .click();
398
        cy.wait("@get-agreement");
398
        cy.wait("@get-agreement");
399
        cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!
400
399
401
        // Licenses should be labelled correctly
400
        // Licenses should be labelled correctly
402
        cy.get("#agreement_license_0 #license_id_0 .vs__selected").contains(
401
        cy.get("#agreement_license_0 #license_id_0 .vs__selected").contains(
(-)a/t/cypress/integration/KohaTable/KohaTable_spec.ts (-7 / +2 lines)
Lines 288-309 describe("kohaTable (using REST API)", () => { Link Here
288
            });
288
            });
289
        });
289
        });
290
290
291
        it("Jump to the configuration page", () => {
291
        it.only("Jump to the configuration page", () => {
292
            cy.visit("/cgi-bin/koha/admin/branches.pl");
292
            cy.visit("/cgi-bin/koha/admin/branches.pl");
293
            cy.get(`#${table_id}_wrapper .dt_button_configure_table`).click();
293
            cy.get(`#${table_id}_wrapper .dt_button_configure_table`).click();
294
            cy.url().should("contain", "module=admin");
294
            cy.url().should("contain", "module=admin");
295
            cy.url().should("contain", "page=libraries");
295
            cy.url().should("contain", "page=libraries");
296
            cy.url().should("contain", "table=libraries");
296
            cy.url().should("contain", "table=libraries");
297
297
298
            cy.wait(2000); // ensure the animation completes, random failures?
299
            cy.get("#admin_panel")
298
            cy.get("#admin_panel")
300
                .contains("Table id: libraries")
299
                .contains("Table id: libraries")
301
                .should("be.visible");
300
                .should("be.visible");
302
301
303
            cy.window().then(win => {
302
            cy.window().its("scrollY").should("be.gt", 0); // Ensure some scrolling happened
304
                const scrollTop = win.scrollY || win.pageYOffset;
305
                expect(scrollTop).to.be.greaterThan(0); // Ensure some scrolling happened
306
            });
307
        });
303
        });
308
    });
304
    });
309
305
310
- 

Return to bug 40051