Search code examples
cucumbercucumber-jvmcucumberjs

Cucumber: is it possible to read .feature files from a remote location?


I know about specifying a local path to feature files (eg @CucumberOptions(features = "<feature_path>") in Java), but is it possible to read feature files from a remote location, ie from Github?

Motivation: I have several API client libraries in different languages that need to adhere to the same set of core specs. I'm using Cucumber feature files as a language-agnostic base for the specs, then writing step definitions for each library. Seems silly to duplicate the feature files for each project, but so far I haven't been able to find out how to read them from a remote location.

For example, setting @CucumberOptions(features = "https://github.com/<repo_path>/features") produces the following error:

Tests in error:
  initializationError(com.<package_name>.feature.RunCukesTest): 
    Not a file or directory: /<local_path>/https://github.com/<repo_path>/features

Note I used Java as an example but I'd love to hear the answer for any of Java/PHP/Ruby/Javascript.

Quite new to Cucumber so please forgive me if this is an obtuse question.


Solution

  • As far as I know, you can't specify a remote location to read feature files from. I imagine a remote location being something you find through a network and not the file system.

    You can speciy the path to the feature files and thus use the same feature files for many cases. But that requires you to always keep the code in locations relative to each other. One way of to do this is to use a a so called mono repo. That is one repository for all your implementations. Mono repos are used by some teams with sucess. The Cucumber team is moving in that direction to make it easier to keep common things in synch. All Gherkin implementations, independant of the implementation language, lives in a mono repo.