首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Vagrant上设置Sahi,Behat & PhantomJS

在Vagrant上设置Sahi,Behat & PhantomJS
EN

Stack Overflow用户
提问于 2015-01-08 00:12:28
回答 2查看 617关注 0票数 1

我正试图在我的流浪机器上设置PhantomJS,Behat和Sahi的自动化测试。

在尝试使用behat运行测试时,我得到了以下输出:

代码语言:javascript
复制
[Behat\SahiClient\Exception\ConnectionException]                                       
  Exception has been thrown in "afterStep" hook, defined in FeatureContext::afterStep()  
  Connection time limit reached

这是我的userdata.properties:

代码语言:javascript
复制
# dirs. Relative paths are relative to userdata dir. Separate directories with semi-colon
scripts.dir=scripts;
# default log directory.
logs.dir=logs
# Directory where auto generated ssl cerificates are stored
certs.dir=certs

# Use external proxy server for http
ext.http.proxy.enable=false
ext.http.proxy.host=
ext.http.proxy.port=
ext.http.proxy.auth.enable=false
ext.http.proxy.auth.name=kamlesh
ext.http.proxy.auth.password=password

# Use external proxy server for https
ext.https.proxy.enable=false
ext.https.proxy.host=
ext.https.proxy.port=
ext.https.proxy.auth.enable=false
ext.https.proxy.auth.name=kamlesh
ext.https.proxy.auth.password=password

# There is only one bypass list for both secure and insecure.
ext.http.both.proxy.bypass_hosts=localhost|127.0.0.1|*.internaldomain.com

# Mark this property true to disable the proxy alert
proxy_alert.disabled=false

和我的browswer_types.xml:

代码语言:javascript
复制
<browserTypes>
    <browserType>
            <name>phantomjs</name>
            <displayName>PhantomJS</displayName>
             <icon>safari.png</icon>
            <path>/usr/bin/phantomjs</path>
            <options>--ignore-ssl-errors=yes --proxy=localhost:9999 --ssl-protocol=any /usr/local/sahi/phantomjs-sahi.js</options>
            <processName>phantomjs</processName>
            <capacity>100</capacity>
            <force>true</force>
    </browserType>
</browserTypes>

behat.yml:

代码语言:javascript
复制
default:
  extensions:
    Behat\MinkExtension\Extension:
      javascript_session: sahi
      browser_name: phantomjs
      goutte: ~
      sahi:
        host: localhost
        port: 9999

Sahi运行输出:

代码语言:javascript
复制
--------
SAHI_HOME: ..
SAHI_USERDATA_DIR: ../userdata
SAHI_EXT_CLASS_PATH:
--------
Sahi properties file = /usr/local/sahi/config/sahi.properties
Sahi user properties file = /usr/local/sahi/userdata/config/userdata.properties
Added shutdown hook.
>>>> Sahi OS v5.0 started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
-----
Reading browser types from: /usr/local/sahi/userdata/config/browser_types.xml
-----

我试着重装了一大堆东西,试着摆弄端口、进程、代理设置,什么都没有。

EN

回答 2

Stack Overflow用户

发布于 2015-03-29 23:26:15

你的流浪汉有一个空的或没有的数据库。因此,当您尝试连接到您的应用程序时,例如以某个已知用户登录,它将崩溃,因为它找不到它!

万事如意;)

票数 0
EN

Stack Overflow用户

发布于 2015-04-06 23:44:42

从BrowserType 4.3.2版开始更改设置。因为没有标签力。请查收。

https://sahipro.com/docs/using-sahi/sahi-headless-execution-with-phantomjs.html#Documentation since Sahi Pro V4.3.2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27823656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档