1

Does Playwright reads the configuration file for each worker? For example, If I have set the number of workers to 3 in my Playwright configuration file, does it means that Playwright will create three separate instances of the browser to execute the tests in parallel ?

How can we avoid creating separate instances for every worker?

0

    1 Answer 1

    1

    Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the same time. By default, test files are run in parallel. Tests in a single file are run in order, in the same worker process.

    If you want to disable parallel execution, you can simply set the workers as 1 either in config or through command line during execution.

    Command line:

    npx playwright test --workers=1 

    Config:

    import { defineConfig } from '@playwright/test'; export default defineConfig({ // Disable parallel execution workers: 1 }); 

    https://playwright.dev/docs/test-parallel#disable-parallelism

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.