From a4c51b7f0b64a5796c9b37ae0bef21b705cc4118 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 09:12:34 +0100 Subject: [PATCH 1/5] 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", () => { From ad30fe1799cdd20266b47c4aff9ef3525cad346c Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 09:50:02 +0100 Subject: [PATCH 2/5] Cypress Command + Rest Timeout update rest.spec.js - Test was flakey on last nights smoke run - Updated to specifically search for query-buttons and then add query commands.js - Increasing timeout values for createTable & createDatasourceScreen commands --- .../integration/datasources/rest.spec.js | 2 +- packages/builder/cypress/support/commands.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/builder/cypress/integration/datasources/rest.spec.js b/packages/builder/cypress/integration/datasources/rest.spec.js index 488c30c0cf..7a145049e2 100644 --- a/packages/builder/cypress/integration/datasources/rest.spec.js +++ b/packages/builder/cypress/integration/datasources/rest.spec.js @@ -14,7 +14,7 @@ filterTests(["smoke", "all"], () => { // Select REST data source cy.selectExternalDatasource(datasource) // Enter incorrect api & attempt to send query - cy.get(".spectrum-Button", { timeout: 500 }).contains("Add query").click({ force: true }) + cy.get(".query-buttons", { timeout: 1000 }).contains("Add query").click({ force: true }) cy.intercept("**/preview").as("queryError") cy.get("input").clear().type("random text") cy.get(".spectrum-Button").contains("Send").click({ force: true }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 3e935ee3d9..37f085082a 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -457,8 +457,8 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => { cy.get(".spectrum-ButtonGroup").contains("Create").click() }) // Ensure modal has closed and table is created - cy.get(".spectrum-Modal").should("not.exist") - cy.get(".spectrum-Tabs-content", { timeout: 1000 }).should( + cy.get(".spectrum-Modal", { timeout: 2000 }).should("not.exist") + cy.get(".spectrum-Tabs-content", { timeout: 2000 }).should( "contain", tableName ) @@ -642,25 +642,25 @@ Cypress.Commands.add( cy.get(".spectrum-Button").contains("Continue").click({ force: true }) }) cy.get(".spectrum-Modal [data-cy='data-source-modal']", { - timeout: 500, + timeout: 20000, }).within(() => { for (let i = 0; i < datasourceNames.length; i++) { - cy.wait(500) - cy.get(".data-source-entry").contains(datasourceNames[i]).click() + cy.get(".data-source-entry", { timeout: 10000 }) + .contains(datasourceNames[i]) + .click({ force: true }) //Ensure the check mark is visible cy.get(".data-source-entry") .contains(datasourceNames[i]) - .get(".data-source-check") + .get(".data-source-check", { timeout: 10000 }) .should("exist") } cy.get(".spectrum-Button").contains("Confirm").click({ force: true }) }) - cy.get(".spectrum-Modal").within(() => { + cy.get(".spectrum-Modal", { timeout: 10000 }).within(() => { if (accessLevelLabel) { - cy.get(".spectrum-Picker-label").click() - cy.wait(500) + cy.get(".spectrum-Picker-label", { timeout: 10000 }).click() cy.contains(accessLevelLabel).click() } cy.get(".spectrum-Button").contains("Done").click({ force: true }) From 19f29789e65f08fb9e76ebdfc4c49e38b12d4443 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 10:23:04 +0100 Subject: [PATCH 3/5] createDatasourceScreen - increase timeouts --- packages/builder/cypress/support/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 37f085082a..651ff7eabe 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -646,11 +646,11 @@ Cypress.Commands.add( }).within(() => { for (let i = 0; i < datasourceNames.length; i++) { cy.get(".data-source-entry", { timeout: 10000 }) - .contains(datasourceNames[i]) + .contains(datasourceNames[i], { timeout: 10000 }) .click({ force: true }) //Ensure the check mark is visible cy.get(".data-source-entry") - .contains(datasourceNames[i]) + .contains(datasourceNames[i], { timeout: 10000 }) .get(".data-source-check", { timeout: 10000 }) .should("exist") } From 22784948170277305fc43d240a5518ad1cbbed02 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 11:15:52 +0100 Subject: [PATCH 4/5] Increase timeout for PostgreSQL test --- .../builder/cypress/integration/datasources/postgreSql.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/integration/datasources/postgreSql.spec.js b/packages/builder/cypress/integration/datasources/postgreSql.spec.js index 582aa1cd2a..622c3ade73 100644 --- a/packages/builder/cypress/integration/datasources/postgreSql.spec.js +++ b/packages/builder/cypress/integration/datasources/postgreSql.spec.js @@ -162,7 +162,7 @@ filterTests(["all"], () => { switchSchema("randomText") // No tables displayed - cy.get(".spectrum-Body", { timeout: 20000 }).eq(2).should("contain", "No tables found") + cy.get(".spectrum-Body", { timeout: 10000 }).eq(2, { timeout: 10000 }).should("contain", "No tables found") // Previously created query should be visible cy.get(".spectrum-Table").should("contain", queryName) From d7c55b0968f3f1b09569254ba38cb2682e8b3708 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 12:14:17 +0100 Subject: [PATCH 5/5] Updating commands.js - createDatasourceScreen These changes are related to the autoScreensUI tests failing on the smoke build CI run. I've changed timeout values and reworking data-cy IDs --- packages/builder/cypress/support/commands.js | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 651ff7eabe..e7f753fdb0 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -637,21 +637,20 @@ Cypress.Commands.add( (datasourceNames, accessLevelLabel) => { cy.contains("Design").click() cy.get(".spectrum-Button").contains("Add screen").click({ force: true }) - cy.get(".spectrum-Modal").within(() => { - cy.get(".item").contains("Autogenerated screens").click() + cy.get(".spectrum-Dialog-grid").within(() => { + cy.get("[data-cy='autogenerated-screens']").click() cy.get(".spectrum-Button").contains("Continue").click({ force: true }) }) - cy.get(".spectrum-Modal [data-cy='data-source-modal']", { - timeout: 20000, - }).within(() => { + cy.get("[data-cy='autogenerated-screens']").should("not.exist") + cy.get("[data-cy='data-source-modal']", { timeout: 10000 }).within(() => { for (let i = 0; i < datasourceNames.length; i++) { - cy.get(".data-source-entry", { timeout: 10000 }) - .contains(datasourceNames[i], { timeout: 10000 }) - .click({ force: true }) - //Ensure the check mark is visible cy.get(".data-source-entry") - .contains(datasourceNames[i], { timeout: 10000 }) - .get(".data-source-check", { timeout: 10000 }) + .contains(datasourceNames[i], { timeout: 20000 }) + .click({ force: true }) + // Ensure the check mark is visible + cy.get(".data-source-entry") + .contains(datasourceNames[i]) + .get(".data-source-check", { timeout: 20000 }) .should("exist") }