1
0
Fork 0
mirror of synced 2024-07-06 23:10:57 +12:00

updating delete app cypress command

This commit is contained in:
Martin McKeaveney 2021-11-09 18:35:19 +01:00
parent 8683a74b2d
commit 1361b05966

View file

@ -43,7 +43,7 @@ Cypress.Commands.add("createApp", name => {
}) })
}) })
Cypress.Commands.add("deleteApp", () => { Cypress.Commands.add("deleteApp", appName => {
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`)
@ -52,6 +52,7 @@ Cypress.Commands.add("deleteApp", () => {
console.log(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()
} }
@ -60,7 +61,7 @@ Cypress.Commands.add("deleteApp", () => {
Cypress.Commands.add("createTestApp", () => { Cypress.Commands.add("createTestApp", () => {
const appName = "Cypress Tests" const appName = "Cypress Tests"
cy.deleteApp() cy.deleteApp(appName)
cy.createApp(appName, "This app is used for Cypress testing.") cy.createApp(appName, "This app is used for Cypress testing.")
}) })