Skip to content

Commit

Permalink
Ok, I think I fixed all e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jul 1, 2022
1 parent cbf9125 commit 4097f31
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ Cypress.Commands.add('navigateToStory', (kind, name) => {
cy.log(`navigateToStory ${kind} ${name}`);

// Section might be collapsed
cy.get(`#${kindId}`).then(async ($item) => {
if ($item.attr('aria-expanded') === 'false') {
await $item.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(300);
}
});
if (Cypress.$(`#${kindId}`).length) {
cy.get(`#${kindId}`).then(async ($item) => {
if ($item.attr('aria-expanded') === 'false') {
await $item.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(300);
}
});
}

cy.get(storyLinkId).click({ force: true });

Expand Down

0 comments on commit 4097f31

Please sign in to comment.