Bug 40046: Prevent random failures when verifying select's values

Commands like .select() are queued. We need to prevent the should to
happen before the select is executed.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9ebfd8d462)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-06-03 16:12:32 +02:00 committed by Paul Derscheid
parent 1406d3b7a7
commit b8709b9df0
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 18 additions and 17 deletions

View File

@ -27,12 +27,9 @@ describe("loads the manage MARC import page", () => {
it("upload a MARC record", () => {
cy.visit("/cgi-bin/koha/tools/stage-marc-import.pl");
cy.get('input[type="file"]').selectFile(
"t/cypress/fixtures/sample.mrc"
);
cy.get('form[id="uploadfile"]').within(() => {
cy.get('button[id="fileuploadbutton"]').click();
});
cy.fixture("sample.mrc", null).as("sample_mrc");
cy.get("input[type=file]").selectFile("@sample_mrc");
cy.get("#fileuploadbutton").click();
cy.get("#fileuploadstatus").contains("100%");
cy.get("legend")
@ -54,20 +51,24 @@ describe("loads the manage MARC import page", () => {
"always_add"
);
cy.get('select[name="format"]').select("MARCXML", { force: true });
cy.get("#format").should("have.value", "MARCXML");
cy.get('select[name="format"]')
.select("MARCXML", { force: true })
.should("have.value", "MARCXML");
//select some new options
cy.get("#matcher").select("3", { force: true });
cy.get("#overlay_action").select("create_new", { force: true });
cy.get("#nomatch_action").select("ignore", { force: true });
cy.get("#item_action").select("ignore", { force: true });
// Now verify all values
cy.get("#matcher").should("have.value", "3");
cy.get("#overlay_action").should("have.value", "create_new");
cy.get("#nomatch_action").should("have.value", "ignore");
cy.get("#item_action").should("have.value", "ignore");
cy.get("#matcher")
.select("3", { force: true })
.should("have.value", "3");
cy.get("#overlay_action")
.select("create_new", { force: true })
.should("have.value", "create_new");
cy.get("#nomatch_action")
.select("ignore", { force: true })
.should("have.value", "ignore");
cy.get("#item_action")
.select("ignore", { force: true })
.should("have.value", "ignore");
cy.get("#mainformsubmit").click();