Codeception \ Extension \ RunProcess没有启动进程

时间:2017-07-12 06:10:44

标签: php yii2 codeception

问题:

昨天Codeception推出了新的扩展,它有助于启动/停止Selenium Server,Chrome驱动程序等(更多here)。然而,即使它表明流程正在开始 - 它们实际上并非如此。

acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: http://127.0.0.1:8080/
            browser: chrome
        - Yii2:
            part: orm
            entryScript: index-test.php
            cleanup: false
extensions:
    enabled:
        - Codeception\Extension\RunProcess:
            - java -jar /home/tajgeer/.executables/bin/selenium-server.jar
            - php /home/tajgeer/Repozytoria/Yii2/yii serve

输出:

Acceptance Tests (5)

  [RunProcess] Starting java -jar /home/tajgeer/.executables/bin/selenium-server.jar
  [RunProcess] Starting php /home/tajgeer/Repozytoria/Yii2/yii serve

E AboutCest: Ensure that about works 
E ContactCest: Ensure that contact page works 
E ContactCest: Contact form can be submitted 
E HomeCest: Ensure that home page works 
E LoginCest: Ensure that login works 

  [RunProcess] Stopping php /home/tajgeer/Repozytoria/Yii2/yii serve
  [RunProcess] Stopping java -jar /home/tajgeer/.executables/bin/selenium-server.jar

示例错误:

[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.

我已经尝试为两位高管设置o + x权限 - 没有改变任何东西。当我尝试使用输入的命令运行这两个工具时 - 一切运行良好。

有人能指出我做错了什么吗?

1 个答案:

答案 0 :(得分:0)

<强> SOLUTION:

其实......我已经自己解决了。我已经忘记了sleep(由于测试速度很快,进程甚至没有机会运行)。我已将acceptance.suite.xml更改为以下内容:

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: http://127.0.0.1:8080/
            browser: chrome
        - Yii2:
            part: orm
            entryScript: index-test.php
            cleanup: false
extensions:
    enabled:
        - Codeception\Extension\RunProcess:
            0: java -jar /home/tajgeer/.executables/bin/selenium-server.jar
            1: php /home/tajgeer/Repozytoria/Yii2/yii serve
            sleep: 5