mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
test(e2e): fix additional tests for tabbed config page
Update plugin-lifecycle, plugin-upload, and reminders tests to navigate to correct tabs: - Plugin tests navigate to Plugins tab (extension icon) - Reminder tests navigate to Time & Tracking tab (timer icon) Fixes 5 additional E2E test failures after config page refactoring.
This commit is contained in:
parent
1f3098a48f
commit
7137533407
3 changed files with 65 additions and 0 deletions
|
|
@ -45,6 +45,22 @@ test.describe('Plugin Lifecycle', () => {
|
|||
.first()
|
||||
.waitFor({ state: 'visible', timeout: 10000 });
|
||||
|
||||
// Navigate to Plugins tab first
|
||||
await page.evaluate(() => {
|
||||
const pluginsTab = Array.from(
|
||||
document.querySelectorAll('mat-tab-header .mat-mdc-tab'),
|
||||
).find((tab) => {
|
||||
const icon = tab.querySelector('mat-icon');
|
||||
return icon?.textContent?.trim() === 'extension';
|
||||
});
|
||||
|
||||
if (pluginsTab) {
|
||||
(pluginsTab as HTMLElement).click();
|
||||
}
|
||||
});
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.evaluate(() => {
|
||||
const configPage = document.querySelector('.page-settings');
|
||||
if (!configPage) {
|
||||
|
|
@ -155,6 +171,22 @@ test.describe('Plugin Lifecycle', () => {
|
|||
.first()
|
||||
.waitFor({ state: 'visible', timeout: 10000 });
|
||||
|
||||
// Navigate to Plugins tab first
|
||||
await page.evaluate(() => {
|
||||
const pluginsTab = Array.from(
|
||||
document.querySelectorAll('mat-tab-header .mat-mdc-tab'),
|
||||
).find((tab) => {
|
||||
const icon = tab.querySelector('mat-icon');
|
||||
return icon?.textContent?.trim() === 'extension';
|
||||
});
|
||||
|
||||
if (pluginsTab) {
|
||||
(pluginsTab as HTMLElement).click();
|
||||
}
|
||||
});
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Expand plugin section
|
||||
await page.evaluate(() => {
|
||||
const pluginSection = document.querySelector('.plugin-section');
|
||||
|
|
|
|||
|
|
@ -27,6 +27,22 @@ test.describe.serial('Plugin Upload', () => {
|
|||
.first()
|
||||
.waitFor({ state: 'visible', timeout: 10000 });
|
||||
|
||||
// Navigate to Plugins tab first
|
||||
await page.evaluate(() => {
|
||||
const pluginsTab = Array.from(
|
||||
document.querySelectorAll('mat-tab-header .mat-mdc-tab'),
|
||||
).find((tab) => {
|
||||
const icon = tab.querySelector('mat-icon');
|
||||
return icon?.textContent?.trim() === 'extension';
|
||||
});
|
||||
|
||||
if (pluginsTab) {
|
||||
(pluginsTab as HTMLElement).click();
|
||||
}
|
||||
});
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.evaluate(() => {
|
||||
const configPage = document.querySelector('.page-settings');
|
||||
if (!configPage) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,23 @@ test.describe('Default task reminder option', () => {
|
|||
|
||||
const changeDefaultTaskReminderOption = async (page: Page): Promise<void> => {
|
||||
await page.getByRole('menuitem', { name: 'Settings' }).click();
|
||||
|
||||
// Navigate to Time & Tracking tab first (2nd tab with timer icon)
|
||||
await page.evaluate(() => {
|
||||
const timeTrackingTab = Array.from(
|
||||
document.querySelectorAll('mat-tab-header .mat-mdc-tab'),
|
||||
).find((tab) => {
|
||||
const icon = tab.querySelector('mat-icon');
|
||||
return icon?.textContent?.trim() === 'timer';
|
||||
});
|
||||
|
||||
if (timeTrackingTab) {
|
||||
(timeTrackingTab as HTMLElement).click();
|
||||
}
|
||||
});
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
const remindersSection = await page.locator('section', { hasText: 'Reminders' });
|
||||
await remindersSection.click();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue