From 56fac8dff86d7e0eafe3da5ae4b9da3a4c393c25 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 30 Jun 2022 13:53:16 +0100 Subject: [PATCH] Additional timing based changes for createApp All tests pass locally, just having issues with timing on the CI run Also reduced test retries (runs a total of 2 times instead of 3, the 3rd run does not add any value) --- packages/builder/cypress.json | 2 +- .../builder/cypress/integration/createApp.spec.js | 12 ++++++------ packages/builder/cypress/support/commands.js | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/builder/cypress.json b/packages/builder/cypress.json index 06bf558946..46f85a52c8 100644 --- a/packages/builder/cypress.json +++ b/packages/builder/cypress.json @@ -13,7 +13,7 @@ "HOST_IP": "" }, "retries": { - "runMode": 2, + "runMode": 1, "openMode": 0 } } diff --git a/packages/builder/cypress/integration/createApp.spec.js b/packages/builder/cypress/integration/createApp.spec.js index a4cb759ebd..097b70db30 100644 --- a/packages/builder/cypress/integration/createApp.spec.js +++ b/packages/builder/cypress/integration/createApp.spec.js @@ -6,7 +6,7 @@ filterTests(['smoke', 'all'], () => { before(() => { cy.login() - cy.deleteApp("Cypress Tests") + cy.deleteAllApps() }) if (!(Cypress.env("TEST_ENV"))) { @@ -48,7 +48,7 @@ filterTests(['smoke', 'all'], () => { }) it("should enforce a valid url before submission", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) // Start create app process. If apps already exist, click second button cy.get(interact.CREATE_APP_BUTTON, { timeout: 1000 }).click({ force: true }) @@ -91,7 +91,7 @@ filterTests(['smoke', 'all'], () => { it("should create the first application from scratch", () => { const appName = "Cypress Tests" - cy.createApp(appName) + cy.createApp(appName, false) cy.visit(`${Cypress.config().baseUrl}/builder`) @@ -100,7 +100,7 @@ filterTests(['smoke', 'all'], () => { }) it("should create the first application from scratch with a default name", () => { - cy.createApp() + cy.createApp("", false) cy.applicationInAppTable("My app") cy.deleteApp("My app") }) @@ -110,7 +110,7 @@ filterTests(['smoke', 'all'], () => { cy.updateUserInformation("Ted", "Userman") - cy.createApp() + cy.createApp("", false) cy.visit(`${Cypress.config().baseUrl}/builder`) @@ -120,7 +120,7 @@ filterTests(['smoke', 'all'], () => { //Accomodate names that end in 'S' cy.updateUserInformation("Chris", "Userman") - cy.createApp() + cy.createApp("", false) cy.visit(`${Cypress.config().baseUrl}/builder`) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index b8b705bc53..9d77b89c57 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -323,7 +323,8 @@ Cypress.Commands.add("importApp", (exportFilePath, name) => { if (val.length > 0) { cy.get(`[data-cy="create-app-btn"]`).click({ force: true }) } - cy.get(`[data-cy="import-app-btn"]`, { timeout: 500 }).click({ + cy.wait(500) + cy.get(`[data-cy="import-app-btn"]`).click({ force: true, }) }) @@ -372,7 +373,7 @@ Cypress.Commands.add("searchForApplication", appName => { // Assumes there are no others Cypress.Commands.add("applicationInAppTable", appName => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) cy.get(".appTable", { timeout: 2000 }).within(() => { cy.get(".title").contains(appName).should("exist") })