mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(test): add proper waits to app-features E2E test to prevent flakiness
Wait for toggle to be visible after expanding the App Features section and add a small delay before clicking to ensure the toggle is fully interactive after the expansion animation.
This commit is contained in:
parent
78a4287f3c
commit
e3d93de7fc
1 changed files with 9 additions and 4 deletions
|
|
@ -51,13 +51,14 @@ test.describe('App Features', () => {
|
|||
// Go to settings page
|
||||
await page.goto('/#/config');
|
||||
|
||||
// expand "App Features"
|
||||
// expand "App Features" and wait for switch to be visible
|
||||
await appFeaturesSection.click();
|
||||
await expect(featureSwitch).toBeVisible();
|
||||
|
||||
// Ensure feature is enabled (all features are enabled by default)
|
||||
await expect(featureSwitch).toBeChecked();
|
||||
|
||||
// Click switch to disable
|
||||
// Click switch to disable and wait for state change
|
||||
await featureSwitch.click();
|
||||
await expect(featureSwitch).not.toBeChecked();
|
||||
|
||||
|
|
@ -70,10 +71,14 @@ test.describe('App Features', () => {
|
|||
// Re-enable the feature
|
||||
await page.goto('/#/config');
|
||||
|
||||
// expand "App Features"
|
||||
// expand "App Features" and wait for switch to be visible and interactable
|
||||
await appFeaturesSection.click();
|
||||
await expect(featureSwitch).toBeVisible();
|
||||
|
||||
// click toggle button to enable
|
||||
// Wait a moment for the toggle to be fully interactive after expansion animation
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Click toggle button to enable and verify state change
|
||||
await featureSwitch.click();
|
||||
await expect(featureSwitch).toBeChecked();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue