从Jenkins运行Behat测试

时间:2015-08-19 13:28:54

标签: php jenkins behat

我试图从Jenkins运行一些Behat(3.0.15)测试,但Behat正在提出一些失败的步骤。

例如,对于此步骤:

And I should click the header "Cómo Funciona" link

错误:

And I should click the header "C??mo funciona" link # test_behavior/Resources/features/Web/StaticPages/como_funciona.feature:9
     [exec]       "clickCMoFuncionaLink" method is not available on the Header (BadMethodCallException)

我们的build.xml

<target name="behat">
    <exec executable="vendor/bin/behat" failonerror="true">
        <arg value="--tags=~@skip"/>
        <arg value="--profile=jenkins"/>
        <arg value="--format=progress"/>
    </exec>
</target>

我们的behat.yml

default:
  suites:
    default:
      paths: [%paths.base%/test_behavior/Resources/features/Web]
      contexts:
        - TestBehavior\Context\BaseContext
    service:
      paths: [%paths.base%/test_behavior/Resources/features/Services]
      contexts:
        - TestBehavior\Context\BaseContext
        - TestBehavior\Context\ServiceContext:
          - http://xxxx
    command:
      paths: [%paths.base%/test_behavior/Resources/features/Commands]
      contexts:
        - TestBehavior\Context\BaseContext:
          - false
        - TestBehavior\Context\CommandContext
  extensions:
    Behat\MinkExtension:
      base_url: http://xxxxx:8080
      browser_name: chrome
      selenium2:
        wd_host: 10.0.2.2:4444/wd/hub
      show_cmd: open -a Google\ Chrome %s
    SensioLabs\Behat\PageObjectExtension:
      namespaces:
        page: [TestBehavior\Object\Page]
        element: [TestBehavior\Object\Element]

jenkins:
  suites:
    default:
      env: integration
    service:
      env: integration
      contexts:
        - TestBehavior\Context\BaseContext:
          - false
        - TestBehavior\Context\ServiceContext:
          - http://xxxxxx
    command:
      env: integration
  extensions:
    Behat\MinkExtension:
      base_url: http://xxxxx
      selenium2:
        wd_host: 10.52.2.84:4444/wd/hub

本地一切正常

0 个答案:

没有答案