wdio-reportportal-reporter icon indicating copy to clipboard operation
wdio-reportportal-reporter copied to clipboard

addAttribute functionality not working for Scenario Or Feature

Open LordPato opened this issue 3 years ago • 4 comments

The problem

addAttribute functionality not working for Scenario Or Feature

Environment

  • WebdriverIO version: 7.0.7
  • wdio-reportportal-version version: 7.0.0
  • Node.js version: v14.16.1
  • WDIO Testrunner and version(mocha\cucumber\jasmine): cucumber 7.2.1

Details

I don't like to have the tags in the suite titles, so I'm trying to add them using a different approach using addAttribute. Even though If i look for the attribute keys/values, those are in fact added to ReportPortal. Those are not assigned to the executed Feature or Scenario

It would be good to have the chance to remove tags from title when using the parseTagsFromTestTitle functionality

Code To Reproduce Issue [ Good To Have ]

/**
 * Runs before a Cucumber feature
 */
beforeFeature: async function (uri, feature) {
    let tags = Array.from(feature['tags'])
    
    tags.forEach(function (featureTagItem) {
        reportportal.addAttribute({key: 'tag', value: featureTagItem['name']})
    })
},
/**
 * Runs before a Cucumber scenario
 */
 beforeScenario: async function (world) {
    let tags = Array.from(world['gherkinDocument']['feature']['tags'])
    
    tags.forEach(function (featureTagItem) {
        reportportal.addAttribute({key: 'tag', value: featureTagItem['name']})
    })
 },

LordPato avatar Jun 30 '21 00:06 LordPato

This would be great to have. For some reason I can't get addAttribute to work at all in Cucumber; not in wdio hooks, cucumber hooks, nor step definitions. parseTagsFromTestTitle seems to work fine though.

grant-mccarriagher avatar Jul 29 '21 16:07 grant-mccarriagher

How it works ? I was able to add tag in none of the hooks: reportportal.addAttribute({key: 'tag', value: '123asd'})

mr-anton-t avatar Dec 13 '21 16:12 mr-anton-t

I'm jumping on this too. For Cucumber, I cannot add attributes either at feature-level, scenario-level, or step-level. Having these attributes would be a huge improvement.

hammzj avatar Jan 19 '22 22:01 hammzj

Let's up this issue again

NanoTechnolog3000 avatar Jun 14 '22 09:06 NanoTechnolog3000