feat(ci): enforce runtime-validation image separation #69
@@ -48,14 +48,10 @@ export default defineConfig({
|
||||
'--disable-background-timer-throttling',
|
||||
'--disable-backgrounding-occluded-windows',
|
||||
'--disable-renderer-backgrounding',
|
||||
// Network resilience args
|
||||
// Keep CI browser args minimal and deterministic.
|
||||
'--disable-extensions',
|
||||
'--disable-plugins',
|
||||
'--disable-images', // Faster loading, reduce network load
|
||||
'--aggressive-cache-discard',
|
||||
// Increase network timeouts
|
||||
'--network-quiet-timeout=10000',
|
||||
'--disable-background-networking',
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -83,7 +79,7 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
webServer: {
|
||||
command: 'yarn dev',
|
||||
command: 'yarn dev --host 0.0.0.0 --port 5173 --strictPort',
|
||||
url: 'http://localhost:5173',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: process.env.CI ? 180 * 1000 : 120 * 1000, // Longer startup timeout in CI
|
||||
|
||||
@@ -9,7 +9,8 @@ async function navigateWithRetry(page: any, url: string, maxRetries = 3): Promis
|
||||
for (let i = 0; i < maxRetries; i++) {
|
||||
try {
|
||||
await page.goto(url, {
|
||||
waitUntil: 'networkidle',
|
||||
// Vite dev server maintains long-lived connections, so networkidle can flake in CI.
|
||||
waitUntil: 'domcontentloaded',
|
||||
timeout: process.env.CI ? 45000 : 30000,
|
||||
});
|
||||
return; // Success
|
||||
@@ -25,17 +26,13 @@ test.describe('Plex Playlist App', () => {
|
||||
test('should display app title', async ({ page }) => {
|
||||
await navigateWithRetry(page, '/');
|
||||
|
||||
// Wait for the app to fully load with network resilience
|
||||
await page.waitForSelector('h1', { timeout: 15000 });
|
||||
await expect(page.locator('h1')).toContainText('Plex Playlist');
|
||||
await expect(page.getByRole('heading', { level: 1 })).toHaveText('Plex Playlist');
|
||||
});
|
||||
|
||||
test('should have welcome message', async ({ page }) => {
|
||||
await navigateWithRetry(page, '/');
|
||||
|
||||
// Wait for the welcome message to appear with network resilience
|
||||
await page.waitForSelector('p', { timeout: 15000 });
|
||||
await expect(page.locator('p')).toContainText('Welcome to the Plex Playlist Manager');
|
||||
await expect(page.getByText('Welcome to the Plex Playlist Manager')).toBeVisible();
|
||||
});
|
||||
|
||||
test('should load without errors', async ({ page }) => {
|
||||
@@ -52,8 +49,9 @@ test.describe('Plex Playlist App', () => {
|
||||
|
||||
await navigateWithRetry(page, '/');
|
||||
|
||||
// Wait for app to fully load with extra time for network instability
|
||||
await page.waitForLoadState('networkidle');
|
||||
// Ensure document and app shell are loaded before checking browser errors.
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
|
||||
|
||||
// Give extra time for any async operations in unstable networks
|
||||
await page.waitForTimeout(process.env.CI ? 3000 : 1000);
|
||||
|
||||
Reference in New Issue
Block a user