From d57e8ef9cc2c3ed47280199a0c7975a416aa3af8 Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 20 Apr 2022 12:51:44 +0100 Subject: [PATCH] Added cypress attributes for the popover menu --- packages/bbui/src/ActionMenu/ActionMenu.svelte | 3 ++- packages/bbui/src/Popover/Popover.svelte | 4 +++- .../builder/cypress/integration/renameAnApplication.spec.js | 4 ++-- packages/builder/src/components/start/AppRow.svelte | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/bbui/src/ActionMenu/ActionMenu.svelte b/packages/bbui/src/ActionMenu/ActionMenu.svelte index 08425e8f59..c5602d6b0c 100644 --- a/packages/bbui/src/ActionMenu/ActionMenu.svelte +++ b/packages/bbui/src/ActionMenu/ActionMenu.svelte @@ -6,6 +6,7 @@ export let disabled = false export let align = "left" export let portalTarget + export let dataCy let anchor let dropdown @@ -36,7 +37,7 @@
- + diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index b7a0f08aae..ff59d41eff 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -10,6 +10,7 @@ export let anchor export let align = "right" export let portalTarget + export let dataCy let clazz export { clazz as class } @@ -40,8 +41,9 @@ use:positionDropdown={{ anchor, align }} use:clickOutside={hide} on:keydown={handleEscape} - class={"spectrum-Popover is-open " + clazz} + class={"spectrum-Popover is-open " + (clazz || "")} role="presentation" + data-cy={dataCy} > diff --git a/packages/builder/cypress/integration/renameAnApplication.spec.js b/packages/builder/cypress/integration/renameAnApplication.spec.js index ef50bdc454..73e682cce0 100644 --- a/packages/builder/cypress/integration/renameAnApplication.spec.js +++ b/packages/builder/cypress/integration/renameAnApplication.spec.js @@ -109,8 +109,8 @@ filterTests(['all'], () => { cy.get(".spectrum-Dialog-grid").contains("Unpublish app").click() cy.get(".appTable > :nth-child(5) > :nth-child(2) > .spectrum-Icon").click() } - cy.get(".app-row-actions").within(() => { - cy.get(".spectrum-Button").contains("Edit").click({ force: true }) + cy.get("[data-cy='app-row-actions-menu-popover']").eq(0).within(() => { + cy.get(".spectrum-Menu-item").contains("Edit").click({ force: true }) }) cy.get(".spectrum-Modal") .within(() => { diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index b87728672f..26c863c389 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -88,7 +88,7 @@ Edit - + {#if app.lockedYou} releaseLock(app)} icon="LockOpen">