Links to Jira in Cucumber feature files

1,053 views
Skip to first unread message

Ilko Iliev

unread,
Aug 19, 2015, 4:39:26 AM8/19/15
to Serenity BDD Users Group
Hi,

I'm trying to get links to Jira using the integration with cucumber. If I use this sample feature file:

Feature: Jira test me

@issue: Jira-IssueNr

Scenario: Fist scenario
Given I'm the boss
When I run it
Then I should see the link

I'm getting wrong syntax exception, as shown below. In general it works, if I'm using only JUnit and the (#Jira-IssueNr) syntax in the Title. How is it supposed to work with Cucumber? I've tried to use the same syntax as with JUnit putting (#...) in the feature, but this does not work.

TIA,
Ilko

cucumber.runtime.CucumberException: Error parsing feature file features/jira_test.feature
    at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133)
    at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
    at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235)
    at cucumber.api.junit.Cucumber.<init>(Cucumber.java:60)
    at net.serenitybdd.cucumber.CucumberWithSerenity.<init>(CucumberWithSerenity.java:26)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: gherkin.lexer.LexingError: Lexing error on line 3: '@issue: Jira-IssueNr

Scenario: Fist scenario
Given I'm the boss
When I run it
Then I should see the link
%_FEATURE_END_%'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.
    at gherkin.lexer.En.scan(En.java:872)
    at gherkin.lexer.I18nLexer.scan(I18nLexer.java:36)
    at gherkin.parser.Parser.parse(Parser.java:62)
    at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:131)
    at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
    at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235)
    at cucumber.api.junit.Cucumber.<init>(Cucumber.java:60)
    at net.serenitybdd.cucumber.CucumberWithSerenity.<init>(CucumberWithSerenity.java:26)

Ilko Iliev

unread,
Aug 24, 2015, 5:14:21 AM8/24/15
to Serenity BDD Users Group
OK,

I figured it out - the extra space caused the parser to think this is a name - value tag. Now I can see the tag Issues on the report linked to the tests, however I don't have link to the Jira. I'm passing jira.url property correctly. Do I need for this simple integration (only linking) the jira integration plugin installed as dependency?

I'm using the latest versions of serenity-bdd (1.1.5) and serenity-cucumber (1.1.1)

According to a post here this should work, however the Jira integration topic in the serenity reference manual[1] is empty.

[1] http://thucydides.info/docs/serenity-staging/#_integrating_with_jira

TIA,
Ilko
Reply all
Reply to author
Forward
0 new messages