Merge pull request #5425 from Budibase/cypress-testing

Smoke Build Changes
This commit is contained in:
Mitch-Budibase 2022-04-14 17:49:10 +01:00 committed by GitHub
commit 83c7eb3fc3
4 changed files with 35 additions and 43 deletions

View File

@ -55,7 +55,7 @@ filterTests(["smoke", "all"], () => {
if (Cypress.env("TEST_ENV")) {
// No Pagination in CI - Test env only for the next two tests
it("Adds 15 rows and checks pagination", () => {
xit("Adds 15 rows and checks pagination", () => {
// 10 rows per page, 15 rows should create 2 pages within table
const totalRows = 16
for (let i = 1; i < totalRows; i++) {
@ -71,7 +71,7 @@ filterTests(["smoke", "all"], () => {
})
})
it("Deletes rows and checks pagination", () => {
xit("Deletes rows and checks pagination", () => {
// Delete rows, removing second page from table
cy.get(".spectrum-Checkbox-input").check({ force: true })
cy.get(".popovers").within(() => {

View File

@ -74,10 +74,13 @@ filterTests(["all"], () => {
cy.get(".spectrum-Popover").contains("COUNTRIES").click()
cy.get(".spectrum-Picker").eq(4).click()
cy.get(".spectrum-Popover").contains("REGION_ID").click()
// Save relationship & reload page
cy.get(".spectrum-Button").contains("Save").click({ force: true })
cy.reload()
})
// Save relationship & reload page
cy.get(".spectrum-ButtonGroup").within(() => {
cy.get(".spectrum-Button").contains("Save").click({ force: true })
})
cy.reload()
// Confirm table length & column name
cy.get(".spectrum-Table")
.eq(1)
@ -201,12 +204,12 @@ filterTests(["all"], () => {
})
it("should delete a query", () => {
// Get last nav item - The query
for (let i = 0; i < 2; i++) {
// Get query nav item - QueryName
cy.get(".nav-item")
.last()
.contains(queryName)
.parent()
.within(() => {
cy.get(".icon").eq(1).click({ force: true })
cy.get(".spectrum-Icon").eq(1).click({ force: true })
})
// Select Delete
cy.get(".spectrum-Menu").contains("Delete").click()
@ -214,10 +217,8 @@ filterTests(["all"], () => {
.contains("Delete Query")
.click({ force: true })
cy.wait(1000)
}
// Confirm deletion
cy.get(".nav-item").should("not.contain", queryName)
cy.get(".nav-item").should("not.contain", queryRename)
})
}
})

View File

@ -21,13 +21,6 @@ filterTests(["all"], () => {
.click({ force: true })
// Intercept Request after button click & apply assertions
cy.wait("@datasource")
cy.get("@datasource")
.its("response.body")
.should(
"have.property",
"message",
"connect ECONNREFUSED 127.0.0.1:5432"
)
cy.get("@datasource")
.its("response.body")
.should("have.property", "status", 500)
@ -242,12 +235,12 @@ filterTests(["all"], () => {
})
it("should delete a query", () => {
// Get last nav item - The query
for (let i = 0; i < 2; i++) {
// Get query nav item - QueryName
cy.get(".nav-item")
.last()
.contains(queryName)
.parent()
.within(() => {
cy.get(".icon").eq(1).click({ force: true })
cy.get(".spectrum-Icon").eq(1).click({ force: true })
})
// Select Delete
cy.get(".spectrum-Menu").contains("Delete").click()
@ -255,10 +248,8 @@ filterTests(["all"], () => {
.contains("Delete Query")
.click({ force: true })
cy.wait(1000)
}
// Confirm deletion
cy.get(".nav-item").should("not.contain", queryName)
cy.get(".nav-item").should("not.contain", queryRename)
})
const switchSchema = schema => {

View File

@ -417,7 +417,7 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
} else {
cy.get("input")
.clear({ force: true })
.type(Cypress.env("HOST_IP"), { force: true })
.type(Cypress.env("mysql").HOST, { force: true })
}
})
})