-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to fix Playwright tests failing - human edition #1884
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle ReportChanges will increase total bundle size by 5.46kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Scott! Love your Podcast! Was listening to nearly every episode when I started with development in 2018/19 - I'm sure it shaped me a lot, thank you!
I made a couple of comments but they are all unrelated to the actual issue you were reporting in microsoft/playwright#33403 which triggered the Segmentation fault (core dumped)
. I think this is not related to Playwright but took this opportunity to give you a few best-practises on the way.
playwright.config.ts
Outdated
import type { PlaywrightTestConfig } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
const config = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? we usually recommend a couple of defaults be overridden which give you better performance over time. Thinking about:
import { defineConfig, devices } from '@playwright/test';
const config = defineConfig({
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
webServer: {
command: 'pnpm build:svelte && pnpm preview',
port: 4173,
timeout: 600_000
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
testDir: 'tests'
});
export default config;
- fullyParallel executes tests in parallel
- retries: 2 on CI is usually a good practise since CI environments are usually considered flaky e.g. network issues or overloaded machine
- projects: having project there makes it more clear.
For the future adding HTML reporter might also make sense and upload the report to GitHub if you want to be more advanced, see here for our guide.
#1878