Cypress Build Update

Few changes to assist with the nightly build

appPublishWorkflow
- Removing closeModal function calls (no longer needed)

createBinding
- Update to remove a component from some of the tests
- New command for this also

REST
- Skipping these tests -> there are only 2 and will be replaced via API

Commands
- Additional changes to support the nightly build
- mainly navigation based due to recent code changes to the product
This commit is contained in:
Mitch-Budibase 2022-11-23 16:19:50 +00:00
parent 7d4f4bba2d
commit 88cf737087
4 changed files with 22 additions and 7 deletions

View File

@ -30,7 +30,6 @@ filterTests(['all'], () => {
it("Should publish an application and correctly reflect that", () => {
//Assuming the previous test was run and the unpublished app is open in edit mode.
cy.closeModal()
cy.get(interact.TOPRIGHTNAV_BUTTON_SPECTRUM).contains("Publish").click({ force : true })
cy.get(interact.DEPLOY_APP_MODAL).should("be.visible")
@ -87,7 +86,6 @@ filterTests(['all'], () => {
cy.get(interact.APP_TABLE_APP_NAME).click({ force: true })
})
cy.closeModal()
cy.get(interact.DEPLOYMENT_TOP_GLOBE).should("exist").click({ force: true })
cy.get("[data-cy='publish-popover-menu']")

View File

@ -9,9 +9,10 @@ filterTests(['smoke', 'all'], () => {
})
it("should add a current user binding", () => {
cy.searchAndAddComponent("Paragraph").then(() => {
cy.searchAndAddComponent("Paragraph").then(componentId => {
addSettingBinding("text", ["Current User", "_id"], "Current User._id")
})
cy.deleteComponentByName("New Paragraph")
})
it("should handle an invalid binding", () => {
@ -21,6 +22,7 @@ filterTests(['smoke', 'all'], () => {
.type("{{}{{}{{} Current User._id {}}{}}")
.blur()
cy.getComponent(componentId).should("have.text", "{{{ [user].[_id] }}")
cy.deleteComponentByName("New Paragraph")
})
})

View File

@ -1,7 +1,7 @@
import filterTests from "../../support/filterTests"
filterTests(["smoke", "all"], () => {
context("REST Datasource Testing", () => {
xcontext("REST Datasource Testing", () => {
before(() => {
cy.login()
cy.createTestApp()

View File

@ -440,8 +440,8 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => {
// Creates an internal Budibase DB table
if (!initialTable) {
cy.navigateToDataSection()
cy.get(`[data-cy="new-datasource"]`, { timeout: 2000 }).click()
}
cy.get(`[data-cy="new-datasource"]`, { timeout: 2000 }).click()
cy.wait(2000)
cy.get(".item", { timeout: 2000 })
.contains("Budibase DB")
@ -458,6 +458,9 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => {
})
// Ensure modal has closed and table is created
cy.get(".spectrum-Modal", { timeout: 2000 }).should("not.exist")
cy.get(".nav-item", { timeout: 2000 })
.contains("Budibase DB")
.click({ force: true })
cy.get(".spectrum-Tabs-content", { timeout: 2000 }).should(
"contain",
tableName
@ -525,7 +528,7 @@ Cypress.Commands.add("addRowMultiValue", values => {
})
Cypress.Commands.add("selectTable", tableName => {
cy.expandBudibaseConnection()
cy.get(".nav-item").contains("Budibase DB").click()
cy.contains(".nav-item", tableName).click()
})
@ -576,6 +579,18 @@ Cypress.Commands.add("searchAndAddComponent", component => {
})
})
Cypress.Commands.add("deleteComponentByName", componentName => {
cy.get(".body")
.eq(0)
.contains(componentName)
.siblings(".actions")
.within(() => {
cy.get(".spectrum-Icon").click({ force: true })
})
cy.get(".spectrum-Menu").contains("Delete").click()
cy.get(".spectrum-Dialog").contains("Delete Component").click()
})
Cypress.Commands.add("addComponent", (category, component) => {
if (category) {
cy.get(`[data-cy="category-${category}"]`, { timeout: 3000 }).click({