1
0
Fork 0
mirror of synced 2024-08-08 14:48:13 +12:00

Updated deleteApp function

Added a check for app name, function returns if app does not exist, rather than trying to delete
This commit is contained in:
Mitch-Budibase 2022-04-12 15:59:12 +01:00
parent 4340a46fe7
commit 87ac25bcea

View file

@ -60,6 +60,8 @@ Cypress.Commands.add("deleteApp", name => {
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
.its("body")
.then(val => {
const findAppName = val.some(val => val.name == name)
if (findAppName) {
if (val.length > 0) {
if (Cypress.env("TEST_ENV")) {
cy.searchForApplication(name)
@ -100,6 +102,10 @@ Cypress.Commands.add("deleteApp", name => {
} else {
return
}
}
else {
return
}
})
})