Skip to content

Is there any way we can edit the result name for slack messages ? #10

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

Open
JyotiPrakashMallick opened this issue Jan 23, 2024 · 0 comments

Comments

@JyotiPrakashMallick
Copy link

JyotiPrakashMallick commented Jan 23, 2024

Description:

For my project I am using mocha-junit for driving the automation suite. I am running three suites (at current it is 3 may be going to increase in the future)

So I have following set up for test run from package.json file

"scripts": {
    "test": "mocha <testsuite_01> --reporter mocha-junit-reporter --reporter-options mochaFile=<resultFile01>",
    "test:userAPI" : "mocha <testsuite_02> --reporter mocha-junit-reporter --reporter-options mochaFile=<resultFile02>",
    "test:orderAPI" : "mocha <testsuite_03> --reporter mocha-junit-reporter --reporter-options mochaFile=<resultFile03>",
    "test:all" : "npm run test:userAPI && npm run test:orderAPI"
  },

And for the above I have configured the report.js file

module.exports = {

    "reports" : [
        {
            "targets": [
                {
                    "name": "slack",
                    "inputs" : {
                        "url" : `<webhook_url_for_slack>`
                    }
                }
            ],
            "results" : [
                {
                    "type"  : "junit",
                    "files" : [
                        "<resultFile01>",
                        "<resultFile02>",
                        "<resultFile03>"
                    ]
                }
            ]
        }
    ]

}

When I run the report I am getting the following alert on my slack , which has root suite 3 times . Is there any way we can customize it ?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant