From 94bded075bcd98ec4baddb68b25c2f0eb429188e Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 09:12:34 +0100 Subject: [PATCH] closeModal Command Update Adding a line to verify that the modal was closed userManagement.spec.js - Increasing timeouts --- .../integration/adminAndManagement/userManagement.spec.js | 6 +++--- packages/builder/cypress/support/commands.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js b/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js index 5a864e3bb3..000ca7cb54 100644 --- a/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js +++ b/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js @@ -74,11 +74,11 @@ filterTests(["smoke", "all"], () => { .contains("Update role") .click({ force: true }) }) - cy.reload({ timeout: 5000 }) + cy.reload() cy.wait(1000) } // Confirm roles exist within Configure roles table - cy.get(interact.SPECTRUM_TABLE, { timeout: 2000 }) + cy.get(interact.SPECTRUM_TABLE, { timeout: 20000 }) .eq(0) .within(assginedRoles => { expect(assginedRoles).to.contain("Admin") @@ -180,7 +180,7 @@ filterTests(["smoke", "all"], () => { cy.reload() // Confirm details have been saved - cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => { + cy.get(interact.FIELD, { timeout: 20000 }).eq(1).within(() => { cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', "bb") }) cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => { diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 394d5e9af2..3e935ee3d9 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -915,8 +915,9 @@ Cypress.Commands.add("createRestQuery", (method, restUrl, queryPrettyName) => { Cypress.Commands.add("closeModal", () => { cy.get(".spectrum-Modal", { timeout: 2000 }).within(() => { cy.get(".close-icon").click() - cy.wait(1000) // Wait for modal to close }) + // Confirm modal has closed + cy.get(".spectrum-Modal", { timeout: 10000 }).should("not.exist") }) Cypress.Commands.add("expandBudibaseConnection", () => {