Skip to content

Plugin unable to find Step Definitions written in Groovy #172

Open
@pranasblk

Description

@pranasblk

After opening existing project created in IntelliJ (Groovy based) with the current plug-in I can see large number of warnings about "
No definition found for <fragment of regexp>" the step defs in our case defined in
src/integrationTest/groovy.

Some ideas how we can guide plug-in to look into the specific directory?

build.gradle fragments:

sourceSets {
  main {
    java {
      srcDir 'src/main/binding'
    }
  }
  integrationTest {
    groovy {
      compileClasspath += main.output + test.output
      runtimeClasspath += main.output + test.output
    }
    java {
      compileClasspath += main.output + test.output
      runtimeClasspath += main.output + test.output
    }
  }
}

configurations {
  integrationTest
  integrationTestCompile.extendsFrom testCompile
  integrationTestRuntime.extendsFrom testRuntime
}

...

dependencies {

 // ...

  // Logging
  compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
  runtime group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.3'
  runtime group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.3'
  runtime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.3'

  // Groovy support
  compile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.4'

  // Integration testing framework Cucumber JVM
  integrationTestCompile(
    [group: 'info.cukes', name: 'cucumber-groovy', version: '1.2.4'],
    [group: 'info.cukes', name: 'cucumber-core', version: '1.2.4'],
    [group: 'info.cukes', name: 'cucumber-junit', version: '1.2.4']
  )

  // JUnit and mocking
  testCompile group: 'org.jmockit', name: 'jmockit', version: '1.18'
  testCompile group: 'junit', name: 'junit', version: '4.12'
}

// Required for Intellij to pick up our custom integration test configuration
idea {
  module {
    testSourceDirs += sourceSets.integrationTest.allSource.getSrcDirs()
    scopes.TEST.plus += [configurations.integrationTestCompile]
  }
}
...
eclipse {
  classpath {
    plusConfigurations += [configurations.integrationTestCompile]
...
  }
}
...
task integTest(type: Test) {
  testClassesDir = sourceSets.integrationTest.output.classesDir
  classpath = sourceSets.integrationTest.runtimeClasspath
  systemProperty 'cucumber.options', '--plugin json:build/test-results/cucumber.json'
}

task integTestJar(type: Jar, dependsOn: integTest) {
  classifier = 'integTest'
  from sourceSets.integrationTest.output
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions