Skip to content

Commit ae3ac87

Browse files
committed
chore(e2e): run against vite preview and use baseURL; fix app script path to src/js/main.js
1 parent b1ec804 commit ae3ac87

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

playwright.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { defineConfig } from '@playwright/test';
33
export default defineConfig({
44
testDir: './test/e2e',
55
webServer: {
6-
command: 'npm run dev',
7-
url: 'http://localhost:5173',
6+
// Serve the production build instead of Vite dev to avoid overlay and missing dev-only files
7+
command: 'npm run preview',
8+
url: 'http://localhost:4173',
89
reuseExistingServer: !process.env.CI,
910
},
1011
use: {
11-
baseURL: 'http://localhost:5173',
12+
baseURL: 'http://localhost:4173',
1213
screenshot: 'only-on-failure',
1314
},
1415
reporter: [

test/e2e/modal.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, expect } from '@playwright/test';
22

3-
test.beforeEach(async ({ page }) => {
4-
await page.goto('http://localhost:5173');
3+
test.beforeEach(async ({ page, baseURL }) => {
4+
await page.goto(baseURL + '/');
55
});
66

77
test('deve mostrar o modal quando o botão é clicado', async ({ page }) => {

0 commit comments

Comments
 (0)