Run as Cucumber Feature not showing the snippets in the console - cucumber

I just want to run the feature file alone(without step definition and runner class) to create the snippets in the console output, so that I can use the same in the step definition class.
While running my feature file as Cucumber Feature, it's not showing anything in the console.

Related

Import Cucumber results to Jira/Xray

I am able to run the Cucumber/groovy (with maven/pom.xml) test locally. I'm trying to import the test results (results.jon) generated by cucumber to Jira with Xray.
I'm unable to find the steps or procedures required for this. The only source found: https://confluence.xpand-it.com/display/public/XRAY/Import+Execution+Results
but not applicable to my project. There is no CICD yet at the moment. Is there any way to generate results/reports imported to Jira every time I run a test/multiple tests?
For Gherkin-based frameworks, such as Cucumber, you can't simply submit the results. This is because Xray needs to have the Gherkin phrases, which cannot be inferred from the results file.
So you need to choose one of the possible cucumber flows. You need to either choose Xray as the master for the edition of Cucumber scenarios, or you need to use Git/SVN for that and then synch them to Xray.
These steps are detailed in the previous link.
You can see some useful tutorials here.
There are some cucumber specific tutorials, such as this one, but they're not fully detailed. You can see a more technically detailed tutorial for Serenity BDD that make those steps more visible, for the two different flows (you'll need then to adapt it to cucumber specifics, but the principles are the same).

Custom Plugin for hawtio 2.x

I am trying to write a custom plugin for hawtio 2.x.
The first step that I tried building the entire project (https://github.com/hawtio/hawtio) as instructed in https://github.com/hawtio/hawtio/blob/master/BUILDING.md
Later, I tried the example (springboot sample) located at https://github.com/hawtio/hawtio/tree/master/examples/springboot
The example seems to run fine, except for the fact that I do not see a trace of the sample plugin written in this application (https://github.com/hawtio/hawtio/blob/master/examples/springboot/src/main/webapp/app/sample-plugin/js/sample-plugin.js)
Right now, I am not trying to do fancy stuffs. I am simply trying to run this sample application and see how the plugin works.
Below is the screenshot of the web console. I have also checked in the browser console. I do not see any traces of the initialization of this plugin.
Am I missing something specific?

Single *.feature or Scenario in *.feature fails with NoClassDefFoundError in serenity-cucumber-archetype

I'm using serenity-cucumber-archetype project and run it in different ways (in pom I specified firefox as webdriver.driver and in serenity.properties -> chrome as webdriver.driver):
1. using test runner, which successfully runs the tests in Chrome
#RunWith(CucumberWithSerenity.class)
#CucumberOptions(features="src/test/resources/features/consult_dictionary/LookupADefinition.feature")
public class DefinitionTestSuite {}
using mvn site, which successfully runs the tests in Firefox
BUT, when I run separately *.feature file or single Scenario from *.feature file I get exception in run log:
Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/formatter/Formatter
Please advise, how to fix it and to make it possible to run single Scenario or single *.feature file
If you are using IntelliJ and Cucumber v2.x:
You might need to upgrade IntelliJ, and/or the Cucumber-for-Java plugin.
If that doesn't work, try uninstalling/installing the plugin.
Bachground:
There are changed to the Cucumber event model as of Cucumber v2.x and the Cucumber-for-Java plugin has been updated for those.

how to access steps available in other cucumber project in current cucumber project

Please help me understand accessing steps available in other cucumber projects in current cucumber project.
i have tried glue option as well and i also have added other cucumber project jar file in maven dependencies but could not make it work.
Below is the feature file of project1:
Feature: To test cucumber test is running
I want to run a sample feature file.
Scenario: cucumber setup
Given sample feature file is ready1
When I run the feature file1
Then run should be successful1
Scenario: cucumber setup for cucmbertestautomation2
Given sample feature file is ready2
When I run the feature file2
Then run should be successful2
"Given sample feature file is ready2" step is available in project2.
and project1 (cucumbertestautomation1) POM have project2(cucumbertestautomation2) as dependency:
com.celcom
cucumbertestautomation2
0.0.1-SNAPSHOT
Still the step "Given sample feature file is ready2" is not recognized which is there in the project2 (cucumbertestautomation2) which is added as dependency.
The steps Cucumber will search for just live in a package, or a sub-package from the runner.
If you have steps from somewhere else, added as a dependency through a jar or similar, then these steps will be found.
They way to re-use steps is therefore to package the steps in a jar and add that jar as a dependency. You can use Maven for creating the jar.
Cucumber only knows how to read and execute your feature files because of the step definition files usually defined with in a steps directory and called something like step_definitions.rb That is where your feature statements are captured by regular expressions and translated to Ruby code.
My suggestion would be to include the step definitions from Project 2 into your steps directory in Project 1.

Run jenkins groovy postbuild plugin functions in build stage

The Groovy Postbuild Plugin has methods for adding badges and labels to the builds, but as the name suggests this can only be run after the main build stage.
Is it possible to get access to the methods provided by the plug-in such as addShortText from within a plain groovy command executed in Jenkins (Add build step - Execute Groovy Script)?
I want to show these labels from the start of the build process, as they are known from the parameters passed when triggering the build. This makes tracking the specific build which is currently being executed easier.
It's possible, it's called Groovy plugin
There is also another very useful plugin called Any Step plugin, that allows to use publishers as build steps, and build steps as post-build actions

Resources