codeceptjs / codeceptjs/CodeceptJS

`run-multiple` command picks 0 feature files when `-c` CLI option is specified

Aperta
#5,358 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
stale
Lingua principale
JavaScript
Stelle
4.2k
Fork
757
Merge medio
2g 9h
PR unite (30g)
16

Descrizione

Let's assume we have `codecept.conf.js` config file in the project root with the following config:
```js
exports.config = {
// other options go here
multiple: {
basic: {
browsers: ['chromium', 'firefox'],
},
},
gherkin: {
features: './features/*.feature',
steps: ['./step_definitions/steps.js'],
}
};
```
When running tests with:
```bash
codeceptjs run-multiple --all
```
all specified feature files are executed as expected.

However, when the `-c` CLI option is explicitly provided:
```bash
codeceptjs run-multiple --all -c codecept.conf.js
```
the command fails to identify and run the specified glob for the feature files, resulting in 0 features being picked.

Image

**Root cause:**

The issue occurs due to the usage of `path.resolve` on paths when a custom configuration file is specified [here](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/command/run-multiple.js#L74). This results in invalid input for the `globSync` command, causing it to fail to resolve the glob patterns correctly [here](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/codecept.js#L175).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.