testing - 无法从 OSX 上的 Testcafe IDE 连接到站点
问题描述
我的灯具是这样设置的
{
"fixtures": [
{
"name": "login",
"pageUrl": "http:\/\/localhost:3000\/",
"tests": [
{
"name": "type name",
"commands": [
{
"type": "type-text",
"studio": {
},
"callsite": "0",
"selector": {
"type": "js-expr",
"value": "input[type=email]"
},
"options": {
},
"text": "example@email.com"
}
]
}
]
}
]
}
通过一个简单的测试来查找输入并输入一些文本但是在运行命令时我得到
testcafe chrome login.testcafe
ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
Type "testcafe -h" for help.
我已经在他们的问题板上多次看到这个问题,其中一个与 Linux 服务器上的 CI 集成有关,另一个似乎与尝试连接到 localhost 的类似问题
https://github.com/DevExpress/testcafe-browser-provider-electron/issues/20 https://github.com/DevExpress/testcafe/issues/1133
testcafe 的新手,任何帮助将不胜感激!
解决方案
我找到了解决方案,一些网络策略不允许在我的示例中的某些端口上访问您的机器,它是 57501。
testcafe chrome login.testcafe --hostname localhost
添加 --hostname 解决了这个问题
文件
我仍然不知道如何从 IDE 启动,但这解决了我的主要问题。
推荐阅读
- scala - Scala将String列转换并拆分为Dataframe中的MapType列
- html - 在 Html 网页上显示 pdf
- java - 如何在 Java 中将对象声明为字段?
- java - 如何将 mediaSession 用于 android api >=19
- r - 如何使用R中的clump函数删除像素簇
- flutter - 如何在处置子小部件时重建父小部件?
- aws-sdk - 通过 AWS 开发工具包指标可用于 AWS SNS 的指标有哪些?
- java - 如何将数据添加到 java swing 表中的新行?
- python - tensorflow gpu 测试通过——但我没有安装 cuDNN
- c - 如何将字符串复制到另一个变量并使用 if else 语句输出