docker setup

This commit is contained in:
2025-12-26 18:59:50 +01:00
parent 64377de548
commit 904feb41b8
11 changed files with 198 additions and 30 deletions

View File

@@ -1,14 +1,20 @@
import { test, expect } from '@playwright/test';
test.describe('Website smoke - core pages render', () => {
const routes = [
{ path: '/', name: 'landing' },
{ path: '/dashboard', name: 'dashboard' },
{ path: '/drivers', name: 'drivers list' },
{ path: '/leagues', name: 'leagues list' },
{ path: '/profile', name: 'profile' },
{ path: '/teams', name: 'teams list' },
];
const routes = process.env.DOCKER_SMOKE
? [
{ path: '/', name: 'landing' },
{ path: '/leagues', name: 'leagues list' },
{ path: '/teams', name: 'teams list' },
]
: [
{ path: '/', name: 'landing' },
{ path: '/dashboard', name: 'dashboard' },
{ path: '/drivers', name: 'drivers list' },
{ path: '/leagues', name: 'leagues list' },
{ path: '/profile', name: 'profile' },
{ path: '/teams', name: 'teams list' },
];
for (const route of routes) {
test(`renders ${route.name} page without console errors (${route.path})`, async ({ page }) => {
@@ -21,8 +27,23 @@ test.describe('Website smoke - core pages render', () => {
}
});
const apiCallPromise =
route.path === '/leagues'
? page.waitForResponse((resp) => {
return resp.url().includes('/leagues/all-with-capacity') && resp.status() === 200;
})
: route.path === '/teams'
? page.waitForResponse((resp) => {
return resp.url().includes('/teams/all') && resp.status() === 200;
})
: null;
await page.goto(route.path, { waitUntil: 'networkidle' });
if (apiCallPromise) {
await apiCallPromise;
}
await expect(page).toHaveTitle(/GridPilot/i);
expect(