Skip to content

Commit 9b54191

Browse files
Merge pull request #18675 from calixteman/nofirefox
Add an option (i.e. --noFirefox) to only use Chrome when running tests
2 parents bde7a84 + 1b0bfca commit 9b54191

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

gulpfile.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
707707
if (process.argv.includes("--noChrome") || forceNoChrome) {
708708
args.push("--noChrome");
709709
}
710+
if (process.argv.includes("--noFirefox")) {
711+
args.push("--noFirefox");
712+
}
710713
if (process.argv.includes("--headless")) {
711714
args.push("--headless");
712715
}
@@ -739,6 +742,9 @@ function makeRef(done, bot) {
739742
if (process.argv.includes("--noChrome") || forceNoChrome) {
740743
args.push("--noChrome");
741744
}
745+
if (process.argv.includes("--noFirefox")) {
746+
args.push("--noFirefox");
747+
}
742748
if (process.argv.includes("--headless")) {
743749
args.push("--headless");
744750
}

test/test.mjs

+12-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ function parseOptions() {
6969
describe: "Skip Chrome when running tests.",
7070
type: "boolean",
7171
})
72+
.option("noFirefox", {
73+
default: false,
74+
describe: "Skip Firefox when running tests.",
75+
type: "boolean",
76+
})
7277
.option("noDownload", {
7378
default: false,
7479
describe: "Skip downloading of test PDFs.",
@@ -968,7 +973,13 @@ async function startBrowsers({ baseUrl, initializeSession }) {
968973
// prevent the disk from filling up over time.
969974
await puppeteer.trimCache();
970975

971-
const browserNames = options.noChrome ? ["firefox"] : ["firefox", "chrome"];
976+
const browserNames = ["firefox", "chrome"];
977+
if (options.noChrome) {
978+
browserNames.splice(1, 1);
979+
}
980+
if (options.noFirefox) {
981+
browserNames.splice(0, 1);
982+
}
972983
for (const browserName of browserNames) {
973984
// The session must be pushed first and augmented with the browser once
974985
// it's initialized. The reason for this is that browser initialization

0 commit comments

Comments
 (0)