Files
iptvnator/apps/electron-backend-e2e/playwright.config.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

71 lines
2.1 KiB
TypeScript

import { defineConfig } from '@playwright/test';
import { workspaceRoot } from '@nx/devkit';
/**
* Playwright configuration for Electron e2e tests.
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './src',
/* Match .e2e.ts files */
testMatch: '**/*.e2e.ts',
/* Run tests sequentially since we're testing an Electron app */
fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code */
forbidOnly: !!process.env['CI'],
/* Retry on CI only */
retries: process.env['CI'] ? 2 : 0,
/* Single worker since we're testing an Electron app */
workers: 1,
/* Reporter to use */
reporter: [
['list'],
[
'html',
{
outputFolder:
'../../dist/playwright-report/electron-backend-e2e',
},
],
],
/* Shared settings for all the projects below */
use: {
/* Align with the app's existing test ids */
testIdAttribute: 'data-test-id',
/* Collect trace when retrying the failed test */
trace: 'on-first-retry',
/* Screenshots on failure */
screenshot: 'on',
/* Video on failure */
video: 'on-first-retry',
},
webServer: [
{
command: 'pnpm nx run stalker-mock-server:serve',
url: `http://localhost:${process.env['MOCK_PORT'] ?? '3210'}/health`,
reuseExistingServer: !process.env['CI'],
cwd: workspaceRoot,
},
{
command: 'pnpm nx run xtream-mock-server:serve',
url: `http://localhost:${process.env['XTREAM_MOCK_PORT'] ?? '3211'}/health`,
reuseExistingServer: !process.env['CI'],
cwd: workspaceRoot,
},
],
/* Output folder for test artifacts */
outputDir: '../../dist/test-results/electron-backend-e2e',
/* Timeout for each test */
timeout: 60000,
/* Timeout for expect() assertions */
expect: {
timeout: 10000,
},
projects: [
{
name: 'electron',
use: {},
},
],
});