TestCafe,CircleCI 2.0及更高版本SauceLabs-无法使此组合正常工作 [英] TestCafe, CircleCI 2.0 & SauceLabs -- can't get this combination to work

查看:115
本文介绍了TestCafe,CircleCI 2.0及更高版本SauceLabs-无法使此组合正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以-我可以在笔记本电脑上执行以下操作:
testcafe saucelabs:Chrome@70.0:Windows 10 tests / settings / users.js

So -- I can, from my laptop do the following: testcafe "saucelabs:Chrome@70.0:Windows 10" tests/settings/users.js

这将连接到SauceLabs,以启动测试(或多种测试,无论哪种方式均可),以对付我们的开发服务器。 (IP已列入白名单,所有方法都可以使用。)

This will, connect to SauceLabs, to launch the test (or multiple tests, works either way), to hit back against our development server. (IP's have been whitelisted, it all works).

我当然也可以登录到酱汁实验室,打开实时测试浏览器并连接到此环境。 / login等。

I can also, of course, login to sauce labs, open a "live testing" browser and connect to this environment/login etc.

因此, SauceLabs =->我的环境很好。

Thus, the "SauceLabs =-> My environment" is fine.

如果我尝试在circleci上运行构建以完全做到 失败。

If I try to run a build on circleci to do exactly this it fails.

在我的角色中,我有以下代码:

In my role I have the following code:

const getPageHTML = ClientFunction(() => document.documentElement.outerHTML);
let value = await getPageHTML();
console.log(value);
const pageLink = ClientFunction (() => window.location.href);
value = await pageLink();
console.log(value);

这将打印出整个外部HTML只是

This will print out that the entire outerHTML is only

<html><head></head><body></body></html>

它将打印出当前网址为 about:blank

It will print out that the current url is "about:blank"

所以,我的问题..在运行测试时,使用saucelabs,从圆开始,我是否需要将圆列入白名单?

So, my question.. when running tests, using saucelabs, FROM CIRCLE, would I need to whitelist CIRCLE?

当我们使用ucelabs浏览器时,我似乎无法弄清楚从笔记本电脑与圈子进行测试之间的功能/执行差异。

I can't seem to figure out what the functional/execution difference is between running the tests from my laptop vs circle when we are USING saucelabs browsers.

此时是正在运行测试的IP(白名单ip)circleCI还是saucelabs?当然,我一直以为是平底锅。

Is the "IP from which the tests are being run" (whitelist ip) circleCI at this point, or saucelabs? I, of course, have been presuming it is saucelabs.

注意:实际上,我实际上可以通过testcafe example.js测试,并获得它可以使用circle / saucelabs运行因此,从字面上看,这与将测试重新运行回我的环境有关。我很想了解更多关于如果Circle在使用 saucelab浏览器运行测试的情况下源ip范围的信息。

NOTE: I actually was able to just take the testcafe "example.js" test, and get it to run using circle/saucelabs. So this literally has something to do with just running the tests back towards my environment. I'd love to learn more about what the "source ip range" would be if circle is running tests "using" saucelab browsers.

任何建议将不胜感激!

Any advice would be greatly appreciated!

(只是很难弄清楚如何调试/分类问题)

(just having a very hard time trying to figure out how to debug/triage the issue)

推荐答案

为使SauceLabs能够运行在CircleCI容器中运行的应用程序,您需要使用 Sauce的连接隧道,因为在CircleCI容器中运行的服务无法通过互联网访问。

For SauceLabs to exercise an application running within CircleCI containers, you will need to use Sauce's Connect Tunnel since services running inside a CircleCI container are not internet accessible.

CircleCI和SauceLabs合作创建了可简化隧道设置的 orb 。我不熟悉TestCafe,但是它应该可以解决连接问题。

CircleCI and SauceLabs partnered to create an "orb" that simplifies the setup of a tunnel. I'm not familiar with TestCafe, but it should solve the connectivity issues.

您可以在CircleCI中看到一个SauceLabs示例(尽管使用Maven / Java),< a href = https://github.com/eddiewebb/demo-blueskygreenbuilds/blob/master/.circleci/config.yml#L17 rel = nofollow noreferrer> https://github.com/eddiewebb/demo- blueskygreenbuilds / blob / master / .circleci / config.yml#L17 ,但基本上是

You can see an example of SauceLabs (though using Maven/Java) in CircleCI here, https://github.com/eddiewebb/demo-blueskygreenbuilds/blob/master/.circleci/config.yml#L17, but basically

  - saucelabs/with_proxy:
      name: "Chrome Tests"
      requires:
        - "Unit Test"
      tunnel_identifier: chrome
      steps:
        - maven/with_cache:
            steps:
              - run: ./mvnw verify -B -Dspring.profiles.active=it -Dsauce.tunnel="chrome" 

这篇关于TestCafe,CircleCI 2.0及更高版本SauceLabs-无法使此组合正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆