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:
Johannes Millan 2025-12-09 14:22:31 +01:00
parent 78a4287f3c
commit e3d93de7fc

View file

@ -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();