@@ -6,20 +6,24 @@ import path from 'path';
66 * See https://playwright.dev/docs/test-configuration.
77 */
88
9- dotenv . config ( { path : path . resolve ( __dirname , '.env' ) } ) ;
9+ dotenv . config ( { path : path . resolve ( __dirname , '.env.local ' ) } ) ;
1010
1111export const TEST_USER_EMAIL = process . env . E2E_TEST_USER_EMAIL ?? '' ;
1212export const TEST_USER_PASSWORD = process . env . E2E_TEST_USER_PASSWORD ?? '' ;
1313
1414export default defineConfig ( {
1515 testDir : './e2e/tests/pages' ,
16+
17+ // Timeout for each test in milliseconds
18+ timeout : 90 * 1000 ,
19+
1620 /* Run tests in files in parallel */
1721 fullyParallel : true ,
1822 /* Fail the build on CI if you accidentally left test.only in the source code. */
1923 forbidOnly : ! ! process . env . CI ,
2024
2125 /* The maximum number of retry attempts given to failed tests */
22- retries : process . env . CI ? 1 : undefined ,
26+ retries : process . env . CI ? 2 : 1 ,
2327 /* Reporter to use. See https://playwright.dev/docs/test-reporters */
2428 reporter : [
2529 [ 'junit' , { outputFile : 'report/e2e-junit-results.xml' } ] ,
@@ -28,8 +32,7 @@ export default defineConfig({
2832 /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2933 use : {
3034 /* Base URL to use in actions like `await page.goto('/')`. */
31- baseURL :
32- process . env . E2E_TESTS_ENV_URL ?? 'https://puistotalkoot.dev.hel.ninja/' ,
35+ baseURL : process . env . E2E_TESTS_ENV_URL ?? 'http://localhost:3000' ,
3336 ignoreHTTPSErrors : true ,
3437 screenshot : {
3538 fullPage : true ,
@@ -53,4 +56,9 @@ export default defineConfig({
5356 use : { ...devices [ 'Desktop Firefox' ] } ,
5457 } ,
5558 ] ,
59+ webServer : {
60+ command : 'pnpm start' ,
61+ url : process . env . E2E_TESTS_ENV_URL ?? 'http://localhost:3000' ,
62+ reuseExistingServer : true ,
63+ } ,
5664} ) ;
0 commit comments