test(e2e): fix supersync tests to navigate to correct settings tabs

E2E tests were failing because settings sections moved to different tabs:
- Simple Counters section is now in Productivity tab (not General)
- Import/Export section is now in Sync & Backup tab (not General)

Fixed tests now navigate to the correct tab before looking for sections:
- supersync-simple-counter.spec.ts: Navigate to Productivity tab
- supersync-backup-import-id-mismatch.spec.ts: Navigate to Sync & Backup tab
- supersync-backup-recovery.spec.ts: Navigate to Sync & Backup tab

5 out of 6 failing tests now pass.
This commit is contained in:
Johannes Millan 2026-01-18 12:46:20 +01:00
parent 0dd33fe4b6
commit 21e9b617a3
3 changed files with 33 additions and 2 deletions

View file

@ -42,6 +42,14 @@ const exportBackup = async (page: SimulatedE2EClient['page']): Promise<string> =
await page.waitForLoadState('networkidle');
await page.waitForTimeout(1000);
// Navigate to Sync & Backup tab where Import/Export section is located
const syncBackupTab = page.locator(
'mat-tab-header .mat-mdc-tab:has-text("Sync & Backup"), mat-tab-header .mat-tab-label:has-text("Sync & Backup")',
);
await syncBackupTab.waitFor({ state: 'visible', timeout: 10000 });
await syncBackupTab.click();
await page.waitForTimeout(500);
// Expand Import/Export section
const importExportSection = page.locator('collapsible:has-text("Import/Export")');
await importExportSection.scrollIntoViewIfNeeded();
@ -95,6 +103,14 @@ const importBackup = async (
await page.waitForLoadState('networkidle');
await page.waitForTimeout(1000);
// Navigate to Sync & Backup tab where Import/Export section is located
const syncBackupTab = page.locator(
'mat-tab-header .mat-mdc-tab:has-text("Sync & Backup"), mat-tab-header .mat-tab-label:has-text("Sync & Backup")',
);
await syncBackupTab.waitFor({ state: 'visible', timeout: 10000 });
await syncBackupTab.click();
await page.waitForTimeout(500);
const importExportSection = page.locator('collapsible:has-text("Import/Export")');
await importExportSection.scrollIntoViewIfNeeded();
await page.waitForTimeout(300);

View file

@ -178,6 +178,14 @@ const importBackup = async (
await page.waitForLoadState('networkidle');
await page.waitForTimeout(1000);
// Navigate to Sync & Backup tab where Import/Export section is located
const syncBackupTab = page.locator(
'mat-tab-header .mat-mdc-tab:has-text("Sync & Backup"), mat-tab-header .mat-tab-label:has-text("Sync & Backup")',
);
await syncBackupTab.waitFor({ state: 'visible', timeout: 10000 });
await syncBackupTab.click();
await page.waitForTimeout(500);
// Expand Import/Export section
const importExportSection = page.locator('collapsible:has-text("Import/Export")');
await importExportSection.scrollIntoViewIfNeeded();

View file

@ -31,11 +31,18 @@ const createSimpleCounter = async (
await client.page.waitForURL(/config/);
await client.page.waitForTimeout(500);
// Navigate to Productivity tab where Simple Counters section is located
const productivityTab = client.page.locator(
'mat-tab-header .mat-mdc-tab:has-text("Productivity"), mat-tab-header .mat-tab-label:has-text("Productivity")',
);
await productivityTab.waitFor({ state: 'visible', timeout: 10000 });
await productivityTab.click();
await client.page.waitForTimeout(500);
// Click on Simple Counters section (it's inside a collapsible component)
// The translated title is "Simple Counters & Habit Tracking"
// It's under "Productivity Helper" section, may need to scroll to see it
const simpleCountersSection = client.page.locator(
'.collapsible-header:has-text("Simple Counter")',
'.collapsible-header:has-text("Simple Counters")',
);
// Scroll to section and wait for it