Skip to content

Commit

Permalink
fix(e2e): fix beansConfig.cy failing with the "properties" expandable…
Browse files Browse the repository at this point in the history
… section not expanded due to the added "div" before the toggle button
  • Loading branch information
igarashitm committed Jan 10, 2025
1 parent cb2a5b4 commit 2f99100
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/ui-tests/cypress/support/next-commands/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
});
});
});
Expand Down

0 comments on commit 2f99100

Please sign in to comment.