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

bug: @ionic/react-router not removes ion-page with Cypress #30188

Open
3 tasks done
navalex opened this issue Feb 12, 2025 · 0 comments
Open
3 tasks done

bug: @ionic/react-router not removes ion-page with Cypress #30188

navalex opened this issue Feb 12, 2025 · 0 comments
Labels

Comments

@navalex
Copy link

navalex commented Feb 12, 2025

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When runing Ionic on Cypress end-to-end tests, if I navigate between different pages, the old pages does not remove from the DOM. The problem with this, is that some of my test expect some element to be unique on the page, and Cypress throw an error because the element exists on another page and this page content as not been removed from the DOM, it is just hidden (ion-page-hidden)

Expected Behavior

Should behave like in a normal browser (anything outside cypress): removes any ion-page after its out animation end.

Steps to Reproduce

Steps to run the repo:

  1. Clone the repo
  2. Run npm install in the repo folder
  3. Run the webserver: npm run dev
  4. In another terminal run the test: npm run test

If you want the cypress GUI, you can do cypress open, it allows to check the DOM directly during the test

Code Reproduction URL

https://github.com/navalex/ionic-cypress-page-dom-duplication

Ionic Info

Ionic:

Ionic CLI : 7.2.0 ({home}/.npm-packages/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 8.4.3

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v23.7.0 (/usr/local/bin/node)
npm : 10.9.2
OS : macOS Unknown

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Feb 12, 2025
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

1 participant