Skip to content

Commit f45a6cd

Browse files
committed
improve the test match filter
1 parent c08dd98 commit f45a6cd

File tree

1 file changed

+4
-4
lines changed
  • packages/selenium-side-runner/src

1 file changed

+4
-4
lines changed

packages/selenium-side-runner/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ program
3939
.option("-c, --capabilities [list]", "Webdriver capabilities")
4040
.option("-s, --server [url]", "Webdriver remote server")
4141
.option("-p, --params [list]", "General parameters")
42-
.option("-f, --filter [string]", "Filter test cases by name")
42+
.option("-f, --filter [string]", "Run suites matching name")
4343
.option("-w, --max-workers [number]", "Maximum amount of workers that will run your tests, defaults to number of cores")
4444
.option("--base-url [url]", "Override the base URL that was set in the IDE")
4545
.option("--timeout [number | undefined]", `The maximimum amount of time, in milliseconds, to spend attempting to locate an element. (default: ${DEFAULT_TIMEOUT})`)
@@ -71,6 +71,7 @@ try {
7171
winston.info("Could not load " + configurationFilePath);
7272
}
7373

74+
program.filter = program.filter || "*";
7475
configuration.server = program.server ? program.server : configuration.server;
7576

7677
configuration.timeout = program.timeout ? +program.timeout
@@ -154,9 +155,8 @@ function runProject(project) {
154155
}
155156
npmInstall.then(() => {
156157
const child = fork(require.resolve("./child"), [
157-
"--testMatch", "**/*.test.js"
158-
].concat(program.filter ? ["-t", program.filter] : [])
159-
.concat(program.maxWorkers ? ["-w", program.maxWorkers] : []), { cwd: path.join(process.cwd(), projectPath), stdio: "inherit" });
158+
"--testMatch", `{**/*${program.filter}*/*.test.js,**/*${program.filter}*.test.js}`
159+
].concat(program.maxWorkers ? ["-w", program.maxWorkers] : []), { cwd: path.join(process.cwd(), projectPath), stdio: "inherit" });
160160

161161
child.on("exit", (code) => {
162162
console.log("");

0 commit comments

Comments
 (0)