1
0
Fork 0
mirror of synced 2024-06-18 18:35:37 +12:00

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 c22afdaf0f
commit c318a1b3be

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()
})