TestCafe-错误[ERR_HTTP_HEADERS_SENT]:将标头发送到客户端后无法设置标头

问题描述 投票:1回答:1

开始使用TestCafe在随机位置获得Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

我有一个本地节点模块,该模块是createTestCafe() api上的包装器。该模块称为testcafe-runner,并像"testcafe-runner": "file:local_modules/testcafe-runner"这样安装。

我开始收到以下异常错误:

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:485:11)
    at RequestPipelineContext.redirect (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\context.js:278:9)
    at TestRun.handlePageError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe\src\test-run\index.js:287:13)
    at SessionController.handlePageError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe\src\test-run\session-controller.js:43:36)
    at error (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\utils.js:81:48)
    at DestinationRequest.<anonymous> (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\utils.js:62:9)
    at DestinationRequest.emit (events.js:209:13)
    at DestinationRequest.EventEmitter.emit (domain.js:476:20)
    at DestinationRequest._onError (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\destination-request\index.js:171:17)
    at ClientRequest.<anonymous> (C:\MyTests\local_modules\testcafe-runner\node_modules\testcafe-hammerhead\lib\request-pipeline\destination-request\index.js:93:40) {
  domainThrown: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 7

所有测试javascript文件都位于C:\ MyTests文件夹中。

在本地模块和项目上安装的testcafe 1.8.4版本

testing automation automated-tests e2e-testing testcafe
1个回答
0
投票

我得到确切的错误。

© www.soinside.com 2019 - 2024. All rights reserved.