Hi All, We are trying to run tests as part of build definition, we see that all tests are executed one by one when we run in pipeline . (Only 1 worker is being used while running) Same tests when we run in local machine tests are running in parallel (in our case 2 workers are being used).
How to make tests run in parallel when running in pipeline, could someone help me in addressing this issue.
This thread is trying to answer question "How to make tests run in parallel when running in Azure pipeline?"
What does your playwright.config.ts look like?
You should have something like this in the top for CI:
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 ? 2 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
[process.env.CI ? 'dot' : 'list'],
[process.env.CI ? 'dot' : 'html', { open: 'never' }],
['junit', { outputFile: 'results.xml' }],
],
fullyParallel and workers being the important part.
Hi, We tried to use whatever was specified above, still it is behaving same. When we run tests in local it is using multiple workers but when we run same tests in build definition it was running sequentially (running with single worker).
Tested same with sample play wright project, we see same results with the sample project also. Sample project with which we tested is posted at "https://github.com/bejugamSandeep/PlayWritght", Could you please check and let me know what can be done. Yaml file which we are using for pipeline also posted to same location.
Updated "workers: process.env.CI ? 1 : undefined" this line in the config file with following ways,
With all above cases it was using only 1 worker. Please let me know if I am missing anything here.
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].