Skip to content

[Question] Can we overwrite name of scenario in allure reporter or not? #2728

Closed

Description

@golfzaptw

I need to add some prefix when the scenario used retry plugin for each case in my report like this
Screen Shot 2563-12-21 at 16 21 52
Is it possible?

My simple test

const { configuration, I } = inject()

let tries = 0

Feature('Retry in workers').retry(configuration.reRunTimes)
codeceptjs.event.dispatcher.on(codeceptjs.event.test.passed, (test) => {
    const retryTimes = test.retryNum
    const msgRetry = `Retry ${retryTimes} times`
    if (retryTimes > 0) {
        I.say(msgRetry)
    }
    test.title = 'new test'
})

Scenario('Passed scenario', () => {
    I.assertEqual(tries, 0)
}).tag('retryTest')

Scenario('Flaky scenario', () => {
    tries++
    I.assertEqual(tries, 3)
}).tag('retryTest')

Activity

  1. kobenguyent commented on Apr 16, 2024

    @kobenguyent
    Collaborator

    Screenshot 2024-04-16 at 17 16 58

    I think it's possible by modifying the allure data. So basically, after running allure generate you would have the test case data files like that. Then you could develop a bash script or js script for instance to modify the test scenario name based on your need.

    Screenshot 2024-04-16 at 17 19 06

  2. locked and limited conversation to collaborators on Apr 16, 2024
  3. converted this issue into a discussion #4306 on Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions