fix cypress tests

This commit is contained in:
Martin McKeaveney 2021-11-10 13:04:59 +01:00
parent 7cf916a00d
commit f5406cecf2
1 changed files with 1 additions and 3 deletions

View File

@ -43,16 +43,14 @@ Cypress.Commands.add("createApp", name => {
}) })
}) })
Cypress.Commands.add("deleteApp", appName => { Cypress.Commands.add("deleteApp", () => {
cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
cy.wait(1000) cy.wait(1000)
cy.request(`localhost:${Cypress.env("PORT")}/api/applications?status=all`) cy.request(`localhost:${Cypress.env("PORT")}/api/applications?status=all`)
.its("body") .its("body")
.then(val => { .then(val => {
console.log(val)
if (val.length > 0) { if (val.length > 0) {
cy.get(".title > :nth-child(3) > .spectrum-Icon").click() cy.get(".title > :nth-child(3) > .spectrum-Icon").click()
cy.get("input").type(appName)
cy.contains("Delete").click() cy.contains("Delete").click()
cy.get(".spectrum-Button--warning").click() cy.get(".spectrum-Button--warning").click()
} }