Skip to content

Commit 0e6a9a0

Browse files
committed
build: update puppeteer to v24.37.5
1 parent 8fb74c9 commit 0e6a9a0

File tree

8 files changed

+318
-127
lines changed

8 files changed

+318
-127
lines changed

modules/testing/builder/projects/hello-world-app/karma.conf.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
// https://karma-runner.github.io/1.0/config/configuration-file.html
1111

1212
const path = require('path');
13-
process.env.CHROME_BIN = require('puppeteer').executablePath();
13+
14+
// Resolve from relative paths to absolute paths within the bazel runfiles tree
15+
// so subprocesses spawned in a different working directory can still find them.
16+
process.env.CHROME_BIN = process.env.CHROME_BIN ? path.resolve(path.join(process.cwd(), '..', '..', '..'), process.env.CHROME_BIN) : require('puppeteer').executablePath();
1417

1518
module.exports = function(config) {
1619
config.set({

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"lodash": "^4.17.21",
119119
"magic-string": "0.30.21",
120120
"prettier": "^3.0.0",
121-
"puppeteer": "18.2.1",
121+
"puppeteer": "24.37.5",
122122
"quicktype-core": "23.2.6",
123123
"rollup": "4.59.0",
124124
"rollup-license-plugin": "~3.1.0",
@@ -144,7 +144,6 @@
144144
},
145145
"pnpm": {
146146
"onlyBuiltDependencies": [
147-
"puppeteer",
148147
"webdriver-manager"
149148
],
150149
"overrides": {

packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
153153
// See: https://github.com/angular/angular-cli/pull/17624
154154
// eslint-disable-next-line max-len
155155
// executablePath: '/Users/<USERNAME>/git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
156-
ignoreHTTPSErrors: true,
156+
acceptInsecureCerts: true,
157157
args: ['--no-sandbox', '--disable-gpu'],
158158
});
159159
});

packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describeServeBuilder(
161161
// See: https://github.com/angular/angular-cli/pull/17624
162162
// eslint-disable-next-line max-len
163163
// executablePath: '/Users/<USERNAME>/git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium',
164-
ignoreHTTPSErrors: true,
164+
acceptInsecureCerts: true,
165165
args: ['--no-sandbox', '--disable-gpu'],
166166
});
167167
});

pnpm-lock.yaml

Lines changed: 296 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/tests/build/auto-csp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default async function () {
9797
checkFn: async (page) => {
9898
const warnMessages: string[] = [];
9999
page.on('console', (msg) => {
100-
if (msg.type() === 'warning') {
100+
if (msg.type() === 'warn') {
101101
warnMessages.push(msg.text());
102102
}
103103
});

tests/e2e/utils/puppeteer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function executeBrowserTest(options: BrowserTestOptions = {}) {
5353
}
5454
});
5555
page.on('pageerror', (err) => {
56-
errors.push(err.toString());
56+
errors.push(`${err}`);
5757
});
5858

5959
await page.goto(url);

tools/defaults.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,22 @@ def jasmine_test(data = [], args = [], **kwargs):
6565
# we change the `chdir` below to the package directory.
6666
relative_to_root = "/".join([".."] * len(native.package_name().split("/")))
6767

68+
# Chromium browser toolchain
69+
env = kwargs.pop("env", {})
70+
env.update({
71+
"CHROME_BIN": "$(CHROME-HEADLESS-SHELL)",
72+
"CHROME_PATH": "$(CHROME-HEADLESS-SHELL)",
73+
"CHROMEDRIVER_BIN": "$(CHROMEDRIVER)",
74+
})
75+
toolchains = kwargs.pop("toolchains", [])
76+
toolchains = toolchains + ["@rules_browsers//browsers/chromium:toolchain_alias"]
77+
data = data + ["@rules_browsers//browsers/chromium"]
78+
6879
_jasmine_test(
6980
node_modules = "//:node_modules",
7081
chdir = native.package_name(),
82+
env = env,
83+
toolchains = toolchains,
7184
args = [
7285
"--require=%s/node_modules/source-map-support/register.js" % relative_to_root,
7386
# Escape so that the `js_binary` launcher triggers Bash expansion.

0 commit comments

Comments
 (0)