2022-04-21 12:59:59 +02:00
|
|
|
import filterTests from "../support/filterTests"
|
|
|
|
|
|
|
|
filterTests(['all'], () => {
|
|
|
|
context("Publish Application Workflow", () => {
|
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
cy.createTestApp()
|
|
|
|
})
|
|
|
|
|
|
|
|
it("Should reflect the unpublished status correctly", () => {
|
|
|
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
|
|
|
cy.wait(1000)
|
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-status").eq(0)
|
|
|
|
.within(() => {
|
|
|
|
cy.contains("Unpublished")
|
|
|
|
cy.get("svg[aria-label='GlobeStrike']").should("exist")
|
|
|
|
})
|
|
|
|
|
|
|
|
cy.get(".appTable .app-row-actions").eq(0)
|
|
|
|
.within(() => {
|
2022-05-09 19:00:04 +02:00
|
|
|
cy.get(".spectrum-Button").contains("View")
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".spectrum-Button").contains("Edit").click({ force: true })
|
|
|
|
})
|
|
|
|
|
2022-04-26 13:04:07 +02:00
|
|
|
cy.get(".deployment-top-nav svg[aria-label='GlobeStrike']").should("exist")
|
|
|
|
cy.get(".deployment-top-nav svg[aria-label='Globe']").should("not.exist")
|
2022-04-21 12:59:59 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it("Should publish an application and correctly reflect that", () => {
|
|
|
|
//Assuming the previous test was run and the unpublished app is open in edit mode.
|
|
|
|
|
2022-05-19 14:32:05 +02:00
|
|
|
cy.publishApp("cypress-tests")
|
2022-04-21 12:59:59 +02:00
|
|
|
|
|
|
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
|
|
|
cy.wait(1000)
|
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-status").eq(0)
|
|
|
|
.within(() => {
|
|
|
|
cy.contains("Published")
|
|
|
|
cy.get("svg[aria-label='Globe']").should("exist")
|
|
|
|
})
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-row-actions").eq(0)
|
|
|
|
.within(() => {
|
2022-05-09 19:00:04 +02:00
|
|
|
cy.get(".spectrum-Button").contains("View")
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".spectrum-Button").contains("Edit").click({ force: true })
|
|
|
|
})
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-26 13:04:07 +02:00
|
|
|
cy.get(".deployment-top-nav svg[aria-label='Globe']").should("exist").click({ force: true })
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get("[data-cy='publish-popover-menu']").should("be.visible")
|
|
|
|
.within(() => {
|
|
|
|
cy.get("[data-cy='publish-popover-action']").should("exist")
|
2022-05-09 19:00:04 +02:00
|
|
|
cy.get("button").contains("View").should("exist")
|
2022-04-26 13:04:07 +02:00
|
|
|
cy.get(".publish-popover-message").should("have.text", "Last published a few seconds ago")
|
2022-04-21 15:01:25 +02:00
|
|
|
})
|
2022-04-21 12:59:59 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it("Should unpublish an application from the top navigation and reflect the status change", () => {
|
|
|
|
//Assuming the previous test app exists and is published
|
|
|
|
|
|
|
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-status").eq(0)
|
|
|
|
.within(() => {
|
|
|
|
cy.contains("Published")
|
|
|
|
cy.get("svg[aria-label='Globe']").should("exist")
|
|
|
|
})
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-row-actions").eq(0)
|
|
|
|
.within(() => {
|
2022-05-09 19:00:04 +02:00
|
|
|
cy.get(".spectrum-Button").contains("View")
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".spectrum-Button").contains("Edit").click({ force: true })
|
|
|
|
})
|
2022-04-21 12:59:59 +02:00
|
|
|
|
|
|
|
//The published status
|
2022-04-26 13:04:07 +02:00
|
|
|
cy.get(".deployment-top-nav svg[aria-label='Globe']").should("exist")
|
2022-04-21 15:01:25 +02:00
|
|
|
.click({ force: true })
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get("[data-cy='publish-popover-menu']").should("be.visible")
|
|
|
|
cy.get("[data-cy='publish-popover-menu'] [data-cy='publish-popover-action']")
|
|
|
|
.click({ force : true })
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get("[data-cy='unpublish-modal']").should("be.visible")
|
|
|
|
.within(() => {
|
|
|
|
cy.get(".confirm-wrap button").click({ force: true }
|
|
|
|
)})
|
2022-04-21 12:59:59 +02:00
|
|
|
|
2022-04-26 13:04:07 +02:00
|
|
|
cy.get(".deployment-top-nav svg[aria-label='GlobeStrike']").should("exist")
|
2022-04-21 12:59:59 +02:00
|
|
|
|
|
|
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
|
|
|
|
2022-04-21 15:01:25 +02:00
|
|
|
cy.get(".appTable .app-status").eq(0).contains("Unpublished")
|
2022-04-21 12:59:59 +02:00
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|