cucumber / cucumber-ruby

Cucumber for Ruby. It's amazing!
https://cucumber.io
MIT License
5.18k stars 1.12k forks source link

Attach method work incorrect for outline scenario in HTML reports #1610

Closed Rekadze closed 2 years ago

Rekadze commented 2 years ago
  1. Create outline scenario like
    Scenario Outline: Login
    When open login page
    And login as "<user type>"
    Then see dashboard page
    Examples:
      | user type |
      | admin     |
      | promoter  |
  2. In hooks make a hook with attach method like

    After do |scenario|
    screenshot_path =   File.join(Capybara.save_path, "#{scenario.name}.png")
    
    page.driver.browser.save_screenshot(screenshot_path)
    attach(screenshot_path, 'image/png')
    end
  3. Run tests
  4. Open HTML report

Expected: User should see screenshot attached as for regular scenarios Actual: Screenshot doesn't attached

UPD: Attach will be only for first scenario. Any next scenarios won't have any attaches In this screenshot failed scenarios should have ulr and screenshot attached as you can see for outline scenarios nothing is attached

2022-01-22 23-42-15

Gemfile

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (6.1.4.4)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    addressable (2.8.0)
      public_suffix (>= 2.0.2, < 5.0)
    autoload (0.3.0)
    aws-eventstream (1.2.0)
    aws-partitions (1.549.0)
    aws-sdk-core (3.125.5)
      aws-eventstream (~> 1, >= 1.0.2)
      aws-partitions (~> 1, >= 1.525.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-kms (1.53.0)
      aws-sdk-core (~> 3, >= 3.125.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.111.2)
      aws-sdk-core (~> 3, >= 3.125.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.4)
    aws-sigv4 (1.4.0)
      aws-eventstream (~> 1, >= 1.0.2)
    builder (3.2.4)
    capybara (3.36.0)
      addressable
      matrix
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (>= 1.5, < 3.0)
      xpath (~> 3.2)
    childprocess (4.1.0)
    coderay (1.1.3)
    concurrent-ruby (1.1.9)
    cucumber (7.1.0)
      builder (~> 3.2, >= 3.2.4)
      cucumber-core (~> 10.1, >= 10.1.0)
      cucumber-create-meta (~> 6.0, >= 6.0.1)
      cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
      cucumber-gherkin (~> 22.0, >= 22.0.0)
      cucumber-html-formatter (~> 17.0, >= 17.0.0)
      cucumber-messages (~> 17.1, >= 17.1.1)
      cucumber-wire (~> 6.2, >= 6.2.0)
      diff-lcs (~> 1.4, >= 1.4.4)
      mime-types (~> 3.3, >= 3.3.1)
      multi_test (~> 0.1, >= 0.1.2)
      sys-uname (~> 1.2, >= 1.2.2)
    cucumber-core (10.1.1)
      cucumber-gherkin (~> 22.0, >= 22.0.0)
      cucumber-messages (~> 17.1, >= 17.1.1)
      cucumber-tag-expressions (~> 4.1, >= 4.1.0)
    cucumber-create-meta (6.0.4)
      cucumber-messages (~> 17.1, >= 17.1.1)
      sys-uname (~> 1.2, >= 1.2.2)
    cucumber-cucumber-expressions (14.0.0)
    cucumber-gherkin (22.0.0)
      cucumber-messages (~> 17.1, >= 17.1.1)
    cucumber-html-formatter (17.0.0)
      cucumber-messages (~> 17.1, >= 17.1.0)
    cucumber-messages (17.1.1)
    cucumber-tag-expressions (4.1.0)
    cucumber-wire (6.2.1)
      cucumber-core (~> 10.1, >= 10.1.0)
      cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
    diff-lcs (1.5.0)
    faker (2.19.0)
      i18n (>= 1.6, < 2)
    faraday (2.1.0)
      faraday-net_http (~> 2.0)
      ruby2_keywords (>= 0.0.4)
    faraday-net_http (2.0.1)
    ffi (1.15.5)
    i18n (1.8.11)
      concurrent-ruby (~> 1.0)
    jmespath (1.5.0)
    knapsack (4.0.0)
      rake
    matrix (0.4.2)
    method_source (1.0.0)
    mime-types (3.4.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2022.0105)
    mini_mime (1.1.2)
    mini_portile2 (2.7.1)
    minitest (5.15.0)
    multi_test (0.1.2)
    nokogiri (1.13.1)
      mini_portile2 (~> 2.7.0)
      racc (~> 1.4)
    pry (0.14.1)
      coderay (~> 1.1)
      method_source (~> 1.0)
    public_suffix (4.0.6)
    racc (1.6.0)
    rack (2.2.3)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rake (13.0.6)
    regexp_parser (2.2.0)
    rexml (3.2.5)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-support (3.10.3)
    ruby2_keywords (0.0.5)
    rubyzip (2.3.2)
    selenium-webdriver (4.1.0)
      childprocess (>= 0.5, < 5.0)
      rexml (~> 3.2, >= 3.2.5)
      rubyzip (>= 1.2.2)
    site_prism (3.7.3)
      addressable (~> 2.6)
      capybara (~> 3.15)
      site_prism-all_there (>= 0.3.1, < 1.0)
    site_prism-all_there (0.3.2)
    sys-uname (1.2.2)
      ffi (~> 1.1)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.5.3)

PLATFORMS
  ruby

DEPENDENCIES
  activesupport
  autoload
  aws-sdk-s3
  capybara
  cucumber
  faker
  faraday
  knapsack
  pry
  rspec-core
  rspec-expectations
  selenium-webdriver
  site_prism

RUBY VERSION
   ruby 2.6.5p114

BUNDLED WITH
   2.0.2
aurelien-reeves commented 2 years ago

Thanks for your report. This is a known issue related to the html-formatter/cucumber-react: the underline components responsible for the report.

Refs. cucumber/cucumber-react#79

luke-hill commented 2 years ago

I've renamed the other ticket and can close this as a dupe.