From a5f919d5f916d653a274e48d7400694928df574b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Oct 2022 08:41:21 +0200 Subject: [PATCH] Bug 32030: Fix Cypress tests - flatpickr selector Since bug 30718 the input does no longer the displayed value. Let select the input that has the iso date values but... Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- cypress/integration/Agreements_spec.ts | 12 ++++++------ cypress/integration/Licenses_spec.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/integration/Agreements_spec.ts b/cypress/integration/Agreements_spec.ts index b2b552e572..ea287ab125 100644 --- a/cypress/integration/Agreements_spec.ts +++ b/cypress/integration/Agreements_spec.ts @@ -137,14 +137,14 @@ describe("Agreement CRUD operations", () => { // Selecting the flatpickr values is a bit tedious here... // We have 3 date inputs per period - cy.get("#ended_on_0").click(); + cy.get("#ended_on_0+input").click(); // Second flatpickr => ended_on for the first period cy.get(".flatpickr-calendar") .eq(1) .find("span.today") .click({ force: true }); // select today. No idea why we should force, but there is a random failure otherwise - cy.get("#started_on_0").click(); + cy.get("#started_on_0+input").click(); cy.get(".flatpickr-calendar") .eq(0) .find("span.today") @@ -153,9 +153,9 @@ describe("Agreement CRUD operations", () => { cy.get("#ended_on_0").should("have.value", ""); // Has been reset correctly - cy.get("#started_on_0").click(); + cy.get("#started_on_0+input").click(); cy.get(".flatpickr-calendar").eq(0).find("span.today").click(); // select today - cy.get("#ended_on_0").click({ force: true }); // No idea why we should force, but there is a random failure otherwise + cy.get("#ended_on_0+input").click({ force: true }); // No idea why we should force, but there is a random failure otherwise cy.get(".flatpickr-calendar") .eq(1) .find("span.today") @@ -163,9 +163,9 @@ describe("Agreement CRUD operations", () => { .click(); // select tomorrow // Second period - cy.get("#started_on_1").click({ force: true }); + cy.get("#started_on_1+input").click({ force: true }); cy.get(".flatpickr-calendar").eq(3).find("span.today").click(); // select today - cy.get("#cancellation_deadline_1").click(); + cy.get("#cancellation_deadline_1+input").click(); cy.get(".flatpickr-calendar") .eq(5) .find("span.today") diff --git a/cypress/integration/Licenses_spec.ts b/cypress/integration/Licenses_spec.ts index f2498bbdaf..6a8b32dc55 100644 --- a/cypress/integration/Licenses_spec.ts +++ b/cypress/integration/Licenses_spec.ts @@ -80,13 +80,13 @@ describe("License CRUD operations", () => { cy.get("#license_type .vs__search").type(license.type + '{enter}',{force:true}); cy.get("#license_status .vs__search").type(license.status + '{enter}',{force:true}); - cy.get("#started_on").click(); + cy.get("#started_on+input").click(); cy.get(".flatpickr-calendar") .eq(0) .find("span.today") .click({ force: true }); - cy.get("#ended_on").click(); + cy.get("#ended_on+input").click(); cy.get(".flatpickr-calendar") .eq(1) .find("span.today") -- 2.39.5