Organising Commands file
Rearranged the commands file into categories - Commands are organisation by relative category (users, tables etc.)
This commit is contained in:
parent
c5c3365c43
commit
03cc238ba4
|
@ -1,14 +1,8 @@
|
||||||
// ***********************************************
|
|
||||||
// For more comprehensive examples of custom
|
|
||||||
// commands please read more here:
|
|
||||||
// https://on.cypress.io/custom-commands
|
|
||||||
// ***********************************************
|
|
||||||
//
|
|
||||||
|
|
||||||
Cypress.on("uncaught:exception", () => {
|
Cypress.on("uncaught:exception", () => {
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// ACCOUNTS & USERS
|
||||||
Cypress.Commands.add("login", () => {
|
Cypress.Commands.add("login", () => {
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
cy.wait(2000)
|
cy.wait(2000)
|
||||||
|
@ -41,43 +35,20 @@ Cypress.Commands.add("logOut", () => {
|
||||||
cy.wait(2000)
|
cy.wait(2000)
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("closeModal", () => {
|
Cypress.Commands.add("createUser", email => {
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
// quick hacky recorded way to create a user
|
||||||
cy.get(".close-icon").click()
|
cy.contains("Users").click()
|
||||||
cy.wait(1000) // Wait for modal to close
|
cy.get(`[data-cy="add-user"]`).click()
|
||||||
})
|
cy.get(".spectrum-Picker-label").click()
|
||||||
})
|
cy.get(".spectrum-Menu-item:nth-child(2) > .spectrum-Menu-itemLabel").click()
|
||||||
|
|
||||||
Cypress.Commands.add("importApp", (exportFilePath, name) => {
|
//Onboarding type selector
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.get(
|
||||||
|
":nth-child(2) > .spectrum-Form-itemField > .spectrum-Textfield > .spectrum-Textfield-input"
|
||||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
)
|
||||||
.its("body")
|
.first()
|
||||||
.then(val => {
|
.type(email, { force: true })
|
||||||
if (val.length > 0) {
|
cy.get(".spectrum-Button--cta").click({ force: true })
|
||||||
cy.get(`[data-cy="create-app-btn"]`).click({ force: true })
|
|
||||||
cy.wait(500)
|
|
||||||
}
|
|
||||||
cy.get(`[data-cy="import-app-btn"]`).click({ force: true })
|
|
||||||
})
|
|
||||||
|
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
|
||||||
cy.get("input").eq(1).should("have.focus")
|
|
||||||
|
|
||||||
cy.get(".spectrum-Dropzone").selectFile(exportFilePath, {
|
|
||||||
action: "drag-drop",
|
|
||||||
})
|
|
||||||
|
|
||||||
cy.get(".gallery .filename").contains("exported-app.txt")
|
|
||||||
|
|
||||||
if (name && name != "") {
|
|
||||||
cy.get("input").eq(0).type(name).should("have.value", name).blur()
|
|
||||||
}
|
|
||||||
cy.get(".confirm-wrap button")
|
|
||||||
.should("not.be.disabled")
|
|
||||||
.click({ force: true })
|
|
||||||
cy.wait(5000)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
|
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
|
||||||
|
@ -113,6 +84,13 @@ Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// APPLICATIONS
|
||||||
|
Cypress.Commands.add("createTestApp", () => {
|
||||||
|
const appName = "Cypress Tests"
|
||||||
|
cy.deleteApp(appName)
|
||||||
|
cy.createApp(appName, "This app is used for Cypress testing.")
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createApp", (name, addDefaultTable) => {
|
Cypress.Commands.add("createApp", (name, addDefaultTable) => {
|
||||||
const shouldCreateDefaultTable =
|
const shouldCreateDefaultTable =
|
||||||
typeof addDefaultTable != "boolean" ? true : addDefaultTable
|
typeof addDefaultTable != "boolean" ? true : addDefaultTable
|
||||||
|
@ -218,36 +196,6 @@ Cypress.Commands.add("deleteAllApps", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("alterAppVersion", (appId, version) => {
|
|
||||||
return cy
|
|
||||||
.request("put", `${Cypress.config().baseUrl}/api/applications/${appId}`, {
|
|
||||||
version: version || "0.0.1-alpha.0",
|
|
||||||
})
|
|
||||||
.then(resp => {
|
|
||||||
expect(resp.status).to.eq(200)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add("updateAppName", (changedName, noName) => {
|
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
|
||||||
if (noName == true) {
|
|
||||||
cy.get("input").clear()
|
|
||||||
cy.get(".spectrum-Dialog-grid")
|
|
||||||
.click()
|
|
||||||
.contains("App name must be letters, numbers and spaces only")
|
|
||||||
return cy
|
|
||||||
}
|
|
||||||
cy.get("input").clear()
|
|
||||||
cy.get("input")
|
|
||||||
.eq(0)
|
|
||||||
.type(changedName)
|
|
||||||
.should("have.value", changedName)
|
|
||||||
.blur()
|
|
||||||
cy.get(".spectrum-ButtonGroup").contains("Save").click({ force: true })
|
|
||||||
cy.wait(500)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add("unlockApp", unlock_config => {
|
Cypress.Commands.add("unlockApp", unlock_config => {
|
||||||
let config = { ...unlock_config }
|
let config = { ...unlock_config }
|
||||||
|
|
||||||
|
@ -277,6 +225,26 @@ Cypress.Commands.add("unlockApp", unlock_config => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("updateAppName", (changedName, noName) => {
|
||||||
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
|
if (noName == true) {
|
||||||
|
cy.get("input").clear()
|
||||||
|
cy.get(".spectrum-Dialog-grid")
|
||||||
|
.click()
|
||||||
|
.contains("App name must be letters, numbers and spaces only")
|
||||||
|
return cy
|
||||||
|
}
|
||||||
|
cy.get("input").clear()
|
||||||
|
cy.get("input")
|
||||||
|
.eq(0)
|
||||||
|
.type(changedName)
|
||||||
|
.should("have.value", changedName)
|
||||||
|
.blur()
|
||||||
|
cy.get(".spectrum-ButtonGroup").contains("Save").click({ force: true })
|
||||||
|
cy.wait(500)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("publishApp", resolvedAppPath => {
|
Cypress.Commands.add("publishApp", resolvedAppPath => {
|
||||||
//Assumes you have navigated to an application first
|
//Assumes you have navigated to an application first
|
||||||
cy.get(".toprightnav button.spectrum-Button")
|
cy.get(".toprightnav button.spectrum-Button")
|
||||||
|
@ -300,19 +268,96 @@ Cypress.Commands.add("publishApp", resolvedAppPath => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createTestApp", () => {
|
Cypress.Commands.add("alterAppVersion", (appId, version) => {
|
||||||
const appName = "Cypress Tests"
|
return cy
|
||||||
cy.deleteApp(appName)
|
.request("put", `${Cypress.config().baseUrl}/api/applications/${appId}`, {
|
||||||
cy.createApp(appName, "This app is used for Cypress testing.")
|
version: version || "0.0.1-alpha.0",
|
||||||
//cy.createScreen("home")
|
})
|
||||||
|
.then(resp => {
|
||||||
|
expect(resp.status).to.eq(200)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createTestTableWithData", () => {
|
Cypress.Commands.add("importApp", (exportFilePath, name) => {
|
||||||
cy.createTable("dog")
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
cy.addColumn("dog", "name", "Text")
|
|
||||||
cy.addColumn("dog", "age", "Number")
|
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||||
|
.its("body")
|
||||||
|
.then(val => {
|
||||||
|
if (val.length > 0) {
|
||||||
|
cy.get(`[data-cy="create-app-btn"]`).click({ force: true })
|
||||||
|
cy.wait(500)
|
||||||
|
}
|
||||||
|
cy.get(`[data-cy="import-app-btn"]`).click({ force: true })
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
|
cy.get("input").eq(1).should("have.focus")
|
||||||
|
|
||||||
|
cy.get(".spectrum-Dropzone").selectFile(exportFilePath, {
|
||||||
|
action: "drag-drop",
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.get(".gallery .filename").contains("exported-app.txt")
|
||||||
|
|
||||||
|
if (name && name != "") {
|
||||||
|
cy.get("input").eq(0).type(name).should("have.value", name).blur()
|
||||||
|
}
|
||||||
|
cy.get(".confirm-wrap button")
|
||||||
|
.should("not.be.disabled")
|
||||||
|
.click({ force: true })
|
||||||
|
cy.wait(5000)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Filters visible with 1 or more
|
||||||
|
Cypress.Commands.add("searchForApplication", appName => {
|
||||||
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
|
cy.wait(2000)
|
||||||
|
|
||||||
|
// No app filter functionality if only 1 app exists
|
||||||
|
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||||
|
.its("body")
|
||||||
|
.then(val => {
|
||||||
|
if (val.length < 2) {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
// Searches for the app
|
||||||
|
cy.get(".filter").then(() => {
|
||||||
|
cy.get(".spectrum-Textfield").within(() => {
|
||||||
|
cy.get("input").eq(0).clear()
|
||||||
|
cy.get("input").eq(0).type(appName)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// Assumes there are no others
|
||||||
|
Cypress.Commands.add("applicationInAppTable", appName => {
|
||||||
|
cy.get(".appTable").within(() => {
|
||||||
|
cy.get(".title").contains(appName).should("exist")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("createAppFromScratch", appName => {
|
||||||
|
cy.get(`[data-cy="create-app-btn"]`)
|
||||||
|
.contains("Start from scratch")
|
||||||
|
.click({ force: true })
|
||||||
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
|
cy.get("input")
|
||||||
|
.eq(0)
|
||||||
|
.clear()
|
||||||
|
.type(appName)
|
||||||
|
.should("have.value", appName)
|
||||||
|
.blur()
|
||||||
|
cy.get(".spectrum-ButtonGroup").contains("Create app").click()
|
||||||
|
cy.wait(10000)
|
||||||
|
})
|
||||||
|
cy.createTable("Cypress Tests", true)
|
||||||
|
})
|
||||||
|
|
||||||
|
// TABLES
|
||||||
Cypress.Commands.add("createTable", (tableName, initialTable) => {
|
Cypress.Commands.add("createTable", (tableName, initialTable) => {
|
||||||
if (!initialTable) {
|
if (!initialTable) {
|
||||||
cy.navigateToDataSection()
|
cy.navigateToDataSection()
|
||||||
|
@ -333,6 +378,12 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => {
|
||||||
cy.contains(tableName).should("be.visible")
|
cy.contains(tableName).should("be.visible")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("createTestTableWithData", () => {
|
||||||
|
cy.createTable("dog")
|
||||||
|
cy.addColumn("dog", "name", "Text")
|
||||||
|
cy.addColumn("dog", "age", "Number")
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
"addColumn",
|
"addColumn",
|
||||||
(tableName, columnName, type, multiOptions = null) => {
|
(tableName, columnName, type, multiOptions = null) => {
|
||||||
|
@ -387,22 +438,33 @@ Cypress.Commands.add("addRowMultiValue", values => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createUser", email => {
|
Cypress.Commands.add("selectTable", tableName => {
|
||||||
// quick hacky recorded way to create a user
|
cy.expandBudibaseConnection()
|
||||||
cy.contains("Users").click()
|
cy.contains(".nav-item", tableName).click()
|
||||||
cy.get(`[data-cy="add-user"]`).click()
|
|
||||||
cy.get(".spectrum-Picker-label").click()
|
|
||||||
cy.get(".spectrum-Menu-item:nth-child(2) > .spectrum-Menu-itemLabel").click()
|
|
||||||
|
|
||||||
//Onboarding type selector
|
|
||||||
cy.get(
|
|
||||||
":nth-child(2) > .spectrum-Form-itemField > .spectrum-Textfield > .spectrum-Textfield-input"
|
|
||||||
)
|
|
||||||
.first()
|
|
||||||
.type(email, { force: true })
|
|
||||||
cy.get(".spectrum-Button--cta").click({ force: true })
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("addCustomSourceOptions", totalOptions => {
|
||||||
|
cy.get(".spectrum-ActionButton")
|
||||||
|
.contains("Define Options")
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
for (let i = 0; i < totalOptions; i++) {
|
||||||
|
// Add radio button options
|
||||||
|
cy.get(".spectrum-Button")
|
||||||
|
.contains("Add Option")
|
||||||
|
.click({ force: true })
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.get("[placeholder='Label']").eq(i).type(i)
|
||||||
|
cy.get("[placeholder='Value']").eq(i).type(i)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// Save options
|
||||||
|
cy.get(".spectrum-Button").contains("Save").click({ force: true })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// DESIGN AREA
|
||||||
Cypress.Commands.add("addComponent", (category, component) => {
|
Cypress.Commands.add("addComponent", (category, component) => {
|
||||||
if (category) {
|
if (category) {
|
||||||
cy.get(`[data-cy="category-${category}"]`).click({ force: true })
|
cy.get(`[data-cy="category-${category}"]`).click({ force: true })
|
||||||
|
@ -430,22 +492,8 @@ Cypress.Commands.add("getComponent", componentId => {
|
||||||
.find(`[data-id=${componentId}]`)
|
.find(`[data-id=${componentId}]`)
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("navigateToFrontend", () => {
|
|
||||||
// Clicks on Design tab and then the Home nav item
|
|
||||||
cy.wait(1000)
|
|
||||||
cy.contains("Design").click()
|
|
||||||
cy.get(".spectrum-Search").type("/")
|
|
||||||
cy.get(".nav-item").contains("home").click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add("navigateToDataSection", () => {
|
|
||||||
// Clicks on the Data tab
|
|
||||||
cy.wait(500)
|
|
||||||
cy.contains("Data").click()
|
|
||||||
})
|
|
||||||
|
|
||||||
//Blank
|
|
||||||
Cypress.Commands.add("createScreen", (route, accessLevelLabel) => {
|
Cypress.Commands.add("createScreen", (route, accessLevelLabel) => {
|
||||||
|
// Blank Screen
|
||||||
cy.contains("Design").click()
|
cy.contains("Design").click()
|
||||||
cy.get("[aria-label=AddCircle]").click()
|
cy.get("[aria-label=AddCircle]").click()
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
|
@ -505,17 +553,6 @@ Cypress.Commands.add(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Cypress.Commands.add("navigateToAutogeneratedModal", () => {
|
|
||||||
// Screen name must already exist within data source
|
|
||||||
cy.contains("Design").click()
|
|
||||||
cy.get("[aria-label=AddCircle]").click()
|
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
|
||||||
cy.get(".item").contains("Autogenerated screens").click()
|
|
||||||
cy.get(".spectrum-Button").contains("Continue").click({ force: true })
|
|
||||||
cy.wait(500)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
"createAutogeneratedScreens",
|
"createAutogeneratedScreens",
|
||||||
(screenNames, accessLevelLabel) => {
|
(screenNames, accessLevelLabel) => {
|
||||||
|
@ -537,96 +574,33 @@ Cypress.Commands.add(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Cypress.Commands.add("addRow", values => {
|
// NAVIGATION
|
||||||
cy.contains("Create row").click()
|
Cypress.Commands.add("navigateToFrontend", () => {
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
// Clicks on Design tab and then the Home nav item
|
||||||
for (let i = 0; i < values.length; i++) {
|
cy.wait(1000)
|
||||||
cy.get("input").eq(i).type(values[i]).blur()
|
cy.contains("Design").click()
|
||||||
}
|
cy.get(".spectrum-Search").type("/")
|
||||||
cy.get(".spectrum-ButtonGroup").contains("Create").click()
|
cy.get(".nav-item").contains("home").click()
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("expandBudibaseConnection", () => {
|
Cypress.Commands.add("navigateToDataSection", () => {
|
||||||
if (Cypress.$(".nav-item > .content > .opened").length === 0) {
|
// Clicks on the Data tab
|
||||||
// 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()
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add("addCustomSourceOptions", totalOptions => {
|
|
||||||
cy.get(".spectrum-ActionButton")
|
|
||||||
.contains("Define Options")
|
|
||||||
.click()
|
|
||||||
.then(() => {
|
|
||||||
for (let i = 0; i < totalOptions; i++) {
|
|
||||||
// Add radio button options
|
|
||||||
cy.get(".spectrum-Button")
|
|
||||||
.contains("Add Option")
|
|
||||||
.click({ force: true })
|
|
||||||
.then(() => {
|
|
||||||
cy.wait(500)
|
cy.wait(500)
|
||||||
cy.get("[placeholder='Label']").eq(i).type(i)
|
cy.contains("Data").click()
|
||||||
cy.get("[placeholder='Value']").eq(i).type(i)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Save options
|
|
||||||
cy.get(".spectrum-Button").contains("Save").click({ force: true })
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
//Filters visible with 1 or more
|
Cypress.Commands.add("navigateToAutogeneratedModal", () => {
|
||||||
Cypress.Commands.add("searchForApplication", appName => {
|
// Screen name must already exist within data source
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.contains("Design").click()
|
||||||
cy.wait(2000)
|
cy.get("[aria-label=AddCircle]").click()
|
||||||
|
|
||||||
// No app filter functionality if only 1 app exists
|
|
||||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
|
||||||
.its("body")
|
|
||||||
.then(val => {
|
|
||||||
if (val.length < 2) {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
// Searches for the app
|
|
||||||
cy.get(".filter").then(() => {
|
|
||||||
cy.get(".spectrum-Textfield").within(() => {
|
|
||||||
cy.get("input").eq(0).clear()
|
|
||||||
cy.get("input").eq(0).type(appName)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
//Assumes there are no others
|
|
||||||
Cypress.Commands.add("applicationInAppTable", appName => {
|
|
||||||
cy.get(".appTable").within(() => {
|
|
||||||
cy.get(".title").contains(appName).should("exist")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
Cypress.Commands.add("createAppFromScratch", appName => {
|
|
||||||
cy.get(`[data-cy="create-app-btn"]`)
|
|
||||||
.contains("Start from scratch")
|
|
||||||
.click({ force: true })
|
|
||||||
cy.get(".spectrum-Modal").within(() => {
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
cy.get("input")
|
cy.get(".item").contains("Autogenerated screens").click()
|
||||||
.eq(0)
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true })
|
||||||
.clear()
|
cy.wait(500)
|
||||||
.type(appName)
|
|
||||||
.should("have.value", appName)
|
|
||||||
.blur()
|
|
||||||
cy.get(".spectrum-ButtonGroup").contains("Create app").click()
|
|
||||||
cy.wait(10000)
|
|
||||||
})
|
})
|
||||||
cy.createTable("Cypress Tests", true)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// DATASOURCES
|
||||||
Cypress.Commands.add("selectExternalDatasource", datasourceName => {
|
Cypress.Commands.add("selectExternalDatasource", datasourceName => {
|
||||||
// Navigates to Data Section
|
// Navigates to Data Section
|
||||||
cy.navigateToDataSection()
|
cy.navigateToDataSection()
|
||||||
|
@ -762,3 +736,18 @@ Cypress.Commands.add("createRestQuery", (method, restUrl, queryPrettyName) => {
|
||||||
.should("contain", method)
|
.should("contain", method)
|
||||||
.and("contain", queryPrettyName)
|
.and("contain", queryPrettyName)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// MISC
|
||||||
|
Cypress.Commands.add("closeModal", () => {
|
||||||
|
cy.get(".spectrum-Modal").within(() => {
|
||||||
|
cy.get(".close-icon").click()
|
||||||
|
cy.wait(1000) // Wait for modal to close
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue