mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
test(many): replace waitForSelector with waitFor (#28888)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> There are some tests that use Playwright's `waitForSelector` [function](https://playwright.dev/docs/api/class-page#page-wait-for-selector). However, Playwright has informed the community to not use this function by labeling it as [discouraged](https://playwright.dev/docs/api/class-page#page-wait-for-selector). ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Replaced `waitForSelector` with the [recommended](https://playwright.dev/docs/api/class-page#page-wait-for-selector) `waitFor` [function](https://playwright.dev/docs/api/class-locator#locator-wait-for). ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> N/A
This commit is contained in:
@ -29,7 +29,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
|
||||
}
|
||||
|
||||
// Waits for the ripple effect to be added
|
||||
await page.waitForSelector('.ion-activated');
|
||||
await page.locator('.ion-activated').waitFor();
|
||||
|
||||
await expect(el).toHaveClass(/ion-activated/);
|
||||
});
|
||||
@ -56,7 +56,7 @@ const verifyRippleEffect = async (page: E2EPage, config: E2EPageOptions, selecto
|
||||
await page.mouse.down();
|
||||
}
|
||||
|
||||
await page.waitForSelector('.ion-activated');
|
||||
await page.locator('.ion-activated').waitFor();
|
||||
|
||||
await expect(el).toHaveClass(/ion-activated/);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user