Merge pull request #6787 from Budibase/cypress-testing

Create App Tests: Timeout Changes
This commit is contained in:
Mitch-Budibase 2022-07-18 15:07:13 +01:00 committed by GitHub
commit f947792cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 13 deletions

View File

@ -100,24 +100,18 @@ filterTests(['smoke', 'all'], () => {
}) })
it("should create the first application from scratch, using the users first name as the default app name", () => { it("should create the first application from scratch, using the users first name as the default app name", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.updateUserInformation("Ted", "Userman") cy.updateUserInformation("Ted", "Userman")
cy.createApp("", false) cy.createApp("", false)
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.applicationInAppTable("Teds app") cy.applicationInAppTable("Teds app")
cy.deleteApp("Teds app") cy.deleteApp("Teds app")
//Accomodate names that end in 'S' // Accomodate names that end in 'S'
cy.updateUserInformation("Chris", "Userman") cy.updateUserInformation("Chris", "Userman")
cy.createApp("", false) cy.createApp("", false)
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.applicationInAppTable("Chris app") cy.applicationInAppTable("Chris app")
cy.deleteApp("Chris app") cy.deleteApp("Chris app")

View File

@ -4,7 +4,7 @@ Cypress.on("uncaught:exception", () => {
// ACCOUNTS & USERS // ACCOUNTS & USERS
Cypress.Commands.add("login", (email, password) => { Cypress.Commands.add("login", (email, password) => {
cy.visit(`${Cypress.config().baseUrl}/builder`) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.wait(2000) cy.wait(2000)
cy.url().then(url => { cy.url().then(url => {
if (url.includes("builder/admin")) { if (url.includes("builder/admin")) {
@ -139,7 +139,9 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => {
cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true }) cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true })
// If apps already exist // If apps already exist
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`, {
timeout: 5000,
})
.its("body") .its("body")
.then(val => { .then(val => {
if (val.length > 0) { if (val.length > 0) {
@ -223,9 +225,11 @@ Cypress.Commands.add("deleteApp", name => {
}) })
Cypress.Commands.add("deleteAllApps", () => { Cypress.Commands.add("deleteAllApps", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.wait(500) cy.wait(500)
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`, {
timeout: 5000,
})
.its("body") .its("body")
.then(val => { .then(val => {
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
@ -377,7 +381,7 @@ Cypress.Commands.add("searchForApplication", appName => {
// Assumes there are no others // Assumes there are no others
Cypress.Commands.add("applicationInAppTable", appName => { Cypress.Commands.add("applicationInAppTable", appName => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 })
cy.get(".appTable", { timeout: 2000 }).within(() => { cy.get(".appTable", { timeout: 5000 }).within(() => {
cy.get(".title").contains(appName).should("exist") cy.get(".title").contains(appName).should("exist")
}) })
}) })