From 4ad60322abb569e7e938951156886cef09b7dbfd Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 1 Apr 2022 13:15:06 +0100 Subject: [PATCH] Changes to renameAnApplication & createUserAndRoles renameAnApplication - changing the navigation to a direct URL rather than clicking the home logo button createUserAndRoles - Removing the After action (now supports correct flow of tests) --- .../cypress/integration/createUserAndRoles.spec.js | 6 ------ .../cypress/integration/renameAnApplication.spec.js | 9 ++++++--- packages/builder/cypress/support/commands.js | 1 + 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/builder/cypress/integration/createUserAndRoles.spec.js b/packages/builder/cypress/integration/createUserAndRoles.spec.js index 17864dd975..5cd3697e38 100644 --- a/packages/builder/cypress/integration/createUserAndRoles.spec.js +++ b/packages/builder/cypress/integration/createUserAndRoles.spec.js @@ -6,12 +6,6 @@ filterTests(["smoke", "all"], () => { cy.login() }) - if (!(Cypress.env("TEST_ENV"))) { - after(() => { - cy.deleteAllApps() - }) - } - it("should create a user", () => { cy.visit(`${Cypress.config().baseUrl}/builder`) cy.wait(1000) diff --git a/packages/builder/cypress/integration/renameAnApplication.spec.js b/packages/builder/cypress/integration/renameAnApplication.spec.js index 267492ed8d..204d18972e 100644 --- a/packages/builder/cypress/integration/renameAnApplication.spec.js +++ b/packages/builder/cypress/integration/renameAnApplication.spec.js @@ -11,7 +11,8 @@ filterTests(['all'], () => { const appName = "Cypress Tests" const appRename = "Cypress Renamed" // Rename app, Search for app, Confirm name was changed - cy.get(".home-logo").click() + cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.wait(500) renameApp(appName, appRename) cy.reload() cy.wait(1000) @@ -37,7 +38,8 @@ filterTests(['all'], () => { cy.get(".spectrum-Button").contains("Publish").click({ force: true }) }) // Rename app, Search for app, Confirm name was changed - cy.get(".home-logo").click() + cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.wait(500) renameApp(appName, appRename, true) cy.get(".appTable").find(".wrapper").should("have.length", 1) cy.applicationInAppTable(appRename) @@ -45,7 +47,8 @@ filterTests(['all'], () => { it("Should try to rename an application to have no name", () => { const appName = "Cypress Tests" - cy.get(".home-logo").click() + cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.wait(500) renameApp(appName, " ", false, true) cy.wait(500) // Close modal and confirm name has not been changed diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index ad801be145..afedeaba49 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -342,6 +342,7 @@ Cypress.Commands.add("addCustomSourceOptions", totalOptions => { //Filters visible with 1 or more Cypress.Commands.add("searchForApplication", appName => { + cy.visit(`${Cypress.config().baseUrl}/builder`) cy.wait(2000) // Searches for the app cy.get(".filter").then(() => {