From 2f99100b6a253ab85df2b022c38d4bc91efc1beb Mon Sep 17 00:00:00 2001 From: Tomohisa Igarashi Date: Fri, 10 Jan 2025 15:47:59 -0500 Subject: [PATCH] fix(e2e): fix beansConfig.cy failing with the "properties" expandable section not expanded due to the added "div" before the toggle button --- .../cypress/support/next-commands/metadata.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/ui-tests/cypress/support/next-commands/metadata.ts b/packages/ui-tests/cypress/support/next-commands/metadata.ts index 225cd3c32..53aecf144 100644 --- a/packages/ui-tests/cypress/support/next-commands/metadata.ts +++ b/packages/ui-tests/cypress/support/next-commands/metadata.ts @@ -12,11 +12,13 @@ Cypress.Commands.add('switchWrappedSection', (sectionName: string, wrapped: bool cy.get(`[data-testid="expandable-section-${sectionName}"]`) .should('be.visible') .within(() => { - cy.get('.pf-v6-c-expandable-section__toggle').each(($button) => { - if ($button.attr('aria-expanded') === String(wrapped)) { - cy.wrap($button).click(); - cy.wrap($button).should('have.attr', 'aria-expanded', String(!wrapped)); - } + cy.get('.pf-v6-c-expandable-section__toggle').within(() => { + cy.get('button').each(($button) => { + if ($button.attr('aria-expanded') === String(wrapped)) { + cy.wrap($button).click(); + cy.wrap($button).should('have.attr', 'aria-expanded', String(!wrapped)); + } + }); }); }); });