diff --git a/packages/builder/cypress/integration/appOverview.spec.js b/packages/builder/cypress/integration/appOverview.spec.js index a78578facf..244c0c89d4 100644 --- a/packages/builder/cypress/integration/appOverview.spec.js +++ b/packages/builder/cypress/integration/appOverview.spec.js @@ -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") }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 8d60d243e0..6bd6074eda 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -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 }) }) } })