Files
iptvnator/apps/electron-backend-e2e/src/smoke.e2e.ts
T
4gray 81c2aab829 test(e2e): add end-to-end tests for playlist import, providers, and settings persistence
- Implemented tests for importing M3U playlists via native dialog.
- Added smoke tests for loading Xtream and Stalker content through IPC.
- Created tests to verify persistence of remote control settings across app restarts.
- Updated smoke tests to check for main window properties and workspace content rendering.

refactor(electron-backend): enhance store service and database path handling

- Modified store service to use a dynamic configuration directory based on environment.
- Refactored database connection to utilize new path utility functions for better path management.

fix(e2e): improve test selectors and structure for better reliability

- Updated test selectors in web-e2e tests to use role-based queries for better accessibility.
- Refactored settings tests to reduce redundancy and improve clarity.

chore(e2e): update TypeScript configuration for better inclusion of test files

- Adjusted tsconfig.json to ensure proper inclusion of e2e test files.

Entire-Checkpoint: bb9a8e2e351e
2026-03-17 23:30:16 +01:00

77 lines
2.3 KiB
TypeScript

import {
closeElectronApp,
expect,
launchElectronApp,
test,
} from './electron-test-fixtures';
test.describe('Electron App Smoke Test', () => {
test('app should start and display the dashboard', async ({ dataDir }) => {
const app = await launchElectronApp(dataDir);
try {
await expect
.poll(async () => app.mainWindow.title())
.toContain('IPTVnator');
await expect(
app.mainWindow.getByRole('link', {
name: 'Dashboard',
exact: true,
})
).toBeVisible();
await expect(
app.mainWindow.getByRole('link', { name: 'Open settings' })
).toBeVisible();
} finally {
await closeElectronApp(app);
}
});
test('app should expose the expected main window properties', async ({
dataDir,
}) => {
const app = await launchElectronApp(dataDir);
try {
const isVisible = await app.electronApp.evaluate(
async ({ BrowserWindow }) => {
const mainWindow = BrowserWindow.getAllWindows()[0];
return mainWindow ? mainWindow.isVisible() : false;
}
);
expect(isVisible).toBe(true);
const bounds = await app.electronApp.evaluate(
async ({ BrowserWindow }) => {
const mainWindow = BrowserWindow.getAllWindows()[0];
return mainWindow ? mainWindow.getBounds() : null;
}
);
expect(bounds).not.toBeNull();
expect(bounds?.width).toBeGreaterThan(800);
expect(bounds?.height).toBeGreaterThan(600);
} finally {
await closeElectronApp(app);
}
});
test('app should render workspace content', async ({ dataDir }) => {
const app = await launchElectronApp(dataDir);
try {
await expect(
app.mainWindow.getByRole('button', {
name: 'Open command palette',
})
).toBeVisible();
await expect(
app.mainWindow.getByRole('button', { name: 'Add playlist' })
).toBeVisible();
} finally {
await closeElectronApp(app);
}
});
});