From d9f0d9da1c536a122384dac022bc94caa5cf2f4a Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 18 Jul 2022 14:28:27 +0100 Subject: [PATCH] Create App Tests: Timeout Changes This test spec file fires off against every PR. There is some timing issues currently. I am making a few changes in relation to timeout values (a small restructure too) in hopes this helps with the PR builds. Tests pass locally for me, so there may be more changes required against this spec file as I check its performance --- packages/builder/cypress/integration/createApp.spec.js | 10 ++-------- packages/builder/cypress/support/commands.js | 6 ++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/builder/cypress/integration/createApp.spec.js b/packages/builder/cypress/integration/createApp.spec.js index ca52c66e35..1dd0d2264f 100644 --- a/packages/builder/cypress/integration/createApp.spec.js +++ b/packages/builder/cypress/integration/createApp.spec.js @@ -100,24 +100,18 @@ filterTests(['smoke', 'all'], () => { }) it("should create the first application from scratch, using the users first name as the default app name", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) cy.updateUserInformation("Ted", "Userman") cy.createApp("", false) - - cy.visit(`${Cypress.config().baseUrl}/builder`) - cy.applicationInAppTable("Teds app") cy.deleteApp("Teds app") - //Accomodate names that end in 'S' + // Accomodate names that end in 'S' cy.updateUserInformation("Chris", "Userman") cy.createApp("", false) - - cy.visit(`${Cypress.config().baseUrl}/builder`) - cy.applicationInAppTable("Chris app") cy.deleteApp("Chris app") diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index becac0fb47..21df5b8592 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -139,7 +139,9 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => { cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true }) // If apps already exist - cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`, { + timeout: 5000, + }) .its("body") .then(val => { if (val.length > 0) { @@ -379,7 +381,7 @@ Cypress.Commands.add("searchForApplication", appName => { // Assumes there are no others Cypress.Commands.add("applicationInAppTable", appName => { cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) - cy.get(".appTable", { timeout: 2000 }).within(() => { + cy.get(".appTable", { timeout: 5000 }).within(() => { cy.get(".title").contains(appName).should("exist") }) })