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 <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-10-26 08:41:21 +02:00 committed by Tomas Cohen Arazi
parent 39a47a924f
commit a5f919d5f9
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 8 additions and 8 deletions

View file

@ -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")

View file

@ -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")