我有个问题,有点像CORS的问题。我们有一个react应用程序,我正在本地运行。
当我访问http://localhost:3000时,它将重定向到我们的开发服务器http://dev.domain/auth上的密钥披风授权页面。登录后,您将被重定向回原点(在本例中为localhost)
当我在Chrome:npx testcafe chrome features中运行我的测试时,浏览器已经启动,您可以看到访问了本地主机并触发了重定向,但测试咖啡馆会抛出一个错误。
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中运行它时,它运行时没有任何问题。
Running tests in:
- Firefox 61.0.0 / Ubuntu 0.0.0
Demo testing the React Demo App
✓ Login and ...
1 passed (21s)我怀疑有某种跨域引用错误,因为当我在Chrome中针对开发服务器运行测试时,一切都很好。
有什么想法吗?
发布于 2018-09-20 13:01:38
TestCafe团队已经修复了Windows的这个问题。现在,他们也将为Linux修复它。请跟踪以下线程,以了解进展情况:
https://github.com/DevExpress/testcafe-hammerhead/issues/1647
更新:我们也为Linux修复了它。
https://stackoverflow.com/questions/52409140
复制相似问题