Ok, I think I fixed all e2e tests

This commit is contained in:
Tom Coleman 2022-07-01 15:44:16 +10:00
parent a54747bf13
commit b4130f3675

View File

@ -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 });