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

9
我正在使用Travis-CI运行Sauce Connect来运行Behat测试。 如果我告诉Sauce使用Windows 7上的Firefox 26,那么一切都正常。 但是如果我更改浏览器为Internet Explorer(Sauce Labs在Windows 7上提供的三个版本之一,即IE8,IE9和IE10),则它不起作用。
Sauce显示IE浏览器测试的页面上,显示了一个长视频,其中除了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

我发现在Sauce Labs支持文档中有一篇文章提到,这可能是由于非常规端口引起的问题,但我正在443端口上通过HTTPS运行我的应用程序,所以这似乎不是问题所在。
以下是我运行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中遇到了相同的问题。 我不确定接下来该去哪里或该做什么。我的下一步应该是什么?

似乎端口443应该可以工作,但我想知道你在非SSL端口(如8000)上是否看到了相同的行为?更改应用程序端口并进行检查是否容易? - Jonathan Lipps
尝试使用SSL端口8000,结果相同:https://saucelabs.com/tests/674fb14952724a4e88cc1b24084afa32 在Firefox中可以工作,但在IE中无法工作。也可以尝试在端口8000上使用HTTP而不是HTTPS,但这种更改涉及的内容更多... - Trott
2个回答

2

我曾经在使用sauce labs时遇到了与Internet Explorer有关的问题。 我正在发送一个POST / session请求以请求新会话,并期望返回描述会话能力的对象,根据Json wire protocol规定。 但是,除了标题之外,什么都没有被发送回来:

                                                              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 动态消息中https://twitter.com/sauceops看起来他们遇到了重定向循环的问题。


1

我通过更改以下内容解决了这个问题:

base_url: https://localhost

base_url: https://realhostname

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

此主机名是使用hosts插件在.travis.yml文件中设置的。

addons:
  hosts:
    - realhostname

我认为这与通过Sauce Connect对本地主机进行的额外代理有关,该内容在以下链接底部提到:https://saucelabs.com/docs/connect 我不知道为什么只影响IE,但这个解决方案似乎有效。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接