title: Reusing common step definitions between two feature files in cucumber (java)
body: <p>I want to know(if possible) -how to reuse step definitions related to few or all steps of a scenario from one feature file to another another?
  For Example- 
  in my Feature file-1 :I have below scenario/steps:</p>
  
  <p>Scenario Outline: Create a new property by entering mandatory fields</p>
  
  <pre><code>Given As an user I Log in to application and go to property Tab
  And I create a new Property from main Menu by entering details in mandatory fields- FloorName as FName, Type..etc so mant columns..
  </code></pre>
  
  <p>Step definition for create property is-</p>
  
  <pre><code>@And ("^I Create a new Property from main Menu by entering details in mandatory fields FloorName as ([^\"]*), Type..so on."$)
  public void createNewProperty(String floorName,String propType...){
  //code for all data entry part
  }
  </code></pre>
  
  <p>And in my Feature file 2: I have to reuse 2nd step from above based on a condition (i.e. if there is no record exist then create new one)</p>
  
  <p>Scenario Outline: Create a new space on property</p>
  
  <pre><code>Given As an user I Log in to application and go to Space Tab
  Then I navigate to Property Details tab 
  And Make sure there is at least one active listing available if not-add new 
  </code></pre>
  
  <p>below is my step definition for this-</p>
  
  <pre><code>@And("^Make sure there is at least one active listing available if not- add new$")
      public void CheckOrCreateAnActiveListing() throws Throwable {
          //Check if active record is present else create one
          logger.info(" Verify if search has returned some matching results");
          int iRecords= leasePage.chkRowsCountOnActiveListApplet();
          if (iRecords&gt;0) {
             logger.info(" Applet has enough active record(s) to proceed ");
          } else {
              logger.info(" Applet has no active record(s) to proceed, hence creating one ");
  
              //TBD *****
          }
  
      }
  </code></pre>
  
  <p>Here I have to reuse stuff in TBD block from Feature-1</p>