Uploaded image for project: 'Xray for Jira'
  1. Xray for Jira
  2. XRAY-2430

As system, whenever importing Cucumber feature files Tests shall be found by the feature filename and and "id:" tag

    XporterXMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • None
    • R3.1.0
    • None
    • None
    • R3.1.0 S2
    • OK

    Description

      In order to support the workflow where users prefer to edit and maintain the Cucumber .features and related scenarios in the SCVS  (e.g. git, svn), Xray must be able to uniquely identify the scenarios/scenario outlines whenever importing the .feature files

      For this, whenever importing Cucumber features, Xray will try to find existing Tests issues using the following rule:

      • Test having the labels corresponding to the relative path of the feature file (e.g. "core/sample_addition.feature") and the one corresponding to an unique id in the context of the feature file (e.g. "id:xxx", where xxx is a number).
      • Test having the label corresponding to the relative path of the feature file (e.g. "core/sample_addition.feature") and the same summary

      Whenever importing Cucumber features, Xray will try to find existing Pre-Conditions issues using the following rule:

      • Pre-Condition having the label corresponding to the relative path of the feature file (e.g. "core/sample_addition.feature") 

       

      The following rules always take into account the project identified by the "projectKey" prameter".

       

      After this feature is implemented, the rule whenever importing cucumber features will be:

      1. try to find the Test by key (in that project), if found then update it; else...
      2. try to find the Test, +in that projec+t, having:
        1. a label with the original relative path of .feature (e.g. "core/sample_addition.feature)
        2. a label named "id:xxx", where xxx is some number (e.g. "id:1", "id:32"); this label comes from a scenario/scenario outline's tag
        3. No other label named *.feature
      1. try to find the Test, in that project,  having
        1. a label with the original relative path of .feature (e.g. "core/sample_addition.feature)
        2. the same summary
        3. No other label named *.feature
      2. try to find the Test, in that project, having:
        1. The same summary (in that project)
        2. No label named *.feature, except the one corresponding to the Cucumber file being imported
      3. create Test in that project and add a label with the relative path of the feature, and another label corresponding to a tag "id:xxx" (if it exists)

       

      1. try to find the Pre-Condition by key (in that project), if found then update it; else...
      2. try to find the Pre-Condition (in that project)  having both
        1. a label with the original relative path of .feature (e.g. "core/sample_addition.feature)
        2. No other label named *.feature
      3. try to find the Pre-Condition (in that project)  having:
        1. The same summary (in that project)
        2. No label named *.feature, except the one corresponding to the Cucumber file being imported
      4. create Pre-Condition in that project and add a label with the relative path of the feature

       

      Example of sample_additon.feature

      @REQ_CALC-1910
      Feature: As a user, I can calculate the sum of two numbers
      
      Background:
        Given I have a calculator
        And I have some fingers
      
      
      @id:1 @fast
      Scenario Outline: Cucumber Test As a user, I can calculate the sum of two positive numbers
        Given I have entered <input_1> into the calculator
        And I have entered <input_2> into the calculator
        When I press <button>
        Then the result should be <output> on the screen
      
      Examples:
      | input_1 | input_2 | button | output |
      | 20 | 30 | add | 50 |
      | 2 | 5 | add | 7 |
      | 0 | 40 | add | 40 | 
      | 4 | 50 | add | 54 | 
      | 5 | 50 | add | 55 | 
      
      @core @id:2
      Scenario Outline: Cucumber Test As a user, I can calculate the sum of two negastive numbers
        Given I have entered <input_1> into the calculator
        And I have entered <input_2> into the calculator
        When I press <button>
        Then the result should be <output> on the screen
      
      Examples:
      | input_1 | input_2 | button | output |
      | -20 | -30 | add | -50 |
      | -2 | -5 | add | -7 |
      | 0 | -40 | add | -40 | 
      | -4 | -50 | add | -54 | 
      | -5 | -50 | add | -55 |

       

      Attachments

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              nmps nmps
              smsf Sergio Freire
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 3 days Original Estimate - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 6 hours
                  4d 6h