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
This commit is contained in:
Mitch-Budibase 2022-05-18 14:53:54 +01:00
parent 042327d4f8
commit 0355b28965
1 changed files with 3 additions and 2 deletions

View File

@ -643,13 +643,14 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
.click({ force: true }) .click({ force: true })
}) })
} else { } else {
cy.intercept("**/tables").as("datasourceTables")
cy.get(".spectrum-Dialog-grid").within(() => { cy.get(".spectrum-Dialog-grid").within(() => {
cy.get(".spectrum-Button") cy.get(".spectrum-Button")
.contains("Save and fetch tables") .contains("Save and fetch tables")
.click({ force: true }) .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")
} }
}) })