def add_result

      result_options = {
        name: complete_name,
        passed: !@current_scenario_error,
        data: {}
      }

      if @annotation && @feature_annotation # Annotation on current feature and current scenario
        @feature_annotation.merge!(@annotation)
        result_options[:annotation] = @feature_annotation
      elsif @annotation # Annotation only for current scenario
        result_options[:annotation] = @annotation
      elsif @feature_annotation # Annotation for the current feature
        result_options[:annotation] = @feature_annotation
      end

      @annotation = nil

      result_options[:duration] = ((Time.now - @current_scenario_start_time) * 1000).round

      # Combine the tags of the feature and of the scenario.
      result_options[:tags] = (@current_feature_tags + @current_scenario_tags).uniq.sort

      # The fingerprint identifying the test contains the first line of the
      # feature's and the scenario's descriptions joined with a separator.
      fingerprint_data = [ @current_feature, @current_scenario ]
      result_options[:fingerprint] = Digest::SHA1.hexdigest(fingerprint_data.join('|||'))
      result_options[:data][:fingerprint] = result_options[:fingerprint]

      # Build the message from the error's message and backtrace if an error occurred.
      result_options[:message] = failure_message @current_scenario_error if @current_scenario_error

      metadata = result_options[:data]

      # Add the file and line number to the metadata.
      if @current_scenario_file_colon_line && m = @current_scenario_file_colon_line.match(/^([^:]+):(\d+)$/)
        metadata['file.path'] = m[1].to_s
        metadata['file.line'] = m[2].to_i
      end

      @test_run.add_result(result_options)
    end
def add_result

      result_options = {
        name: complete_name,
        passed: !@current_scenario_error,
        data: {}
      }

      if @annotation && @feature_annotation # Annotation on current feature and current scenario
        @feature_annotation.merge!(@annotation)
        result_options[:annotation] = @feature_annotation
      elsif @annotation # Annotation only for current scenario
        result_options[:annotation] = @annotation
      elsif @feature_annotation # Annotation for the current feature
        result_options[:annotation] = @feature_annotation
      end

      @annotation = nil

      result_options[:duration] = ((Time.now - @current_scenario_start_time) * 1000).round

      # Combine the tags of the feature and of the scenario.
      result_options[:tags] = (@current_feature_tags + @current_scenario_tags).uniq.sort

      # The fingerprint identifying the test contains the first line of the
      # feature's and the scenario's descriptions joined with a separator.
      fingerprint_data = [ @current_feature, @current_scenario ]
      result_options[:fingerprint] = Digest::SHA1.hexdigest(fingerprint_data.join('|||'))
      result_options[:data][:fingerprint] = result_options[:fingerprint]

      # Build the message from the error's message and backtrace if an error occurred.
      result_options[:message] = failure_message @current_scenario_error if @current_scenario_error

      metadata = result_options[:data]

      # Add the file and line number to the metadata.
      if @current_scenario_file_colon_line && m = @current_scenario_file_colon_line.match(/^([^:]+):(\d+)$/)
        metadata['file.path'] = m[1].to_s
        metadata['file.line'] = m[2].to_i
      end

      @test_run.add_result(result_options)
    end
Adds a result to the test run.
 The test and result data was stored while the features and scenarios
 were being executed (see #before_feature, #tag_name, etc).