黄瓜可以找到特征文件,但不能生成辅助方法 - 使用groovy和geb

时间:2015-10-09 04:09:04

标签: groovy cucumber bdd geb

我正在尝试设置我想要的BDD框架:

  • 我的页面文件(geb页面)在src / main / groovy
  • src / test / resources
  • 中的功能文件
  • src / test / groovy
  • 中的步骤定义文件

我正在使用this gradle-cucumber-plugin

问题:黄瓜任务能够定位要素文件,但不会在groovy中生成帮助方法。不确定我错过了什么,请帮忙...

click here to see project-setup

 plugins { id "com.github.samueltbrown.cucumber" version "0.9" }
 group 'com.orbitz.cucumber'
 version '1.0'
 apply plugin: 'java'
 apply plugin: 'groovy'
 apply plugin: 'idea'
 def gebVersion = "0.9.2"
 def seleniumVersion = '2.46.0'
 def driver = "firefox"
 def cucumberJvmVersion = '1.2.2'
 sourceCompatibility = 1.7
 repositories { mavenCentral()  }
 dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.3.11'
    compile "org.gebish:geb-junit4:$gebVersion"
    compile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
    testCompile "info.cukes:cucumber-core:$cucumberJvmVersion"
    testCompile "info.cukes:cucumber-groovy:$cucumberJvmVersion"
 }
 cucumber {
    formats = [
            'pretty', 
            'html:build/reports/cucumber', 
            'junit:build/cucumber.xml'
    ]
    featureDirs = ['src/test/resources/orb/wl/pages/']
    glueDirs = ['src/test/groovy/orb/wl/pages/']
    dryRun = false
    monochrome = false
    strict = false
 }
$ ./gradlew cucumber
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:cucumber
@search
Feature: Searching orbitz website

  Given I go to orbitz hotels page
  When I search hotels in "Chicago, IL" from "12/01/2015" to "12/02/2015"
  Then I should see chicago hotels

0 Scenarios
0 Steps
0m0.000s

BUILD SUCCESSFUL

0 个答案:

没有答案