Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: E2E

on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ '**' ]
branches: ['**']

jobs:
test-e2e:
Expand All @@ -28,9 +28,6 @@ jobs:
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Set Playwright Chrome executable for CI
run: echo "PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/google-chrome" >> $GITHUB_ENV

Expand All @@ -45,6 +42,9 @@ jobs:
- name: Install dependencies
run: npm ci --no-audit --no-fund

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Prepare E2E config and data fixtures
run: |
mkdir -p src/assets/data
Expand Down
23 changes: 8 additions & 15 deletions e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ import { test, expect } from '@playwright/test';
test.describe('Git Catalogue App', () => {

test('should load the application', async ({ page }) => {
// Navigate to the application
await page.goto('/');

// Wait for the page to load
await page.waitForLoadState('networkidle');

// Check that the page loaded successfully by looking for Angular content
// The app should have loaded without critical errors

// Web-first assertions auto-wait; avoid networkidle, which hangs on the
// external Google Fonts CDN and makes this flaky on CI.
await expect(page).toHaveTitle('GitCatalogue');

// Check that the main app component is present
await expect(page.locator('app-root')).toBeVisible();
});

Expand All @@ -37,13 +31,12 @@ test.describe('Git Catalogue App', () => {
}
});

// Navigate to the application
await page.goto('/');
// Wait for the page to fully load
await page.waitForLoadState('networkidle');

// Assert that there are no critical console errors

// Wait for Angular to bootstrap rather than networkidle, which never
// settles when the external Google Fonts CDN stalls on CI.
await expect(page.locator('app-root')).toBeVisible();

expect(errors).toEqual([]);
});
});
Loading