Browse Source

fix tests by ensuring the budibase connection is expanded

master
Maurits Lourens 5 years ago
parent
commit
85d4ef7673
  1. 16
      packages/builder/cypress/support/commands.js

16
packages/builder/cypress/support/commands.js

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

Loading…
Cancel
Save