Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addAttribute functionality not working for Scenario Or Feature #160

Open
LordPato opened this issue Jun 30, 2021 · 4 comments
Open

addAttribute functionality not working for Scenario Or Feature #160

LordPato opened this issue Jun 30, 2021 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@LordPato
Copy link

LordPato commented Jun 30, 2021

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']})
    })
 },
@BorisOsipov BorisOsipov added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 18, 2021
@grant-mccarriagher
Copy link

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
Copy link

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

@hammzj
Copy link

hammzj commented Jan 19, 2022

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
Copy link

Let's up this issue again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants