ionic-team / ionic-team/ionic-framework

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

オープン
#30,188 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
triage
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### 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_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。