test: start mailhog before running playwright (#55533)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Oliver Eyton-Williams
2024-07-22 16:49:27 +02:00
committed by GitHub
parent f2e78151b8
commit bb7968f8d7
2 changed files with 8 additions and 10 deletions

View File

@@ -7,9 +7,6 @@ import {
} from './utils/mailhog';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
// To run this test you will need to run the email server.
// To do this: https://contribute.freecodecamp.org/#/how-to-catch-outgoing-emails-locally?id=using-mailhog
test.beforeEach(async () => {
await deleteAllEmails();
});

View File

@@ -85,12 +85,13 @@ export default defineConfig({
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' }
// }
]
],
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
/* Some tests make the api send emails, so we need mailhog to catch them */
webServer: {
command: 'docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog',
port: 1025,
reuseExistingServer: true,
timeout: 180000
}
});