首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在本地主机上访问react应用程序时,在chrome中运行测试将引发错误。

在本地主机上访问react应用程序时,在chrome中运行测试将引发错误。
EN

Stack Overflow用户
提问于 2018-09-19 15:14:35
回答 1查看 1.4K关注 0票数 3

我有个问题,有点像CORS的问题。我们有一个react应用程序,我正在本地运行。

当我访问http://localhost:3000时,它将重定向到我们的开发服务器http://dev.domain/auth上的密钥披风授权页面。登录后,您将被重定向回原点(在本例中为localhost)

当我在Chrome:npx testcafe chrome features中运行我的测试时,浏览器已经启动,您可以看到访问了本地主机并触发了重定向,但测试咖啡馆会抛出一个错误。

代码语言:javascript
复制
Running tests in:
 - Chrome 69.0.3497 / Linux 0.0.0

 Demo testing the React Demo App
 /home/data/react-demo-app/node_modules/testcafe-hammerhead/lib/request-pipeline/connection-reset-guard.js:27
 throw err;
 ^

Error: write EPIPE
    at _errnoException (util.js:1003:13)
    at WriteWrap.afterWrite (net.js:866:14)

我试图使用禁用websecurity的npx testcafe 'chrome --disable-web-security --user-data-dir' features运行,但这并没有修复它。

当我尝试在Firefox中运行它时,它运行时没有任何问题。

代码语言:javascript
复制
Running tests in:
 - Firefox 61.0.0 / Ubuntu 0.0.0

 Demo testing the React Demo App
 ✓ Login and ...


 1 passed (21s)

我怀疑有某种跨域引用错误,因为当我在Chrome中针对开发服务器运行测试时,一切都很好。

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2018-09-20 13:01:38

TestCafe团队已经修复了Windows的这个问题。现在,他们也将为Linux修复它。请跟踪以下线程,以了解进展情况:

https://github.com/DevExpress/testcafe-hammerhead/issues/1647

更新:我们也为Linux修复了它。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52409140

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档