From 48cb425d5f99d832a1362f6efeb1ad012feec656 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 23 Oct 2025 10:14:01 +0000 Subject: [PATCH] Bug 41001: (QA follow-up): Add 'Confirmation messages with inputs' specific tests cypress run --spec t/cypress/integration/ERM/Dialog_spec.ts --- t/cypress/integration/ERM/Dialog_spec.ts | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/t/cypress/integration/ERM/Dialog_spec.ts b/t/cypress/integration/ERM/Dialog_spec.ts index 71d4829b6b0..0494d0ed493 100644 --- a/t/cypress/integration/ERM/Dialog_spec.ts +++ b/t/cypress/integration/ERM/Dialog_spec.ts @@ -180,4 +180,62 @@ describe("Dialog operations", () => { .contains("deleted"); cy.get("main div[class='alert alert-info']").should("have.length", 1); }); + + it("Confirmation messages with inputs", () => { + const dataProvider = cy.get_usage_data_provider(); + const dataProviders = [dataProvider]; + + cy.intercept("GET", "/api/v1/erm/usage_data_providers*", { + statusCode: 200, + body: dataProviders, + headers: { + "X-Base-Total-Count": "1", + "X-Total-Count": "1", + }, + }); + cy.intercept("GET", "/api/v1/erm/usage_data_providers/*", dataProvider); + cy.visit("/cgi-bin/koha/erm/eusage/usage_data_providers"); + + cy.get("#usage_data_providers_list table tbody tr:first") + .contains("Run now") + .click(); + cy.get(".modal.confirmation p").contains(dataProvider.name); + cy.get("body").click(0, 0); + + cy.get("#usage_data_providers_list table tbody tr:first") + .contains("Run now") + .click(); + + cy.intercept( + "POST", + "/api/v1/erm/usage_data_providers/1/process_SUSHI_response*", + { + statusCode: 200, + body: { + jobs: [ + { + report_type: "TR_J1", + job_id: 1, + }, + ], + }, + headers: { + "X-Base-Total-Count": "1", + "X-Total-Count": "1", + }, + } + ); + cy.get("#begin_date+input").click(); + cy.get(".flatpickr-current-month select") + .invoke("val") + .then(month => { + cy.get(".flatpickr-current-month > select > option").eq(0); + cy.get(".dayContainer").contains(new RegExp("^1$")).click(); + }); + cy.get("#accept_modal").click(); + cy.get("main div[class='alert alert-info']").should( + "have.text", + "Job for report type TR_J1 has been queued. Check job progress." + ); + }); }); -- 2.39.5