Skip to content

Commit a60804c

Browse files
Injecting API intercept & wait for tree-select into selectAccordionItem
1 parent 3601e71 commit a60804c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cypress/support/commands/explorer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ Cypress.Commands.add('selectAccordionItem', (accordionPath) => {
7575
const currentLiElement = Cypress.$(listItems[i]);
7676
// If it's the last label in the path, then that is the desired item to click
7777
if (isClickableNode) {
78-
// Click the node corresponding to the last label in the given path and terminate
79-
cy.wrap(currentLiElement).click();
78+
// Click the node corresponding to the last label in the given path,
79+
// intercept & wait for the Tree-Select api and then terminate
80+
cy.interceptApi({
81+
alias: 'treeSelectApi',
82+
urlPattern: /\/[^\/]+\/tree_select\?id=.*&text=.*/,
83+
triggerFn: () => cy.wrap(currentLiElement).click(),
84+
});
8085
return;
8186
}
8287

0 commit comments

Comments
 (0)