playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: UI Mode - Set number of workers in ui mode interface

Open Kumasta opened this issue 10 months ago • 3 comments

🚀 Feature Request

In the UI mode window - add a worker count and have the ability to set number of workers when running tests in UI mode.

Example

image

Add a worker count that can be adjusted in ui mode.

Motivation

I occasionally want to run tests with just one worker to test stability of tests one by one as well as some tests are run in a single context back to back.

I would need to close ui mode and add the worker flag to the command prompt to update this.

Kumasta avatar Apr 09 '24 09:04 Kumasta

+1

HamzaMiz avatar Apr 29 '24 09:04 HamzaMiz

I support this.

What I'd also like to see, is workers based off of the project. I want to run most of my tests locally in parallel, but some of my tests NEED to be ran in serial. I would imagine that I could configure this per project, but it seems that I'm limited to only setting the amount of workers in the PlaywrightTestConfig rather than the project.

export default defineConfig({
  testDir: "./tests",
  fullyParallel: true,
  workers: 2,
  retries: 0,
  reporter: [["html"], ["list"]],

  use: {
    baseURL: process.env.BASE_URL || "http://localhost:3000",
    trace: "on-first-retry",
  },

  projects: [
    {
      name: "extra_secret_tests",
      fullyParallel: false, //<------- Disables *IN THE TEST FILE* but not in the suite...
      testDir: "./tests/extra_secret_tests",
      workers: 1, //<------ Why doesn't this work!!
      use: {
        ...devices["Desktop Chrome"],
        viewport: { width: 1920, height: 1080 },
        storageState: STORAGE_STATE,
      },
    },
  ],
});

ssloanRIIS avatar May 08 '24 15:05 ssloanRIIS

+1

marliz97 avatar Jun 14 '24 18:06 marliz97