Skip to content

Commit 85592c2

Browse files
Injecting API intercept & wait for accordion-select into cy.accordion
1 parent bf47dcc commit 85592c2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cypress/support/commands/explorer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ Cypress.Commands.add('accordion', (title) => {
1010
ret.then((el) => {
1111
// Do not collapse if already expanded
1212
if (el.is('.collapsed')) {
13-
cy.wrap(el).click();
13+
cy.interceptApi({
14+
alias: 'accordionSelectApi',
15+
urlPattern: /\/[^\/]+\/accordion_select\?id=.*/,
16+
triggerFn: () => cy.wrap(el).click(),
17+
});
1418
}
1519
});
16-
17-
return ret.parents('.panel');
1820
});
1921

2022
// name: String of the record in the accordion panel to click.

0 commit comments

Comments
 (0)