Skip to content

A platform for community discussion. Free, open, simple.

DEV: Update puppeteer, fix deprecations, lint (#16616)

Jarek Radoszbc0eca19767c
diff --git a/package.json b/package.json
index fc217dafda2..3d80aaada9e 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"chrome-launcher": "^0.15.0",
"chrome-remote-interface": "^0.31.2",
"pretender": "^3.4.7",
- "puppeteer-core": "^13.0.0",
+ "puppeteer-core": "^13.7.0",
"qunit": "2.8.0",
"route-recognizer": "^0.3.3",
"sinon": "^13.0.1",
diff --git a/test/smoke_test.js b/test/smoke_test.js
index f5514ef81ae..43e189baed1 100644
--- a/test/smoke_test.js
+++ b/test/smoke_test.js
@@ -1,4 +1,4 @@
-/*eslint no-console: "off"*/
+/* eslint no-console: "off" */
const args = process.argv.slice(2);
@@ -26,12 +26,13 @@ const path = require("path");
await page.setViewport({
width: 1366,
- height: 768
+ height: 768,
});
- const takeFailureScreenshot = function() {
- const screenshotPath = `${process.env.SMOKE_TEST_SCREENSHOT_PATH ||
- "tmp/smoke-test-screenshots"}/smoke-test-${Date.now()}.png`;
+ const takeFailureScreenshot = function () {
+ const screenshotPath = `${
+ process.env.SMOKE_TEST_SCREENSHOT_PATH || "tmp/smoke-test-screenshots"
+ }/smoke-test-${Date.now()}.png`;
console.log(`Screenshot of failure taken at ${screenshotPath}`);
return page.screenshot({ path: screenshotPath, fullPage: true });
};
@@ -41,7 +42,7 @@ const path = require("path");
return fn
.call()
- .then(async output => {
+ .then(async (output) => {
if (assertion) {
if (assertion.call(this, output)) {
console.log(`PASSED: ${description} - ${+new Date() - start}ms`);
@@ -55,7 +56,7 @@ const path = require("path");
console.log(`PASSED: ${description} - ${+new Date() - start}ms`);
}
})
- .catch(async error => {
+ .catch(async (error) => {
console.log(
`ERROR (${description}): ${error.message} - ${+new Date() - start}ms`
);
@@ -69,9 +70,9 @@ const path = require("path");
return exec(description, fn, assertion);
};
- page.on("console", msg => console.log(`PAGE LOG: ${msg.text()}`));
+ page.on("console", (msg) => console.log(`PAGE LOG: ${msg.text()}`));
- page.on("response", resp => {
+ page.on("response", (resp) => {
if (resp.status() !== 200 && resp.status() !== 302) {
console.log(
"FAILED HTTP REQUEST TO " + resp.url() + " Status is: " + resp.status()
@@ -91,12 +92,12 @@ const path = require("path");
await exec("basic authentication", () => {
return page.authenticate({
username: process.env.AUTH_USER,
- password: process.env.AUTH_PASSWORD
+ password: process.env.AUTH_PASSWORD,
});
});
}
- const login = async function() {
+ const login = async function () {
await exec("open login modal", () => {
return page.click(".login-button");
});
@@ -181,7 +182,7 @@ const path = require("path");
await exec("go home", () => {
let promise = page.waitForSelector("#site-logo, #site-text-logo", {
- visible: true
+ visible: true,
});
promise = promise.then(() => {
@@ -245,7 +246,7 @@ const path = require("path");
await exec("composer is open", () => {
return page.waitForSelector("#reply-control .d-editor-input", {
- visible: true
+ visible: true,
});
});
@@ -262,7 +263,7 @@ const path = require("path");
});
await exec("wait a little bit", () => {
- return page.waitFor(5000);
+ return page.waitForTimeout(5000);
});
await exec("submit the reply", () => {
@@ -270,7 +271,7 @@ const path = require("path");
promise = promise.then(() => {
return page.waitForSelector("#reply-control.closed", {
- visible: false
+ visible: false,
});
});
@@ -281,7 +282,7 @@ const path = require("path");
let promise = page.waitForSelector(
".topic-post:not(.staged) #post_2 .cooked",
{
- visible: true
+ visible: true,
}
);
@@ -295,7 +296,7 @@ const path = require("path");
});
await exec("wait a little bit", () => {
- return page.waitFor(5000);
+ return page.waitForTimeout(5000);
});
await exec("open composer to edit first post", () => {
@@ -309,7 +310,7 @@ const path = require("path");
promise = promise.then(() => {
return page.waitForSelector("#reply-control .d-editor-input", {
- visible: true
+ visible: true,
});
});
@@ -317,7 +318,7 @@ const path = require("path");
});
await exec("update post raw in composer", () => {
- let promise = page.waitFor(5000);
+ let promise = page.waitForTimeout(5000);
promise = promise.then(() => {
return page.type(
@@ -334,7 +335,7 @@ const path = require("path");
promise = promise.then(() => {
return page.waitForSelector("#reply-control.closed", {
- visible: false
+ visible: false,
});
});
@@ -345,7 +346,7 @@ const path = require("path");
let promise = page.waitForSelector(
".topic-post:not(.staged) #post_1 .cooked",
{
- visible: true
+ visible: true,
}
);
diff --git a/yarn.lock b/yarn.lock
index 1fb65d13ef2..d0274ef25a8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -218,14 +218,7 @@
resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f"
integrity sha512-l5qumKFWU0S+4ZzMaLXFU8tQZsicHEMEyAxI5kDFGhJsRqDwe0a7/iPA/GdxlGyDKseQQAgIz5kzU7eXTrlSpA==
-"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0":
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217"
- integrity sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==
- dependencies:
- type-detect "4.0.8"
-
-"@sinonjs/commons@^1.8.3":
+"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3":
version "1.8.3"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d"
integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==
@@ -375,16 +368,11 @@ acorn-walk@^7.0.0:
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc"
integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==
-acorn@^7.0.0:
+acorn@^7.0.0, acorn@^7.1.1:
version "7.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
-acorn@^7.1.1:
- version "7.4.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c"
- integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
-
agent-base@6:
version "6.0.2"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
@@ -937,12 +925,7 @@ cli-cursor@^3.1.0:
dependencies:
restore-cursor "^3.1.0"
-cli-spinners@^2.2.0:
- version "2.4.0"
- resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
- integrity sha512-sJAofoarcm76ZGpuooaO0eDy8saEy+YoZBLjC4h8srt4jeBnkYeOgqxgsJQTpyt2LjI5PTfLJHSL+41Yu4fEJA==
-
-cli-spinners@^2.5.0:
+cli-spinners@^2.2.0, cli-spinners@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.5.0.tgz#12763e47251bf951cb75c201dfa58ff1bcb2d047"
integrity sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==
@@ -1114,6 +1097,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
+ integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
+ dependencies:
+ node-fetch "2.6.7"
+
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
@@ -1147,17 +1137,10 @@ dash-ast@^1.0.0:
resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37"
integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==
-debug@4, debug@^4.1.1:
- version "4.3.3"
- resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
- integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
- dependencies:
- ms "2.1.2"
-
- version "4.3.2"
- resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
- integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
+debug@4, [email protected], debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
+ version "4.3.4"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
+ integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
@@ -1168,13 +1151,6 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.8:
dependencies:
ms "2.0.0"
-debug@^4.0.1, debug@^4.1.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
- integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
- dependencies:
- ms "2.1.2"
-
decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
@@ -1263,10 +1239,10 @@ detective@^5.2.0:
defined "^1.0.0"
minimist "^1.1.1"
- version "0.0.937139"
- resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.937139.tgz#bdee3751fdfdb81cb701fd3afa94b1065dafafcf"
- integrity sha512-daj+rzR3QSxsPRy5vjjthn58axO8c11j58uY0lG5vvlJk/EiOdCWOptGdkXDjtuRHr78emKq0udHCXM4trhoDQ==
+ version "0.0.981744"
+ resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.981744.tgz#9960da0370284577d46c28979a0b32651022bacf"
+ integrity sha512-0cuGS8+jhR67Fy7qG3i3Pc7Aw494sb9yG9QgpG97SFVWwolgYjlhJg7n+UaHxOQT30d1TYu/EYe9k01ivLErIg==
diff@^5.0.0:
version "5.0.0"
@@ -1957,7 +1933,7 @@ glob-stream@^6.1.0:
to-absolute-glob "^2.0.0"
unique-stream "^2.0.2"
-glob@^7.1.0:
+glob@^7.1.0, glob@^7.1.1, glob@^7.1.3:
version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
@@ -1969,18 +1945,6 @@ glob@^7.1.0:
once "^1.3.0"
path-is-absolute "^1.0.0"
-glob@^7.1.1, glob@^7.1.3:
- version "7.1.6"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
- integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
global-modules@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea"
@@ -2138,10 +2102,10 @@ https-browserify@^1.0.0:
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2"
- integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
+ integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
dependencies:
agent-base "6"
debug "4"
@@ -2864,16 +2828,11 @@ [email protected]:
dependencies:
moment ">= 2.9.0"
[email protected], "moment@>= 2.9.0":
version "2.29.2"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4"
integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==
-"moment@>= 2.9.0":
- version "2.29.0"
- resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.0.tgz#fcbef955844d91deb55438613ddcec56e86a3425"
- integrity sha512-z6IJ5HXYiuxvFTI6eiQ9dm77uE0gyy1yXNApVHqTcnIKfY9tIwEjlzsZ6u1LQXvVgKeTnv9Xm7NDvJ7lso3MtA==
-
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -2949,10 +2908,10 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"
- version "2.6.5"
- resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd"
- integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==
+ version "2.6.7"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
+ integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"
@@ -3352,23 +3311,23 @@ punycode@^2.1.0:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
-puppeteer-core@^13.0.0:
- version "13.0.0"
- resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-13.0.0.tgz#5a8307ca16a7ee325ec5d6e41bd89895951a0ea9"
- integrity sha512-JJvGCuUNpONaFK/1tizyVthfqkEaiTCteL9HkdxN3//P9cVa+YnehlKIoJCStiKRaa3CjRu/dIJftA5XJ2EGrQ==
+puppeteer-core@^13.7.0:
+ version "13.7.0"
+ resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-13.7.0.tgz#3344bee3994163f49120a55ddcd144a40575ba5b"
+ integrity sha512-rXja4vcnAzFAP1OVLq/5dWNfwBGuzcOARJ6qGV7oAZhnLmVRU8G5MsdeQEAOy332ZhkIOnn9jp15R89LKHyp2Q==
dependencies:
- debug "4.3.2"
- devtools-protocol "0.0.937139"
+ cross-fetch "3.1.5"
+ debug "4.3.4"
+ devtools-protocol "0.0.981744"
extract-zip "2.0.1"
- https-proxy-agent "5.0.0"
- node-fetch "2.6.5"
+ https-proxy-agent "5.0.1"
pkg-dir "4.2.0"
progress "2.0.3"
proxy-from-env "1.1.0"
rimraf "3.0.2"
tar-fs "2.1.1"
unbzip2-stream "1.4.3"
- ws "8.2.3"
+ ws "8.5.0"
querystring-es3@~0.2.0:
version "0.2.1"
@@ -3505,7 +3464,7 @@ [email protected]:
dependencies:
path-parse "^1.0.5"
-resolve@^1.1.4, resolve@^1.4.0:
+resolve@^1.1.4, resolve@^1.12.0, resolve@^1.17.0, resolve@^1.4.0, resolve@^1.8.1:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
@@ -3513,13 +3472,6 @@ resolve@^1.1.4, resolve@^1.4.0:
is-core-module "^2.2.0"
path-parse "^1.0.6"
-resolve@^1.12.0, resolve@^1.17.0, resolve@^1.8.1:
- version "1.17.0"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
- integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
- dependencies:
- path-parse "^1.0.6"
-
restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
@@ -4416,10 +4368,10 @@ [email protected]:
dependencies:
mkdirp "^0.5.1"
- version "8.2.3"
- resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba"
- integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==
+ version "8.5.0"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f"
+ integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==
ws@^7.2.0:
version "7.5.7"