Merge branch 'master' into feat/operation-logs

* master:
  fix(e2e): improve WebDAV sync test reliability

# Conflicts:
#	e2e/pages/sync.page.ts
This commit is contained in:
Johannes Millan 2026-01-02 20:11:39 +01:00
commit d27fda7ca2
2 changed files with 31 additions and 6 deletions

View file

@ -71,22 +71,29 @@ export class SyncPage extends BasePage {
// Click on provider select to open dropdown with retry
const webdavOption = this.page.locator('mat-option').filter({ hasText: 'WebDAV' });
// Use the existing providerSelect locator which targets the mat-select directly
// Use the providerSelect locator that was already validated above
const combobox = this.providerSelect;
const selectElement = this.providerSelect;
for (let attempt = 0; attempt < 5; attempt++) {
// Ensure the select is in view
await combobox.scrollIntoViewIfNeeded();
await selectElement.scrollIntoViewIfNeeded({ timeout: 5000 }).catch(async () => {
// If scrollIntoViewIfNeeded fails, try scrolling the dialog content
const dialogContent = this.page.locator('mat-dialog-content');
if (await dialogContent.isVisible()) {
await dialogContent.evaluate((el) => el.scrollTo(0, 0));
}
});
await this.page.waitForTimeout(300);
// Focus the combobox first
await combobox.focus();
// Focus and click the select element
await selectElement.focus().catch(() => {});
await this.page.waitForTimeout(200);
// Try multiple ways to open the dropdown
if (attempt === 0) {
// First attempt: regular click
await combobox.click();
await selectElement.click().catch(() => {});
} else if (attempt === 1) {
// Second attempt: use Space key to open
await this.page.keyboard.press('Space');
@ -95,7 +102,7 @@ export class SyncPage extends BasePage {
await this.page.keyboard.press('ArrowDown');
} else {
// Later attempts: force click
await combobox.click({ force: true });
await selectElement.click({ force: true }).catch(() => {});
}
await this.page.waitForTimeout(500);

View file

@ -10,6 +10,7 @@ import {
setupClient,
waitForSync,
} from '../../utils/sync-helpers';
import { waitForAppReady } from '../../utils/waits';
test.describe('WebDAV Sync Tags', () => {
// Run sync tests serially to avoid WebDAV server contention
@ -213,6 +214,23 @@ test.describe('WebDAV Sync Tags', () => {
// Reload to ensure UI updates
await pageB.reload();
await waitForAppReady(pageB);
// Dismiss tour if it appears
try {
const tourElement = pageB.locator('.shepherd-element').first();
await tourElement.waitFor({ state: 'visible', timeout: 2000 });
const cancelIcon = pageB.locator('.shepherd-cancel-icon').first();
if (await cancelIcon.isVisible()) {
await cancelIcon.click();
} else {
await pageB.keyboard.press('Escape');
}
await tourElement.waitFor({ state: 'hidden', timeout: 3000 });
} catch {
// Tour didn't appear or wasn't dismissable
}
await workViewPageB.waitForTaskList();
// Verify task still exists but without the specific tag indicator