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:
parent
4340a46fe7
commit
87ac25bcea
|
@ -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
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue