1
0
Fork 0
mirror of synced 2024-09-08 21:51:58 +12:00

Cypress: Create Views test update

Updating a couple of tests within createView
- Timing issues
- Ensuring we get the correct element for testing

Also updated QueryLevelTransformers test
- Timing issue
- I've extended the timeout value for when checking the nav item content (passes locally but timed out on the CI run)
This commit is contained in:
Mitch-Budibase 2022-12-22 14:32:39 +00:00
parent d2766b3279
commit c508da0f24
3 changed files with 27 additions and 23 deletions

View file

@ -26,13 +26,15 @@ filterTests(['smoke', 'all'], () => {
cy.get("input").type("Test View") cy.get("input").type("Test View")
cy.get("button").contains("Create View").click({ force: true }) cy.get("button").contains("Create View").click({ force: true })
}) })
cy.get(interact.TABLE_TITLE_H1).contains("Test View") cy.contains(interact.TABLE_TITLE_H1, "Test View", { timeout: 10000 })
cy.get(interact.TITLE).then($headers => { cy.get(".table-wrapper").within(() => {
expect($headers).to.have.length(3) cy.get(interact.TITLE).then($headers => {
const headers = Array.from($headers).map(header => expect($headers).to.have.length(3)
header.textContent.trim() const headers = Array.from($headers).map(header =>
) header.textContent.trim()
expect(removeSpacing(headers)).to.deep.eq(["group", "age", "rating"]) )
expect(removeSpacing(headers)).to.deep.eq(["group", "age", "rating"])
})
}) })
}) })
@ -70,20 +72,22 @@ filterTests(['smoke', 'all'], () => {
}) })
cy.wait(1000) cy.wait(1000)
cy.get(interact.TITLE).then($headers => { cy.get(".table-wrapper").within(() => {
expect($headers).to.have.length(7) cy.get(interact.TITLE).then($headers => {
const headers = Array.from($headers).map(header => expect($headers).to.have.length(7)
header.textContent.trim() const headers = Array.from($headers).map(header =>
) header.textContent.trim()
expect(removeSpacing(headers)).to.deep.eq([ )
"field", expect(removeSpacing(headers)).to.deep.eq([
"sum", "field",
"min", "sum",
"max", "min",
"count", "max",
"sumsqr", "count",
"avg", "sumsqr",
]) "avg",
])
})
}) })
cy.get(interact.SPECTRUM_TABLE_CELL).then($values => { cy.get(interact.SPECTRUM_TABLE_CELL).then($values => {
let values = Array.from($values).map(header => header.textContent.trim()) let values = Array.from($values).map(header => header.textContent.trim())

View file

@ -15,7 +15,7 @@ filterTests(["smoke", "all"], () => {
cy.selectExternalDatasource(datasource) cy.selectExternalDatasource(datasource)
cy.createRestQuery("GET", restUrl, "/breweries") cy.createRestQuery("GET", restUrl, "/breweries")
cy.reload() cy.reload()
cy.contains(".nav-item-content", "/breweries", { timeout: 2000 }).click() cy.contains(".nav-item-content", "/breweries", { timeout: 20000 }).click()
cy.contains(interact.SPECTRUM_TABS_ITEM, "Transformer", { timeout: 5000 }).click({ force: true }) cy.contains(interact.SPECTRUM_TABS_ITEM, "Transformer", { timeout: 5000 }).click({ force: true })
// Get Transformer Function from file // Get Transformer Function from file
cy.readFile("cypress/support/queryLevelTransformerFunction.js").then( cy.readFile("cypress/support/queryLevelTransformerFunction.js").then(

View file

@ -480,7 +480,7 @@ Cypress.Commands.add(
// Configure column // Configure column
cy.get(".spectrum-Modal").within(() => { cy.get(".spectrum-Modal").within(() => {
cy.get("input").first().type(columnName).blur() cy.get("input").first().type(columnName)
// Unset table display column // Unset table display column
cy.contains("display column").click({ force: true }) cy.contains("display column").click({ force: true })