appOverview Refactor + Commands update
Refactoring tests within appOverview.spec.js Commands - refactoring the deleteApp command (works better with new UI)
This commit is contained in:
parent
60592616f8
commit
5fb18d4d79
|
@ -158,8 +158,9 @@ filterTests(["all"], () => {
|
|||
.contains("Manage")
|
||||
.eq(0)
|
||||
.click({ force: true })
|
||||
cy.get(".app-icon", { timwout: 1000 }).click({ force: true })
|
||||
cy.get(".edit-hover", { timeout: 1000 }).eq(0).click({ force: true })
|
||||
// Select random icon
|
||||
cy.wait(400)
|
||||
cy.get(".grid").within(() => {
|
||||
cy.get(".icon-item")
|
||||
.eq(Math.floor(Math.random() * 23) + 1)
|
||||
|
@ -178,6 +179,7 @@ filterTests(["all"], () => {
|
|||
cy.get("@iconChange").its("response.statusCode").should("eq", 200)
|
||||
// Confirm icon has changed from default
|
||||
// Confirm colour has been applied
|
||||
cy.get(".spectrum-ActionButton-label").contains("Back").click({ force: true })
|
||||
cy.get(".appTable", { timeout: 2000 }).within(() => {
|
||||
cy.get("[aria-label]")
|
||||
.eq(0)
|
||||
|
@ -368,10 +370,10 @@ filterTests(["all"], () => {
|
|||
.contains("Copy App ID")
|
||||
.click({ force: true })
|
||||
})
|
||||
|
||||
|
||||
cy.get(".spectrum-Toast-content")
|
||||
.contains("App ID copied to clipboard.")
|
||||
.should("be.visible")
|
||||
.contains("App ID copied to clipboard.")
|
||||
.should("be.visible")
|
||||
})
|
||||
|
||||
it("Should allow unpublishing of the application", () => {
|
||||
|
@ -380,15 +382,9 @@ filterTests(["all"], () => {
|
|||
.contains("Manage")
|
||||
.eq(0)
|
||||
.click({ force: true })
|
||||
cy.get(".app-overview-actions-icon > .icon").click({ force: true })
|
||||
|
||||
cy.get("[data-cy='app-overview-menu-popover']")
|
||||
.eq(0)
|
||||
.within(() => {
|
||||
cy.get(".spectrum-Menu-item")
|
||||
.contains("Unpublish")
|
||||
.click({ force: true })
|
||||
cy.wait(500)
|
||||
cy.get(`[data-cy="app-status"]`).within(() => {
|
||||
cy.contains("Unpublish").click({ force: true })
|
||||
})
|
||||
|
||||
cy.get("[data-cy='unpublish-modal']")
|
||||
|
@ -399,9 +395,8 @@ filterTests(["all"], () => {
|
|||
|
||||
cy.get(".overview-tab [data-cy='app-status']").within(() => {
|
||||
cy.get(".status-display").contains("Unpublished")
|
||||
cy.get(".status-display .icon svg[aria-label='GlobeStrike']").should(
|
||||
"exist"
|
||||
)
|
||||
cy.get(".status-display .icon svg[aria-label='GlobeStrike']")
|
||||
.should("exist")
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -188,14 +188,15 @@ Cypress.Commands.add("deleteApp", name => {
|
|||
cy.get(actionEleId).within(() => {
|
||||
cy.contains("Manage").click({ force: true })
|
||||
})
|
||||
cy.wait(1000)
|
||||
cy.wait(500)
|
||||
|
||||
// Unpublish first if needed
|
||||
cy.get(`[data-cy="app-status"]`).then($status => {
|
||||
if ($status.text().includes("Last published")) {
|
||||
cy.contains("Unpublish").click()
|
||||
if ($status.text().includes("- Unpublish")) {
|
||||
// Exact match for Unpublish
|
||||
cy.contains("Unpublish").click({ force: true })
|
||||
cy.get(".spectrum-Modal").within(() => {
|
||||
cy.contains("Unpublish app").click()
|
||||
cy.contains("Unpublish app").click({ force: true })
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue