简体   繁体   English

无法从 OSX 上的 Testcafe IDE 连接到站点

[英]Unable to connect to a site from Testcafe IDE on OSX

My fixtures are set up like so我的固定装置是这样设置的

{
  "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"
            }
          ]
        }
      ]
    }
  ]
}

with one simple test to find the input and type some text but when running the command I get通过一个简单的测试来查找输入并输入一些文本,但是在运行命令时我得到

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.

I've seen this issue a couple of times on their issues board one relating to CI integration on a Linux server and another which seems like a similar issue of trying to connect to localhost我在他们的问题上多次看到这个问题,一个是与 Linux 服务器上的 CI 集成有关,另一个似乎是尝试连接到本地主机的类似问题

https://github.com/DevExpress/testcafe-browser-provider-electron/issues/20 https://github.com/DevExpress/testcafe/issues/1133 https://github.com/DevExpress/testcafe-browser-provider-electron/issues/20 https://github.com/DevExpress/testcafe/issues/1133

New to testcafe any help would be appreciated! testcafe 新手,任何帮助将不胜感激!

I've found the solution some network policies don't allow access to your machine on some ports in my example it's 57501.我找到了解决方案,在我的示例中,某些网络策略不允许在某些端口上访问您的机器,它是 57501。

testcafe chrome login.testcafe --hostname localhost

adding --hostname resolves the issue添加 --hostname 解决了问题

documentation文件

https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--hostname-name https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#--hostname-name

I still don't know how to launch from the IDE but this resolves my main issue.我仍然不知道如何从 IDE 启动,但这解决了我的主要问题。

TestCafe Studio Preview does not support setting command line options (hostname in your case). TestCafe Studio Preview 不支持设置命令行选项(在您的情况下为主机名)。 The TestCafe team is going to implement this functionality in the official release. TestCafe 团队将在正式版本中实现此功能。

So, for now, it is only possible to run tests via a command line.因此,目前只能通过命令行运行测试。

UPDATE:更新:

You can set the hostname option in the TestCafe Studio Settings dialog :您可以在TestCafe Studio 设置对话框中设置主机名选项:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM