初始化 Playwright 项目的过程1、演示运行npm init playwrightlatest初始化 Playwright 项目的过程Getting started with writing end-to-end tests with Playwright: Initializing project in . √ Do you want to use TypeScript or JavaScript? · TypeScript √ Where to put your end-to-end tests? · tests √ Add a GitHub Actions workflow? (Y/n) · true √ Install Playwright browsers (can be done manually via npx playwright install)? (Y/n) · true Initializing NPM project (npm init -y)… Wrote to D:\WEB\PlaywrightTest\package.json: { name: playwrighttest, version: 1.0.0, description: , main: index.js, scripts: { test: echo \Error: no test specified\ exit 1 }, keywords: [], author: , license: ISC } Installing Playwright Test (npm install --save-dev playwright/test)… added 3 packages, and audited 4 packages in 5s found 0 vulnerabilities Installing Types (npm install --save-dev types/node)… added 2 packages, and audited 6 packages in 2s found 0 vulnerabilities Writing playwright.config.ts. Writing .github\workflows\playwright.yml. Writing tests\example.spec.ts. Writing package.json. Downloading browsers (npx playwright install)… Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: Request to https://storage.googleapis.com/chrome-for-testing-public/153.0.8010.12/win64/chrome-win64.zip timed out after 30000ms at ClientRequest.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:8793:15) at Object.onceWrapper (node:events:633:28) at ClientRequest.emit (node:events:519:28) at TLSSocket.emitRequestTimeout (node:_http_client:931:9) at Object.onceWrapper (node:events:633:28) at TLSSocket.emit (node:events:531:35) at Socket._onTimeout (node:net:605:8) at listOnTimeout (node:internal/timers:585:17) at process.processTimers (node:internal/timers:521:7) Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: Request to https://storage.googleapis.com/chrome-for-testing-public/153.0.8010.12/win64/chrome-win64.zip timed out after 30000ms at ClientRequest.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:8793:15) at Object.onceWrapper (node:events:633:28) at ClientRequest.emit (node:events:519:28) at TLSSocket.emitRequestTimeout (node:_http_client:931:9) at Object.onceWrapper (node:events:633:28) at TLSSocket.emit (node:events:531:35) at Socket._onTimeout (node:net:605:8) at listOnTimeout (node:internal/timers:585:17) at process.processTimers (node:internal/timers:521:7) Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Failed to install browsers Error: Failed to download Chrome for Testing 153.0.8010.12 (playwright chromium v1243), caused by Error: Download failure, code1 at ChildProcess.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:32428:32) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:293:12) Error: Command failed: npx playwright install at genericNodeError (node:internal/errors:983:15) at wrappedFn (node:internal/errors:537:14) at checkExecSyncError (node:child_process:916:11) at execSync (node:child_process:988:15) at executeCommands (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8272:39) at Generator.run (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8356:5) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async _Command.anonymous (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8661:3) at async _Command.parseAsync (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:2148:9) { status: 1, signal: null, output: [ null, null, null ], pid: 21668, stdout: null, stderr: null }2、解读1初始化配置项Getting started with writing end-to-end tests with Playwright: Initializing project in . √ Do you want to use TypeScript or JavaScript? · TypeScript √ Where to put your end-to-end tests? · tests √ Add a GitHub Actions workflow? (Y/n) · true √ Install Playwright browsers (can be done manually via npx playwright install)? (Y/n) · true指令执行后Playwright 的脚手架向开发者询问了几个配置项配置项当前配置语言TypeScript测试目录tests添加 GitHub Actions 工作流true安装 Playwright 浏览器true2初始化骨架和依赖Initializing NPM project (npm init -y)… Wrote to D:\WEB\PlaywrightTest\package.json: { name: playwrighttest, version: 1.0.0, description: , main: index.js, scripts: { test: echo \Error: no test specified\ exit 1 }, keywords: [], author: , license: ISC }运行npm init -y生成package.json文件。此时scripts.test还是默认的报错占位Installing Playwright Test (npm install --save-dev playwright/test)… added 3 packages, and audited 4 packages in 5s found 0 vulnerabilities Installing Types (npm install --save-dev types/node)… added 2 packages, and audited 6 packages in 2s found 0 vulnerabilities安装playwright/test3 个包和types/node2 个包Writing playwright.config.ts. Writing .github\workflows\playwright.yml. Writing tests\example.spec.ts. Writing package.json.写入以下文件playwright.config.ts 文件这是配置文件 .github\workflows\playwright.yml 文件这是 CI 工作流 tests\example.spec.ts 文件这是示例测试 更新后的 package.json 文件3下载浏览器Downloading browsers (npx playwright install)… Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: Request to https://storage.googleapis.com/chrome-for-testing-public/153.0.8010.12/win64/chrome-win64.zip timed out after 30000ms at ClientRequest.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:8793:15) at Object.onceWrapper (node:events:633:28) at ClientRequest.emit (node:events:519:28) at TLSSocket.emitRequestTimeout (node:_http_client:931:9) at Object.onceWrapper (node:events:633:28) at TLSSocket.emit (node:events:531:35) at Socket._onTimeout (node:net:605:8) at listOnTimeout (node:internal/timers:585:17) at process.processTimers (node:internal/timers:521:7) Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: Request to https://storage.googleapis.com/chrome-for-testing-public/153.0.8010.12/win64/chrome-win64.zip timed out after 30000ms at ClientRequest.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:8793:15) at Object.onceWrapper (node:events:633:28) at ClientRequest.emit (node:events:519:28) at TLSSocket.emitRequestTimeout (node:_http_client:931:9) at Object.onceWrapper (node:events:633:28) at TLSSocket.emit (node:events:531:35) at Socket._onTimeout (node:net:605:8) at listOnTimeout (node:internal/timers:585:17) at process.processTimers (node:internal/timers:521:7) Downloading Chrome for Testing 153.0.8010.12 (playwright chromium v1243) from https://cdn.playwright.dev/builds/cft/153.0.8010.12/win64/chrome-win64.zip Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20) { errno: -4077, code: ECONNRESET, syscall: read } Failed to install browsers Error: Failed to download Chrome for Testing 153.0.8010.12 (playwright chromium v1243), caused by Error: Download failure, code1 at ChildProcess.anonymous (D:\WEB\PlaywrightTest\node_modules\playwright-core\lib\coreBundle.js:32428:32) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:293:12) Error: Command failed: npx playwright install at genericNodeError (node:internal/errors:983:15) at wrappedFn (node:internal/errors:537:14) at checkExecSyncError (node:child_process:916:11) at execSync (node:child_process:988:15) at executeCommands (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8272:39) at Generator.run (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8356:5) at process.processTicksAndRejections (node:internal/process/task_queues:103:5) at async _Command.anonymous (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:8661:3) at async _Command.parseAsync (C:\Users\32123\AppData\Local\npm-cache\_npx\d352e76cc6b4974c\node_modules\create-playwright\lib\index.js:2148:9) { status: 1, signal: null, output: [ null, null, null ], pid: 21668, stdout: null, stderr: null }运行npx playwright install下载浏览器3、关于下载浏览器的问题1问题原因下载 Chromium 时连续报了 5 次错最终失败。错误类型如下Error: read ECONNRESET连接被对方重置通常是网络中断、被防火墙 / 代理拦截、CDN 连接不稳定Request to https://storage.googleapis.com/... timed out after 30000ms网络无法稳定访问2处理策略Playwright 可以使用本机已装浏览器免下载。在playwright.config.ts文件添加如下配置use:{channel:chrome,// 或 msedge},
企业数字化 ERP 产品动态
相关推荐
专业DAW软件推荐:从新手入门到完整制作链路怎么选 选第一套 DAW 时,大多数人踩过的坑不是软件不够强,而是把别人的工作流直接搬到自己电脑上,最后发现预算、配置、学习成本和创作目标都对不上。DAW 本质上是数字音频工作站,承担录音、编曲、音频编辑、混音、母带前处理等任务。专业… · 2026/9/24 7:07:33
零费用开源办公神器,彻底告别付费WPS 真心推荐这款宝藏办公软件 LibreOffice! 完全免费开源,无广告、无会员、不用激活破解,对比WPS和Office真的太良心了。兼容性特别强,所有Office文档格式都能正常打开、编辑、导出,跨软件传输文件不会乱格式。 功能非… · 2026/9/24 7:07:27
Java个人理财管理系统设计与实现:从数据库设计到部署避坑全解析 /* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views … · 2026/9/24 7:07:27
【Python深度学习】Pytorch 二维张量常用方法 在机器学习和深度学习领域,**张量(Tensor)**是数据的基本结构。二维张量(即2D Tensor)是张量的一个重要类型,它类似于传统的二维矩阵。
二维张量不仅具备行列结构,还可通过深度学习框架如PyTorch实现高效的数据处理。本文将介绍二维张量的基本概念、类型、创建、转换、… · 2026/9/25 8:21:53
基于 AWS SDK for .NET (v3) 构建无服务器照片资产管理应用(PAM)实战指南 示例工程教程后端 【免费下载链接】aws-doc-sdk-examples Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below. 项目地… · 2026/9/25 8:21:41
OptiScaler 完全指南:在 DLSS、FSR、XeSS 之间自由切换超采样,并为游戏开启帧生成 OptiScaler 完全指南:在 DLSS、FSR、XeSS 之间自由切换超采样,并为游戏开启帧生成 【免费下载链接】OptiScaler OptiScaler bridges upscaling/frame gen across GPUs. Supports DLSS2/XeSS/FSR2 inputs, replaces native upscalers, enables FSR-FG/XeF… · 2026/9/25 8:21:41
Edge浏览器优化实战:从闪退、内存高到IE模式与开发者模式全解 这段时间我收到不少私信,都在问类似的问题:Edge浏览器到底还能不能用?为什么每次点开都慢吞吞、内存占用高,有时候还莫名其妙闪退,甚至一打开就跳转到2345网址导航。还有人直接把Edge和Chrome对比,搜“谷歌… · 2026/9/25 8:21:35
图书管理系统总体设计:核心表结构、权限模型与建表实践 简介:面向软件工程课程设计与系统分析场景的《图书管理系统》总体设计文档,适合高校计算机专业学生和软件设计初学者参考。文档依照软件工程规范组织,系统阐述需求规定、运行环境、基本设计概念与处理流程,覆盖图书添加、删除、修… · 2026/9/25 8:21:35
创维E900V22D刷机全攻略:S905L3SB芯片兼容性解析与救砖实战 /* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views … · 2026/9/25 1:00:31
MQTT协议原理与Broker服务器搭建实战:从Mosquitto到EMQX /* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views … · 2026/9/25 1:00:37