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

CreateApp Test Update

Timing issues affecting some tests
- Updated some cy.visit commands to include timeouts
This commit is contained in:
Mitch-Budibase 2022-06-30 11:41:11 +01:00
parent 7495b859c8
commit b5fcff3213
2 changed files with 6 additions and 9 deletions

View file

@ -48,7 +48,7 @@ filterTests(['smoke', 'all'], () => {
})
it("should enforce a valid url before submission", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
// Start create app process. If apps already exist, click second button
cy.get(interact.CREATE_APP_BUTTON, { timeout: 1000 }).click({ force: true })
@ -101,9 +101,6 @@ filterTests(['smoke', 'all'], () => {
it("should create the first application from scratch with a default name", () => {
cy.createApp()
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.applicationInAppTable("My app")
cy.deleteApp("My app")
})
@ -138,7 +135,7 @@ filterTests(['smoke', 'all'], () => {
cy.importApp(exportedApp, "")
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 })
cy.applicationInAppTable("My app")

View file

@ -134,7 +134,7 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => {
const shouldCreateDefaultTable =
typeof addDefaultTable != "boolean" ? true : addDefaultTable
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.get(`[data-cy="create-app-btn"]`, { timeout: 2000 }).click({ force: true })
// If apps already exist
@ -315,7 +315,7 @@ Cypress.Commands.add("alterAppVersion", (appId, version) => {
})
Cypress.Commands.add("importApp", (exportFilePath, name) => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
.its("body")
@ -343,7 +343,7 @@ Cypress.Commands.add("importApp", (exportFilePath, name) => {
cy.get(".confirm-wrap button")
.should("not.be.disabled")
.click({ force: true })
cy.wait(5000)
cy.wait(3000)
})
})
@ -372,7 +372,7 @@ Cypress.Commands.add("searchForApplication", appName => {
// Assumes there are no others
Cypress.Commands.add("applicationInAppTable", appName => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 })
cy.get(".appTable", { timeout: 2000 }).within(() => {
cy.get(".title").contains(appName).should("exist")
})