From 57f5a321f9308b3693584d59060d3c7fd3d8540f Mon Sep 17 00:00:00 2001 From: Sauli Purhonen Date: Tue, 10 Aug 2021 12:31:02 +0300 Subject: [PATCH] Cypress test fix --- cypress/integration/editForm.spec.js | 1 + cypress/integration/objectTitles.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/integration/editForm.spec.js b/cypress/integration/editForm.spec.js index eb51d17b9..a52692e47 100644 --- a/cypress/integration/editForm.spec.js +++ b/cypress/integration/editForm.spec.js @@ -57,6 +57,7 @@ describe("Populate form and render form elements by object data", function () { cy.get("[data-testid='sampleData.dataDescription']").should("have.value", testData.sampleTypeDescription) // Clear object in state + cy.get("button[type=button]", { timeout: 10000 }).contains("New form").should("exist") cy.get("button[type=button]").contains("New form").click() // Test updated title diff --git a/cypress/integration/objectTitles.spec.js b/cypress/integration/objectTitles.spec.js index a9947b8ea..b49ebfdd9 100644 --- a/cypress/integration/objectTitles.spec.js +++ b/cypress/integration/objectTitles.spec.js @@ -32,8 +32,8 @@ describe("draft and submitted objects' titles", function () { // Edit submitted object cy.get("button[type=button]").contains("Edit").click() - cy.get("@studyTitle").should("have.value", "Test title") - cy.get("@studyTitle").type(" 2").blur() + cy.get("@studyTitle", { timeout: 10000 }).should("have.value", "Test title").type(" 2") + cy.get("@studyTitle").blur() cy.get("@studyTitle").should("have.value", "Test title 2") cy.get("button[type=button]").contains("Update", { timeout: 10000 }).click() cy.get("div[role=alert]").contains("Object updated")