I am looking to run playwright tests (Javascript) using multiple workers in a CI env (I use AWS Batch). My playwright.config.js file looks like this.
export default defineConfig({
testDir: './playwright/tests',
globalSetup: path.resolve(__dirname, './global-setup.js'),
timeout: 120_000, /* Maximum time one test can run for. */
/* 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,
workers: process.env.CI ? 1 : undefined,
When I try to run the spec files from VSCode it automatically uses X number of workers based on number of spec files run at a time. For eg:
npx playwright test ./tests/BankAccountPage ./tests/TxnAndC* --headed --reporter=html
Running 78 tests using 2 workers
This automatically uses 2 workers and if I add more spec files to npx, it automatically increases worker nodes.
But when I deploy this to AWS batch, it doesn't seem to use multiple workers.
Is there any configuration I am missing here for running in AWS with multiple worker nodes?
Any help is much appreciated.
I was expecting playwright to use multiple workers when running in AWS but it seems to use only 1 worker. When running locally, I don't specify number of workers and PW automatically determines the number of workers to use.