Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Puppeteer for handling browsers during tests #11807

Merged
merged 3 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 7 additions & 32 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,21 +415,6 @@ function createTestSource(testsName, bot) {
console.log("### Running " + testsName + " tests");

var PDF_TEST = process.env.PDF_TEST || "test_manifest.json";
var PDF_BROWSERS =
process.env.PDF_BROWSERS ||
"resources/browser_manifests/browser_manifest.json";

if (!checkFile("test/" + PDF_BROWSERS)) {
console.log(
"Browser manifest file test/" + PDF_BROWSERS + " does not exist."
);
console.log(
"Copy and adjust the example in test/resources/browser_manifests."
);
this.emit("error", new Error("Missing manifest file"));
return null;
}

var args = ["test.js"];
switch (testsName) {
case "browser":
Expand All @@ -448,10 +433,12 @@ function createTestSource(testsName, bot) {
this.emit("error", new Error("Unknown name: " + testsName));
return null;
}
args.push("--browserManifestFile=" + PDF_BROWSERS);
if (bot) {
args.push("--strictVerify");
}
if (process.argv.includes("--noChrome")) {
args.push("--noChrome");
}
timvandermeij marked this conversation as resolved.
Show resolved Hide resolved

var testProcess = startNode(args, { cwd: TEST_DIR, stdio: "inherit" });
testProcess.on("close", function (code) {
Expand All @@ -466,26 +453,14 @@ function makeRef(done, bot) {
console.log();
console.log("### Creating reference images");

var PDF_BROWSERS =
process.env.PDF_BROWSERS ||
"resources/browser_manifests/browser_manifest.json";

if (!checkFile("test/" + PDF_BROWSERS)) {
console.log(
"Browser manifest file test/" + PDF_BROWSERS + " does not exist."
);
console.log(
"Copy and adjust the example in test/resources/browser_manifests."
);
done(new Error("Missing manifest file"));
return;
}

var args = ["test.js", "--masterMode"];
if (bot) {
args.push("--noPrompts", "--strictVerify");
}
args.push("--browserManifestFile=" + PDF_BROWSERS);
if (process.argv.includes("--noChrome")) {
args.push("--noChrome");
}

var testProcess = startNode(args, { cwd: TEST_DIR, stdio: "inherit" });
testProcess.on("close", function (code) {
done();
Expand Down