feat(tests): configure PLAYWRIGHT_BASE_URL for use in CI tests

This commit is contained in:
perf3ct 2025-06-19 21:56:19 +00:00
parent c93b5dd537
commit 3a580ff4fe
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
3 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@ test.describe('Document Management', () => {
helpers = new TestHelpers(authenticatedPage); helpers = new TestHelpers(authenticatedPage);
await helpers.navigateToPage('/documents'); await helpers.navigateToPage('/documents');
// Ensure we have test documents for tests that need them // Ensure we have test documents for tests that need them
await helpers.ensureTestDocumentsExist();
}); });
test('should display document list', async ({ authenticatedPage: page }) => { test('should display document list', async ({ authenticatedPage: page }) => {

View File

@ -8,6 +8,8 @@ test.describe('Search Functionality', () => {
test.beforeEach(async ({ authenticatedPage }) => { test.beforeEach(async ({ authenticatedPage }) => {
helpers = new TestHelpers(authenticatedPage); helpers = new TestHelpers(authenticatedPage);
await helpers.navigateToPage('/search'); await helpers.navigateToPage('/search');
// Ensure we have test documents for search functionality
await helpers.ensureTestDocumentsExist();
}); });
test('should display search interface', async ({ authenticatedPage: page }) => { test('should display search interface', async ({ authenticatedPage: page }) => {

View File

@ -17,7 +17,7 @@ export default defineConfig({
], ],
outputDir: 'test-results/e2e-artifacts', outputDir: 'test-results/e2e-artifacts',
use: { use: {
baseURL: 'http://localhost:5173', baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
trace: 'on-first-retry', trace: 'on-first-retry',
screenshot: 'only-on-failure', screenshot: 'only-on-failure',
video: 'retain-on-failure', video: 'retain-on-failure',
@ -36,7 +36,7 @@ export default defineConfig({
use: { ...devices['Desktop Safari'] }, use: { ...devices['Desktop Safari'] },
}, },
], ],
webServer: { webServer: process.env.CI ? undefined : {
command: 'npm run dev', command: 'npm run dev',
url: 'http://localhost:5173', url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,