Smoke build test changes

createUserAndRoles.spec.js
- Timing issues with the test regarding the smoke build.
- Adding timeout values and reloading the page after role assignment

commands
- Adding a `clear()` to `createAppFromScratch` function.
- Previous test runs show that the placeholder value is being taken at times
This commit is contained in:
Mitch-Budibase 2022-05-17 12:40:06 +01:00
parent 92e6b40b81
commit 40b44035ea
2 changed files with 11 additions and 3 deletions

View File

@ -4,6 +4,7 @@ filterTests(["smoke", "all"], () => {
context("Create a User and Assign Roles", () => {
before(() => {
cy.login()
cy.createApp("Cypress Tests")
})
it("should create a user", () => {
@ -52,7 +53,7 @@ filterTests(["smoke", "all"], () => {
cy.get(".spectrum-Table").contains("bbuser").click()
cy.wait(1000)
for (let i = 0; i < 3; i++) {
cy.get(".spectrum-Table")
cy.get(".spectrum-Table", { timeout: 3000})
.eq(1)
.find(".spectrum-Table-row")
.eq(0)
@ -79,6 +80,7 @@ filterTests(["smoke", "all"], () => {
.contains("Update role")
.click({ force: true })
})
cy.reload()
}
// Confirm roles exist within Configure roles table
cy.wait(2000)

View File

@ -524,7 +524,12 @@ Cypress.Commands.add("createAppFromScratch", appName => {
.contains("Start from scratch")
.click({ force: true })
cy.get(".spectrum-Modal").within(() => {
cy.get("input").eq(0).type(appName).should("have.value", appName).blur()
cy.get("input")
.eq(0)
.clear()
.type(appName)
.should("have.value", appName)
.blur()
cy.get(".spectrum-ButtonGroup").contains("Create app").click()
cy.wait(10000)
})
@ -642,7 +647,8 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
cy.get(".spectrum-Button")
.contains("Save and fetch tables")
.click({ force: true })
cy.wait(3000)
// Check modal closes after datasource config & fetch
cy.get(".spectrum-Dialog-grid", { timeout: 7000 }).should("not.exist")
})
}
})