Skip to content

Commit 216f62e

Browse files
authored
Support multiple comma separate tests in URL params (#198)
CLI test args already supported this.
1 parent a1c68d8 commit 216f62e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

params.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ class Params {
7878
if (this.report && !this.startDelay)
7979
this.startDelay = 4000;
8080

81-
for (const paramKey of ["tag", "tags", "test", "tests"])
81+
for (const paramKey of ["tag", "tags", "test", "tests"]) {
8282
this.testList = this._parseTestListParam(sourceParams, paramKey);
83+
}
8384

8485
this.testIterationCount = this._parseIntParam(sourceParams, "iterationCount", 1);
8586
this.testWorstCaseCount = this._parseIntParam(sourceParams, "worstCaseCount", 1);
@@ -94,14 +95,18 @@ class Params {
9495
return this.testList;
9596
let testList = [];
9697
if (sourceParams?.getAll) {
97-
testList = sourceParams?.getAll(key);
98+
for (const param of sourceParams?.getAll(key)) {
99+
testList.push(...param.split(","));
100+
}
98101
} else {
99102
// fallback for cli sourceParams which is just a Map;
100103
testList = sourceParams.get(key).split(",");
101104
}
105+
testList = testList.map(each => each.trim());
102106
sourceParams.delete(key);
103-
if (this.testList.length > 0 && testList.length > 0)
107+
if (this.testList.length > 0 && testList.length > 0) {
104108
throw new Error(`Overriding previous testList='${this.testList.join()}' with ${key} url-parameter.`);
109+
}
105110
return testList;
106111
}
107112

tests/run-browser.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ async function runTests() {
6161
let success = true;
6262
try {
6363
success &&= await runEnd2EndTest("Run Single Suite", { test: "proxy-mobx" });
64+
success &&= await runEnd2EndTest("Run Multiple Suites", { test: "prismjs-startup-es6,postcss-wtb" });
6465
success &&= await runEnd2EndTest("Run Tag No Prefetch", { tag: "proxy", prefetchResources: "false" });
6566
success &&= await runEnd2EndTest("Run Disabled Suite", { tag: "disabled" });
6667
success &&= await runEnd2EndTest("Run Default Suite");

0 commit comments

Comments
 (0)