From 0fbfadd2e8e7fce71801808bd7e54979f3c00928 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 11 Aug 2022 17:17:18 +0100 Subject: [PATCH 1/3] Cypress: Smoke Build - Timing based Changes Adding a few corrections to support failing/Flakey smoke tests (timing issues) --- packages/builder/cypress/integration/appOverview.spec.js | 2 +- packages/builder/cypress/support/commands.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/builder/cypress/integration/appOverview.spec.js b/packages/builder/cypress/integration/appOverview.spec.js index feaace6fb6..d7f2882b26 100644 --- a/packages/builder/cypress/integration/appOverview.spec.js +++ b/packages/builder/cypress/integration/appOverview.spec.js @@ -266,7 +266,7 @@ filterTests(["all"], () => { cy.reload() cy.log("Current deployment version: " + clientPackage.version) - cy.get(".version-status a", { timeout: 1000 }).contains("Update").click() + cy.get(".version-status a", { timeout: 5000 }).contains("Update").click() cy.get(".spectrum-Tabs-item.is-selected").contains("Settings") cy.get(".version-section .page-action button") diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index dbcdb04acb..85531b2f32 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -128,7 +128,9 @@ Cypress.Commands.add("updateUserInformation", (firstName, lastName) => { .should("have.value", lastName) .blur() } - cy.get("button").contains("Update information").click({ force: true }) + cy.get(".confirm-wrap").within(() => { + cy.get("button").contains("Update information").click({ force: true }) + }) cy.get(".spectrum-Dialog-grid").should("not.exist") }) }) @@ -432,6 +434,7 @@ Cypress.Commands.add("createAppFromScratch", appName => { // TABLES Cypress.Commands.add("createTable", (tableName, initialTable) => { + // Creates an internal Budibase DB table if (!initialTable) { cy.navigateToDataSection() cy.get(`[data-cy="new-table"]`, { timeout: 2000 }).click() @@ -445,6 +448,10 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => { .contains("Continue") .click({ force: true }) }) + cy.get(".spectrum-Modal", { timeout: 2000 }).should( + "not.contain", + "Add data source" + ) cy.get(".spectrum-Modal", { timeout: 2000 }).within(() => { cy.get("input", { timeout: 2000 }).first().type(tableName).blur() cy.get(".spectrum-ButtonGroup").contains("Create").click() From 9893db4bb0063a8ff1b4e0dd77a1f6990f71d217 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 11 Aug 2022 17:29:59 +0100 Subject: [PATCH 2/3] Timeout increase for createTable Cypress Command --- packages/builder/cypress/support/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 85531b2f32..d33bd516c1 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -448,7 +448,7 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => { .contains("Continue") .click({ force: true }) }) - cy.get(".spectrum-Modal", { timeout: 2000 }).should( + cy.get(".spectrum-Modal", { timeout: 10000 }).should( "not.contain", "Add data source" ) From f99a6c69a530d1fc93090a86da6b3d341b776f71 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 11 Aug 2022 17:43:33 +0100 Subject: [PATCH 3/3] Removing Add Multi-Option Datatype Test from Cypress Suite We don't need a specific test file for this. The test file will remain for now but will not run. The test will be reworked into a different test file or as part of the API testing --- .../builder/cypress/integration/addMultiOptionDatatype.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js index f436f3ff39..f844402958 100644 --- a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -2,7 +2,7 @@ import filterTests from "../support/filterTests" const interact = require('../support/interact') filterTests(['all'], () => { - context("Add Multi-Option Datatype", () => { + xcontext("Add Multi-Option Datatype", () => { before(() => { cy.login() cy.createTestApp()