首页 > 解决方案 > 未捕获的 AssertionError:未设置环境,中止运行柏树问题

问题描述

每次我尝试运行我的柏树测试时,我都会收到此错误:

Uncaught AssertionError: Env not set,  aborting run

This error originated from your test code, not from Cypress.

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.

检查您的控制台以获取堆栈跟踪或单击此消息以查看它的来源。

也许它正在发生,因为当我运行 cypress open 或在文件夹内运行时,它会像这样打开,我必须手动选择测试文件夹?

在此处输入图像描述

当我执行 npm install 时,我收到此错误:

Required: {"node":">=8.9.4","npm":"~5.6.0"}
Actual:   {"npm":"6.4.1","node":"11.11.0"}

标签: cypress

解决方案


推荐阅读