Hey everyone, I'm facing an issue with our Playwright tests when running them in GitHub Actions. Here are some details about the problem:
This thread is trying to answer question "Why are Playwright tests timing out in GitHub Actions but not when run locally, and how can this issue be resolved?"
should I increase the timeout in the configuration file of playwright or github action. export default defineConfig({ timeout:70000,
testDir: './tests',
/* Run tests in files in parallel /
fullyParallel: true,
/ Fail the build on CI if you accidentally left test.only in the source code. /
forbidOnly: !!process.env.CI,
/ Retry on CI only /
retries: process.env.CI ? 2 : 0,
/ Opt out of parallel tests on CI. /
workers: process.env.CI ? 1 : undefined,
/ Reporter to use. See https://playwright.dev/docs/test-reporters /
reporter: 'html',
/ Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. /
use: {
/ Base URL to use in actions like await page.goto('/')
. */
// baseURL: 'http://127.0.0.1:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'retain-on-failure',
screenshot:'only-on-failure',
},
You can also try to run Github action locally: https://github.com/nektos/act
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].