Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longer closing time of modals in 18.0.2 affecting Cypress tests #6678

Open
SitDownBe opened this issue Aug 15, 2024 · 1 comment
Open

Longer closing time of modals in 18.0.2 affecting Cypress tests #6678

SitDownBe opened this issue Aug 15, 2024 · 1 comment
Labels

Comments

@SitDownBe
Copy link

Description:
After updating from 18.0.0 to 18.0.2 many of our Cypress tests started failing. These are tests that close a modal and then immediately starts typing in input fields. Standard behaviour seems to be that page focus returns to the button that opened the modal after it is closed, but in 18.0.2 this is happening some time later than before. This results in some Cypress tests failing because the input field being typed in loses focus.

We've tried waiting for the modal to disappear from the DOM before continuing the tests with:

cy.get('bs-modal-backdrop').should('not.exist');
cy.get('modal-container').should('not.exist');
cy.get('body').should('not.have.class', 'modal-open');

but none of these delay the tests long enough for the modal opening button to be focussed before continuing. We also tried waiting for the button to be focussed before continuing, but it caused some flakiness. The only reliable way of solving this issue we've found so far is waiting for 500 ms after closing the modal in every test that interacts with an input field after closing a modal, which is not ideal.

@SitDownBe SitDownBe changed the title Longer closing time of modals in 18.0.2 affects Cypress tests Longer closing time of modals in 18.0.2 affecting Cypress tests Aug 15, 2024
@lexasq
Copy link
Contributor

lexasq commented Oct 22, 2024

@SitDownBe Sorry for the late response, but i think the issue is that we have fade-out animation that normally takes 450ms. You can set animation false for your tests, or close your modal using BsModalService.hide() call which bypasses animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants