Skip to content

Commit

Permalink
chore: use puppeteer launcher to run Chrome tests (#7701)
Browse files Browse the repository at this point in the history
* test: use puppeteer launcher to run Chrome tests

* chore: also use Puppeteer for snapshots and integration
  • Loading branch information
web-padawan authored Aug 27, 2024
1 parent 067c827 commit 11494cd
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 16 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@web/test-runner": "^0.18.1",
"@web/test-runner-commands": "^0.9.0",
"@web/test-runner-playwright": "^0.11.0",
"@web/test-runner-puppeteer": "^0.16.0",
"@web/test-runner-saucelabs": "^0.11.1",
"@web/test-runner-visual-regression": "^0.9.0",
"axios": "^1.4.0",
Expand All @@ -68,6 +69,9 @@
"stylelint-config-vaadin": "^1.0.0-alpha.1",
"typescript": "^5.5.2"
},
"resolutions": {
"puppeteer": "23.2.0"
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
Expand Down
4 changes: 2 additions & 2 deletions web-test-runner-it.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-env node */
const { chromeLauncher } = require('@web/test-runner-chrome');
const { puppeteerLauncher } = require('@web/test-runner-puppeteer');
const { createIntegrationTestsConfig } = require('./wtr-utils.js');
const devServerConfig = require('./web-dev-server.config.js');

const unitTestsConfig = createIntegrationTestsConfig({
browsers: [
chromeLauncher({
puppeteerLauncher({
launchOptions: {
headless: 'shell',
},
Expand Down
4 changes: 2 additions & 2 deletions web-test-runner-snapshots.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-env node */
const { chromeLauncher } = require('@web/test-runner-chrome');
const { puppeteerLauncher } = require('@web/test-runner-puppeteer');
const { createSnapshotTestsConfig } = require('./wtr-utils.js');

module.exports = createSnapshotTestsConfig({
browsers: [
chromeLauncher({
puppeteerLauncher({
launchOptions: {
headless: 'shell',
},
Expand Down
4 changes: 2 additions & 2 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-env node */
const { chromeLauncher } = require('@web/test-runner-chrome');
const { puppeteerLauncher } = require('@web/test-runner-puppeteer');
const { createUnitTestsConfig } = require('./wtr-utils.js');
const devServerConfig = require('./web-dev-server.config.js');

const unitTestsConfig = createUnitTestsConfig({
browsers: [
chromeLauncher({
puppeteerLauncher({
launchOptions: {
headless: 'shell',
},
Expand Down
107 changes: 97 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,20 @@
unbzip2-stream "1.4.3"
yargs "17.7.2"

"@puppeteer/[email protected]":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.3.1.tgz#238200dbdce5c00ae28c8f2a55ac053c3be71668"
integrity sha512-uK7o3hHkK+naEobMSJ+2ySYyXtQkBxIH8Gn4MK9ciePjNV+Pf+PgY/W7iPzn2MTjl3stcYB5AlcTmPYw7AXDwA==
dependencies:
debug "^4.3.6"
extract-zip "^2.0.1"
progress "^2.0.3"
proxy-agent "^6.4.0"
semver "^7.6.3"
tar-fs "^3.0.6"
unbzip2-stream "^1.4.3"
yargs "^17.7.2"

"@rollup/plugin-node-resolve@^15.0.1":
version "15.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.1.0.tgz#9ffcd8e8c457080dba89bb9fcb583a6778dc757e"
Expand Down Expand Up @@ -2535,6 +2549,15 @@
"@web/test-runner-coverage-v8" "^0.8.0"
playwright "^1.22.2"

"@web/test-runner-puppeteer@^0.16.0":
version "0.16.0"
resolved "https://registry.yarnpkg.com/@web/test-runner-puppeteer/-/test-runner-puppeteer-0.16.0.tgz#33ba618c60c720f229f58b406167aec651aa6eeb"
integrity sha512-/p8zG+FX3LZjJttjQBqEigfGpnoUyEeNXrYReQWT4Uqj16Zm5F7I0UVecmBCRjnplUoXXlNcZNMsXb0jXBucTw==
dependencies:
"@web/test-runner-chrome" "^0.16.0"
"@web/test-runner-core" "^0.13.0"
puppeteer "^22.0.0"

"@web/test-runner-saucelabs@^0.11.1":
version "0.11.1"
resolved "https://registry.yarnpkg.com/@web/test-runner-saucelabs/-/test-runner-saucelabs-0.11.1.tgz#ffe1f8468652c647ffcffb5a8cbfeed97607c432"
Expand Down Expand Up @@ -3814,6 +3837,15 @@ [email protected]:
mitt "3.0.1"
urlpattern-polyfill "10.0.0"

[email protected]:
version "0.6.4"
resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-0.6.4.tgz#627d76bae2819d59b61a413babe9664e0a16b71d"
integrity sha512-8zoq6ogmhQQkAKZVKO2ObFTl4uOkqoX1PlKQX3hZQ5E9cbUotcAb7h4pTNVAGGv8Z36PF3CtdOriEp/Rz82JqQ==
dependencies:
mitt "3.0.1"
urlpattern-polyfill "10.0.0"
zod "3.23.8"

ci-info@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
Expand Down Expand Up @@ -4844,6 +4876,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1249869.tgz#000c3cf1afc189a18db98135a50d4a8f95a47d29"
integrity sha512-Ctp4hInA0BEavlUoRy9mhGq0i+JSo/AwVyX2EFgZmV1kYB+Zq+EMBAn52QWu6FbRr10hRb6pBl420upbp4++vg==

[email protected]:
version "0.0.1330662"
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1330662.tgz#400fe703c2820d6b2d9ebdd1785934310152373e"
integrity sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==

devtools-protocol@^0.0.1149535:
version "0.0.1149535"
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1149535.tgz#a058406b5430adb0822aacbb40de93c629daf37a"
Expand Down Expand Up @@ -5777,7 +5814,7 @@ extglob@^2.0.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

[email protected]:
[email protected], extract-zip@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a"
integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==
Expand Down Expand Up @@ -10535,7 +10572,7 @@ process-nextick-args@^2.0.0, process-nextick-args@~2.0.0:
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==

[email protected]:
[email protected], progress@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
Expand Down Expand Up @@ -10580,7 +10617,7 @@ protocols@^2.0.1:
resolved "https://registry.yarnpkg.com/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86"
integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==

[email protected]:
[email protected], proxy-agent@^6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.4.0.tgz#b4e2dd51dee2b377748aef8d45604c2d7608652d"
integrity sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==
Expand Down Expand Up @@ -10646,6 +10683,18 @@ [email protected]:
devtools-protocol "0.0.1120988"
ws "8.13.0"

[email protected]:
version "23.2.0"
resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-23.2.0.tgz#8ae22e412285e99c1b33263b5f65d391db2906a8"
integrity sha512-OFyPp2oolGSesx6ZrpmorE5tCaCKY1Z5e/h8f6sB0NpiezenB72jdWBdOrvBO/bUXyq14XyGJsDRUsv0ZOPdZA==
dependencies:
"@puppeteer/browsers" "2.3.1"
chromium-bidi "0.6.4"
debug "^4.3.6"
devtools-protocol "0.0.1330662"
typed-query-selector "^2.12.0"
ws "^8.18.0"

puppeteer-core@^22.0.0:
version "22.4.1"
resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-22.4.1.tgz#b7c8b4041dac8d49e409a6130f3fa2a39395298a"
Expand All @@ -10658,6 +10707,18 @@ puppeteer-core@^22.0.0:
devtools-protocol "0.0.1249869"
ws "8.16.0"

[email protected], puppeteer@^22.0.0:
version "23.2.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-23.2.0.tgz#9c0fcfdbdfffd68d62148403feaeef76f7185f72"
integrity sha512-MP7kLOdCfx1BJaGN5sgRo5fTYwAyGrlwWtrNphjKcwv/HO91+m90gbbwpRHbGl0rCvrmylq6vljn+zrjukniVg==
dependencies:
"@puppeteer/browsers" "2.3.1"
chromium-bidi "0.6.4"
cosmiconfig "^9.0.0"
devtools-protocol "0.0.1330662"
puppeteer-core "23.2.0"
typed-query-selector "^2.12.0"

q@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
Expand Down Expand Up @@ -11400,10 +11461,10 @@ semver@^6.0.0, semver@^6.3.1:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.6.0:
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.6.0, semver@^7.6.3:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==

sentence-case@^3.0.4:
version "3.0.4"
Expand Down Expand Up @@ -12350,6 +12411,17 @@ [email protected]:
bare-fs "^2.1.1"
bare-path "^2.1.0"

tar-fs@^3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.6.tgz#eaccd3a67d5672f09ca8e8f9c3d2b89fa173f217"
integrity sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==
dependencies:
pump "^3.0.0"
tar-stream "^3.1.5"
optionalDependencies:
bare-fs "^2.1.1"
bare-path "^2.1.0"

tar-stream@^1.5.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
Expand Down Expand Up @@ -12773,6 +12845,11 @@ typed-array-length@^1.0.6:
is-typed-array "^1.1.13"
possible-typed-array-names "^1.0.0"

typed-query-selector@^2.12.0:
version "2.12.0"
resolved "https://registry.yarnpkg.com/typed-query-selector/-/typed-query-selector-2.12.0.tgz#92b65dbc0a42655fccf4aeb1a08b1dddce8af5f2"
integrity sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==

typedarray-to-buffer@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
Expand Down Expand Up @@ -12830,7 +12907,7 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"

[email protected], unbzip2-stream@^1.0.9:
[email protected], unbzip2-stream@^1.0.9, unbzip2-stream@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7"
integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==
Expand Down Expand Up @@ -13438,7 +13515,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0"
integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==

[email protected], ws@^8.8.0:
[email protected]:
version "8.16.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4"
integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==
Expand All @@ -13448,6 +13525,11 @@ ws@^7.4.2:
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==

ws@^8.18.0, ws@^8.8.0:
version "8.18.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==

xml-utils@^1.0.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/xml-utils/-/xml-utils-1.3.0.tgz#f1043534e3ac3deda12ddab39f8442e16da98ebb"
Expand Down Expand Up @@ -13529,7 +13611,7 @@ [email protected]:
y18n "^5.0.5"
yargs-parser "^21.1.1"

[email protected], yargs@^17.2.1:
[email protected], yargs@^17.2.1, yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==
Expand Down Expand Up @@ -13605,3 +13687,8 @@ zip-stream@^4.1.0:
archiver-utils "^2.1.0"
compress-commons "^4.1.0"
readable-stream "^3.6.0"

[email protected]:
version "3.23.8"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d"
integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==

0 comments on commit 11494cd

Please sign in to comment.