From 0237854826e46ee1335bcebd1af8e10f0a1f0418 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Wed, 18 May 2022 14:53:54 +0100 Subject: [PATCH] Update command.js Changing structure for `addDatasourceConfig` - Intercepting the request that is made when fetching tables from a datasource - There is a specific issue with this in regards to the smoke build. This will allow me to see deeper into the potential timing issues that are occurring --- packages/builder/cypress/support/commands.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 0c01c0c828..033d9a04a0 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -643,13 +643,14 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => { .click({ force: true }) }) } else { + cy.intercept("**/tables").as("datasourceTables") cy.get(".spectrum-Dialog-grid").within(() => { cy.get(".spectrum-Button") .contains("Save and fetch tables") .click({ force: true }) - // Check modal closes after datasource config & fetch - cy.get(".spectrum-Dialog-grid", { timeout: 7000 }).should("not.exist") }) + // Wait for tables to be fetched + cy.wait("@datasourceTables") } })