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
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() cy.contains("Create app").click()
}) })
.then(() => { .then(() => {
cy.get(".icon.arrow").eq(0).click() cy.expandBudibaseConnection()
cy.get(".nav-item.selected > .content").should("be.visible") 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) => { Cypress.Commands.add("addColumn", (tableName, columnName, type) => {
// Select Table // Select Table
//cy.get(".icon.arrow").eq(0).click() cy.selectTable(tableName)
cy.contains(".nav-item", tableName).click() cy.contains(".nav-item", tableName).click()
cy.contains("Create column").click() cy.contains("Create column").click()
@ -161,3 +161,15 @@ Cypress.Commands.add("createScreen", (screenName, route) => {
cy.get(".spectrum-Button--cta").click() 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()
})