[ Feature]: Support "Capability-Defined Spec Patterns" when running Suites for v7

Author: rembeckybCreated Nov 24, 2022Updated Sep 10, 2026
Labelshelp wantedgood first pickIdea 💡

Is your feature request related to a problem?

WebdriverIO supports "Capability-Defined Spec Patterns" when running "specs". For example, given these capabilities:

  {
    platformName: 'Windows 11',
    browserName: 'chrome',
    specs: [
        './chromeTest.js'
    ]
  },
  {
    platformName: 'Windows 11',
    browserName: 'firefox',
  }

And executing these specs:

    specs: [
        './testOne.js',
        './testTwo.js',
    ],

Will result in these executions:

  {
    platformName: 'Windows 11',
    browserName: 'chrome',
    specs: [
        './chromeTest.js'
    ]
  },
  {
    platformName: 'Windows 11',
    browserName: 'firefox',
    specs: [
        './testOne.js',
        './testTwo.js',
    ],
  }

However, given those same capabilities, and executing this Smoke suite instead:

    suites: {
        Smoke: [
            './smokeA.js',
            './smokeB.js',
        ]
    },

Results in these executions:

  {
    platformName: 'Windows 11',
    browserName: 'chrome',
    specs: [
        './smokeA.js',
        './smokeB.js',
    ]
  },
  {
    platformName: 'Windows 11',
    browserName: 'firefox',
    specs: [
        './smokeA.js',
        './smokeB.js',
    ]
  }

This currently override's Windows 11/chrome's provided capability specs which is not desirable.

Describe the solution you'd like.

Given these same capabilities:

  {
    platformName: 'Windows 11',
    browserName: 'chrome',
    specs: [
        './chromeTest.js'
    ]
  },
  {
    platformName: 'Windows 11',
    browserName: 'firefox',
  }

And executing the same Smoke suite:

    suites: {
        Smoke: [
            './smokeA.js',
            './smokeB.js',
        ]
    },

The executions should be as follows:

  {
    platformName: 'Windows 11',
    browserName: 'chrome',
    specs: [
        './chromeTest.js'
    ]
  },
  {
    platformName: 'Windows 11',
    browserName: 'firefox',
    specs: [
        './smokeA.js',
        './smokeB.js',
    ]
  }

This allows Windows 11/chrome's provided capability specs to override the Smoke suite's specs which is exactly how it works when using "Capability-Defined Spec Patterns" when running "specs".

Describe alternatives you've considered.

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct