1
0
Fork 0
mirror of synced 2024-06-21 11:51:00 +12:00

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 c555d2130f
commit 7c958926c2
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")
})
}
})