Cypress Command + Rest Timeout update

rest.spec.js
- Test was flakey on last nights smoke run
- Updated to specifically search for query-buttons and then add query

commands.js
- Increasing timeout values for createTable & createDatasourceScreen commands
This commit is contained in:
Mitch-Budibase 2022-09-06 09:50:02 +01:00
parent 8f606f28f4
commit ad30fe1799
2 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,7 @@ filterTests(["smoke", "all"], () => {
// Select REST data source // Select REST data source
cy.selectExternalDatasource(datasource) cy.selectExternalDatasource(datasource)
// Enter incorrect api & attempt to send query // Enter incorrect api & attempt to send query
cy.get(".spectrum-Button", { timeout: 500 }).contains("Add query").click({ force: true }) cy.get(".query-buttons", { timeout: 1000 }).contains("Add query").click({ force: true })
cy.intercept("**/preview").as("queryError") cy.intercept("**/preview").as("queryError")
cy.get("input").clear().type("random text") cy.get("input").clear().type("random text")
cy.get(".spectrum-Button").contains("Send").click({ force: true }) cy.get(".spectrum-Button").contains("Send").click({ force: true })

View File

@ -457,8 +457,8 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => {
cy.get(".spectrum-ButtonGroup").contains("Create").click() cy.get(".spectrum-ButtonGroup").contains("Create").click()
}) })
// Ensure modal has closed and table is created // Ensure modal has closed and table is created
cy.get(".spectrum-Modal").should("not.exist") cy.get(".spectrum-Modal", { timeout: 2000 }).should("not.exist")
cy.get(".spectrum-Tabs-content", { timeout: 1000 }).should( cy.get(".spectrum-Tabs-content", { timeout: 2000 }).should(
"contain", "contain",
tableName tableName
) )
@ -642,25 +642,25 @@ Cypress.Commands.add(
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) cy.get(".spectrum-Button").contains("Continue").click({ force: true })
}) })
cy.get(".spectrum-Modal [data-cy='data-source-modal']", { cy.get(".spectrum-Modal [data-cy='data-source-modal']", {
timeout: 500, timeout: 20000,
}).within(() => { }).within(() => {
for (let i = 0; i < datasourceNames.length; i++) { for (let i = 0; i < datasourceNames.length; i++) {
cy.wait(500) cy.get(".data-source-entry", { timeout: 10000 })
cy.get(".data-source-entry").contains(datasourceNames[i]).click() .contains(datasourceNames[i])
.click({ force: true })
//Ensure the check mark is visible //Ensure the check mark is visible
cy.get(".data-source-entry") cy.get(".data-source-entry")
.contains(datasourceNames[i]) .contains(datasourceNames[i])
.get(".data-source-check") .get(".data-source-check", { timeout: 10000 })
.should("exist") .should("exist")
} }
cy.get(".spectrum-Button").contains("Confirm").click({ force: true }) cy.get(".spectrum-Button").contains("Confirm").click({ force: true })
}) })
cy.get(".spectrum-Modal").within(() => { cy.get(".spectrum-Modal", { timeout: 10000 }).within(() => {
if (accessLevelLabel) { if (accessLevelLabel) {
cy.get(".spectrum-Picker-label").click() cy.get(".spectrum-Picker-label", { timeout: 10000 }).click()
cy.wait(500)
cy.contains(accessLevelLabel).click() cy.contains(accessLevelLabel).click()
} }
cy.get(".spectrum-Button").contains("Done").click({ force: true }) cy.get(".spectrum-Button").contains("Done").click({ force: true })