{"id":20692,"date":"2017-09-11T03:21:54","date_gmt":"2017-09-11T03:21:54","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=20692"},"modified":"2024-12-14T16:43:21","modified_gmt":"2024-12-14T16:43:21","slug":"how-to-run-a-single-story-in-jbehave-project","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-run-a-single-story-in-jbehave-project\/","title":{"rendered":"How to run a single story in JBehave project?"},"content":{"rendered":"<h2>How to run a single story in JBehave project?<\/h2>\n<p>In this tutorial, we will learn how to run a single story in a JBehave project. There are multiple ways to run a story in a JBehave project.<\/p>\n<h3>Add Story<\/h3>\n<p>First things first, add the JBehave story to the project with Gherkin syntax.<\/p>\n<p>Write a simple JBehave story:<\/p>\n<p><a href=\"https:\/\/www.testingdocs.com\/writing-simple-jbehave-story\/\">https:\/\/www.testingdocs.com\/writing-simple-jbehave-story\/<\/a><\/p>\n<h3>Step definitions<\/h3>\n<p>Add Step definitions java code for the story if needed or use reusable step definitions.<\/p>\n<p><a href=\"https:\/\/www.testingdocs.com\/writing-step-class-for-a-jbehave-story\/\">https:\/\/www.testingdocs.com\/writing-step-class-for-a-jbehave-story\/<\/a><\/p>\n<p>In the story runner class define a filter for running a single class. We can pass this as command line parameter to the build tool.<\/p>\n<h3>Run a story<\/h3>\n<p>From command line we can specify the story filter to run a single story.<\/p>\n<p>Linux Terminal command<\/p>\n<p><strong>$ mvn clean install -DstoryFilter=&lt;story name&gt;<\/strong><\/p>\n<h3>Related<\/h3>\n<p>Running multiple stories in a JBehave project<\/p>\n<p><a href=\"https:\/\/www.testingdocs.com\/questions\/how-to-run-multiple-stories-in-jbehave-automation-project\/\">https:\/\/www.testingdocs.com\/questions\/how-to-run-multiple-stories-in-jbehave-automation-project\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>JBehave Tutorials<\/h3>\n<p>JBehave Tutorials on this website can be found at:<br \/>\n<strong><a href=\"https:\/\/www.testingdocs.com\/jbehave-framework-tutorial\/\">https:\/\/www.testingdocs.com\/jbehave-framework-tutorial\/<\/a><\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to run a single story in JBehave project? In this tutorial, we will learn how to run a single story in a JBehave project. There are multiple ways to run a story in a JBehave project. Add Story First things first, add the JBehave story to the project with Gherkin syntax. Write a simple [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[250],"tags":[],"class_list":["post-20692","post","type-post","status-publish","format-standard","hentry","category-jbehave","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/20692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=20692"}],"version-history":[{"count":12,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/20692\/revisions"}],"predecessor-version":[{"id":26478,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/20692\/revisions\/26478"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=20692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=20692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=20692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}