我尝试使用 Cypress 在 Angular 12 项目中使用 Cucumber 和 TypeScript 进行 e2e 测试。
Cypress 本身通过以下方式成功启动npx cypress open
,并显示了我创建的功能文件:
我在这里发现了类似的问题,但没有可以应用的解决方案。我相信发生此错误是因为我使用的是 cypress 自己的浏览器,并且进程变量在那里不可用。我也查看了这个存储库,但未能找到任何可以解决此问题的内容。
该项目的package.json如下所示:
{ "name": "randomAppName", "version": "0.0.0", "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"i18n": "ng extract-i18n --output-path src/assets/i18n",
"lint": "eslint . --ext .ts,.js",
"lint-fix": "eslint . --ext .ts,.js" }, "private": true, "dependencies": {
"@angular/animations": "~12.2.0",
"@angular/cdk": "^12.2.5",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0", …
Run Code Online (Sandbox Code Playgroud)