Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Feature: Added ability to use Allure TMS / ISSUE / SEVERITY labels #40

Merged
merged 1 commit into from Jun 21, 2016
Merged

Conversation

azohra
Copy link
Contributor

@azohra azohra commented May 18, 2016

Hi,

The user can now set the config block to indicate a prefix for TMS, ISSUE, and SEVERITY labels. allure-cucumber will now read all of the cucumber tags before a scenario and if it finds a match, it will be included / displayed in the report.

AllureCucumber.configure do |c|
  c.output_dir      = 'report/allure-results/'
  c.tms_prefix      = '@HIPTEST:'
  c.issue_prefix    = '@JIRA:'
  c.severity_prefix = '@SEVERITY:'
end  

Example in use:

  @SEVERITY:trivial @JIRA:YZZ-100
  Scenario: Leave First Name Blank
    When I register an account without a first name
    Then exactly (1) [validation_error] should be visible

  @JIRA:CC-42 @HIPTEST:9901 @SEVERITY:critical
  Scenario: Leave Last Name Blank
    When I register an account without a last name
    Then exactly (1) [validation_error] should be visible

If the user does not provide any configuration, then allure-cucumber will use the following defaults

module AllureCucumber

  module Config
    class << self
      attr_accessor :output_dir, :tms_prefix, :issue_prefix, :severity_prefix

      DEFAULT_OUTPUT_DIR      = 'gen/allure-results'
      DEFAULT_TMS_PREFIX      = '@TMS:'
      DEFAULT_ISSUE_PREFIX    = '@ISSUE:'
      DEFAULT_SEVERITY_PREFIX = '@SEVERITY:'

      def output_dir
        @output_dir || DEFAULT_OUTPUT_DIR
      end

      def tms_prefix
        @tms_prefix || DEFAULT_TMS_PREFIX
      end

      def issue_prefix
        @issue_prefix || DEFAULT_ISSUE_PREFIX
      end

      def severity_prefix
        @severity_prefix || DEFAULT_SEVERITY_PREFIX
      end

    end
  end

Note, i marked this WIP as the PR is more of a proof of concept. The code works, but its ugly and not scalable.

@azohra azohra changed the title Feature: Added ability to TMS / ISSUE / SEVERITY tags per scenario (WIP) Feature: Added ability to use Allure TMS / ISSUE / SEVERITY labels (WIP) May 19, 2016
@azohra
Copy link
Contributor Author

azohra commented May 19, 2016

@9ikhan - FYI, would really appreciate your help cleaning up these PRs and getting these new features out.

@9ikhan
Copy link
Contributor

9ikhan commented May 19, 2016

I'll merge all these PRs in a separate branch to run some tests. If, all good then I'll release a new version this week.

@CoHuK
Copy link

CoHuK commented Jun 3, 2016

Any progress on it?

@9ikhan
Copy link
Contributor

9ikhan commented Jun 3, 2016

There are too many changes and no test cases. So, I'm writing test cases for it which is taking time. I plan to finish this by this weekend. I'll appreciate if you can share existing cucumber test suites to check this.

@azohra
Copy link
Contributor Author

azohra commented Jun 3, 2016

Hey @9ikhan, My other PR's are much smaller, cleaner, and ready to go. Perhaps we can get those merged and then focus on this.

I am not fully confident in this code because I only had time to test it with scenarios, I think it will be ok -- but I did not test with scenario outlines & backgrounds. My goal was to get people excited / engaged and let everyone know this is a solvable problem. I think we should take some time to see how we can improve the implementation and ensure it is fully tested.

@9ikhan
Copy link
Contributor

9ikhan commented Jun 5, 2016

Hi @tk8817, All the tests are passing on this branch but, the test suite is incomplete so, I need to write more tests. Couple of points though:

  • ALLOWED_TAGS is not used anywhere.
  • trim_tag method can be renamed as remove_tag_prefix and it can be made private.

@smecsia - Do you have any thoughts on this?

@azohra
Copy link
Contributor Author

azohra commented Jun 5, 2016

Hey @9ikhan,

  1. Agreed ALLOWED_TAGS is not used , I left it in as reference while working on the PR, we can remove it.
  2. Agreed let's rename trim_tag and make it private.

Will make an update shortly. Appreciate you working on this.

@azohra
Copy link
Contributor Author

azohra commented Jun 5, 2016

Updates made. There are merge conflicts I believe because the status update PR has been merged - those changes are in the same file - you will need to fix those manually.

@CoHuK
Copy link

CoHuK commented Jun 14, 2016

Guys let's finish with it finally :)
Just one merge left.

@azohra
Copy link
Contributor Author

azohra commented Jun 14, 2016

@9ikhan I have resolved the merge conflicts for you as well (re-based off of allure-cucumber master). Please let me know the latest on your side.

@azohra
Copy link
Contributor Author

azohra commented Jun 14, 2016

@CoHuK if you want all of these features right now, you can use my teams fork

@9ikhan
Copy link
Contributor

9ikhan commented Jun 20, 2016

Hi @tk8817 - Can you resolve the merge conflicts? I'll release it.

re-base on master

clear scenario_tags hash at the end of each test

Requested updates
@azohra
Copy link
Contributor Author

azohra commented Jun 20, 2016

@9ikhan fixed, squashed, and pushed :) enjoy.

@azohra azohra changed the title Feature: Added ability to use Allure TMS / ISSUE / SEVERITY labels (WIP) Feature: Added ability to use Allure TMS / ISSUE / SEVERITY labels Jun 20, 2016
@9ikhan 9ikhan merged commit 62812a9 into allure-framework:master Jun 21, 2016
@9ikhan
Copy link
Contributor

9ikhan commented Jun 21, 2016

Released 0.5.4.

@tk8817 - Can you please update the README?

@azohra
Copy link
Contributor Author

azohra commented Jun 21, 2016

@9ikhan will do that today. Woop woop!

@azohra azohra deleted the feature_test_tags branch June 21, 2016 14:10
@kkatiukha
Copy link

Yeah!!!!!! Was waiting for this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants