Travis-CI + Sauce Connect + Behat:无法让Internet Explorer运行测试

时间:2014-02-18 05:23:39

标签: internet-explorer automated-tests behat travis-ci saucelabs

我有运行Sauce Connect的Travis-CI来运行Behat测试。如果我告诉Sauce在Windows 7上使用Firefox 26,一切正常。但如果我将浏览器更改为Internet Explorer(Sauce Labs在Windows 7上提供的三个版本中的任何一个 - 即IE8,IE9和IE10 ),然后它不起作用。

the Sauce page that shows the IE browser test上,它会显示一条长视频,其中只显示除This is the initial start page for the WebDriver server.以外的内容。页面顶部显示的错误消息显示浏览器屏幕截图为:Test did not see a new command for 90 seconds. Timing out.但是,截屏时间超过13分钟,因此它至少会收到一些命令,即使它们从未对它们采取行动。

与此同时,在Travis方面,我看到了这一点:

2014-02-18 04:34:13,124 - Request started: GET http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab?f20efc77fc170e42
2014-02-18 04:34:13,211 - GET http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab?f20efc77fc170e42 -> 200 (88ms, 6356 bytes)
2014-02-18 04:34:13,417 - Request started: GET https://ieonline.microsoft.com/iedomainsuggestions/ie10/201402/suggestions.en-US
2014-02-18 04:34:13,503 - GET https://ieonline.microsoft.com/iedomainsuggestions/ie10/201402/suggestions.en-US -> 200 (87ms, 18176 bytes)
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

我确实发现an entry in the Sauce Labs support docs表示这可能是由非常规端口引起的,但我在端口443上通过HTTPS运行我的应用,所以这似乎不是问题。

这是我通过Sauce运行Internet Explorer 9的Behat YAML配置文件:

# Use this profile to run tests on Sauce against the Travis-CI instance
default:
    context:
        class: "FeatureContext"
    extensions:
        Behat\MinkExtension\Extension:
            base_url: https://localhost
            default_session: saucelabs
            javascript_session: saucelabs
            saucelabs:
                browser: "internet explorer"
                capabilities:
                    platform: "Windows 7"
                    version: 9

我正在运行Behat 2.5.2,尽管我遇到了与2.4.x相同的问题。

我不确定从哪里开始或者从这里做什么。我的下一步应该是什么?

2 个答案:

答案 0 :(得分:2)

我在使用带有saucelabs的Internet Explorer时遇到了同样的问题。我正在发送一个POST /会话来请求一个新的会话,并期待一个{object}一个对象,用于描述Json有线协议的会话功能。相反,除了标题之外没有发回任何内容:

                                                              Transfer-Encoding 
                                                                      "chunked" 
                                                                           Date 
                                                "Mon, 24 Feb 2014 15:19:06 GMT" 
                                                                   Content-Type 
                                                                    "text/html" 
                                                                       Location 
"http://ondemand.saucelabs.com/wd/hub/session/865ae26f6b5c461c9a30f3d1454f486a" 
                                                                         Server 
                                                                 "monocle/0.26" 
                                                                         status 
                                                                          "302" 
                                                                  statusMessage 
                                                                        "Found" 

该位置包含会话ID,我可以从中继续我的会话。

来自Twitter Feed https://twitter.com/sauceops看起来他们正在使用带有重定向循环的探针

答案 1 :(得分:1)

我可以通过更改:

来解决这个问题
base_url: https://localhost

base_url: https://realhostname

在behat配置的Behat \ MinkExtension \ Extension:部分。

使用hosts addon

在.travis.yml文件中设置此主机名
addons:
  hosts:
    - realhostname

我认为这与通过本地主机的酱连接完成的额外代理有关,这在底部提到:https://saucelabs.com/docs/connect我不知道为什么这只影响IE,但这个解决方案似乎有用。 / p>