BorisOsipov / wdio-reportportal-reporter

A WebdriverIO plugin. Report results to Report Portal.
MIT License
23 stars 29 forks source link

addAttribute functionality not working for Scenario Or Feature #160

Open LordPato opened 3 years ago

LordPato commented 3 years ago

The problem

addAttribute functionality not working for Scenario Or Feature

Environment

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']})
    })
 },
grant-mccarriagher commented 3 years ago

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.

mr-anton-t commented 2 years ago

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

hammzj commented 2 years ago

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.

NanoTechnolog3000 commented 2 years ago

Let's up this issue again