From 40b44035eadd319de735256eda3c99d62efd716b Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 17 May 2022 12:40:06 +0100 Subject: [PATCH] Smoke build test changes createUserAndRoles.spec.js - Timing issues with the test regarding the smoke build. - Adding timeout values and reloading the page after role assignment commands - Adding a `clear()` to `createAppFromScratch` function. - Previous test runs show that the placeholder value is being taken at times --- .../cypress/integration/createUserAndRoles.spec.js | 4 +++- packages/builder/cypress/support/commands.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/builder/cypress/integration/createUserAndRoles.spec.js b/packages/builder/cypress/integration/createUserAndRoles.spec.js index 2dbe91ce19..4d5a023c4f 100644 --- a/packages/builder/cypress/integration/createUserAndRoles.spec.js +++ b/packages/builder/cypress/integration/createUserAndRoles.spec.js @@ -4,6 +4,7 @@ filterTests(["smoke", "all"], () => { context("Create a User and Assign Roles", () => { before(() => { cy.login() + cy.createApp("Cypress Tests") }) it("should create a user", () => { @@ -52,7 +53,7 @@ filterTests(["smoke", "all"], () => { cy.get(".spectrum-Table").contains("bbuser").click() cy.wait(1000) for (let i = 0; i < 3; i++) { - cy.get(".spectrum-Table") + cy.get(".spectrum-Table", { timeout: 3000}) .eq(1) .find(".spectrum-Table-row") .eq(0) @@ -79,6 +80,7 @@ filterTests(["smoke", "all"], () => { .contains("Update role") .click({ force: true }) }) + cy.reload() } // Confirm roles exist within Configure roles table cy.wait(2000) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index ff8259cad5..0c01c0c828 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -524,7 +524,12 @@ Cypress.Commands.add("createAppFromScratch", appName => { .contains("Start from scratch") .click({ force: true }) cy.get(".spectrum-Modal").within(() => { - cy.get("input").eq(0).type(appName).should("have.value", appName).blur() + cy.get("input") + .eq(0) + .clear() + .type(appName) + .should("have.value", appName) + .blur() cy.get(".spectrum-ButtonGroup").contains("Create app").click() cy.wait(10000) }) @@ -642,7 +647,8 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => { cy.get(".spectrum-Button") .contains("Save and fetch tables") .click({ force: true }) - cy.wait(3000) + // Check modal closes after datasource config & fetch + cy.get(".spectrum-Dialog-grid", { timeout: 7000 }).should("not.exist") }) } })