fix tests by ensuring the budibase connection is expanded

This commit is contained in:
Maurits Lourens 2021-09-16 10:03:57 +02:00
parent 910e2f9a1d
commit 85d4ef7673
1 changed files with 14 additions and 2 deletions

View File

@ -37,7 +37,7 @@ Cypress.Commands.add("createApp", name => {
cy.contains("Create app").click()
})
.then(() => {
cy.get(".icon.arrow").eq(0).click()
cy.expandBudibaseConnection()
cy.get(".nav-item.selected > .content").should("be.visible")
})
})
@ -82,7 +82,7 @@ Cypress.Commands.add("createTable", tableName => {
Cypress.Commands.add("addColumn", (tableName, columnName, type) => {
// Select Table
//cy.get(".icon.arrow").eq(0).click()
cy.selectTable(tableName)
cy.contains(".nav-item", tableName).click()
cy.contains("Create column").click()
@ -161,3 +161,15 @@ Cypress.Commands.add("createScreen", (screenName, route) => {
cy.get(".spectrum-Button--cta").click()
})
})
Cypress.Commands.add("expandBudibaseConnection", () => {
if (Cypress.$(".nav-item > .content > .opened").length === 0) {
// expand the Budibase DB connection string
cy.get(".icon.arrow").eq(0).click()
}
})
Cypress.Commands.add("selectTable", tableName => {
cy.expandBudibaseConnection()
cy.contains(".nav-item", tableName).click()
})