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

nested suite name issue #88

Open
ssrakesh opened this issue Sep 11, 2019 · 1 comment
Open

nested suite name issue #88

ssrakesh opened this issue Sep 11, 2019 · 1 comment

Comments

@ssrakesh
Copy link

ssrakesh commented Sep 11, 2019

If nested suites are used

describe(namespace, () => {
    describe('.sorttest', () => {
        it('should work properly', () => {
       ....
        })
    })
})

output xml will have
<testsuite name="namespace .sorttest" ../>

Is it possible to remove space after namespace? like
<testsuite name="namespace.sorttest" ../>

@ssrakesh
Copy link
Author

ssrakesh commented Sep 16, 2019

I have modified jenkines.js file with following changes. this should enable the separator option and use it while adding in xml name and classname attribs

you can include these changes if interested.
Note: I have referred mocha-junit-reporter for this change

53a54
>   options.jenkins_suite_title_separator =  process.env.JENKINS_SUITE_TITLE_SEPARATOR || options.jenkins_suite_title_separator;
63a65,80
>   function fullSuiteTitle(suite) {
>     var parent = suite.parent;
>     var title = [ suite.title ];
>   
>     while (parent) {
>       if (parent.root && parent.title === '') {
>         //Nothing to do
>       } else {
>         title.unshift(parent.title);
>       }
>       parent = parent.parent;
>     }
>   
>     return title.join(options.jenkins_suite_title_separator);
>   }
> 
74c91
< 
---
>     let fullTitle = options.jenkins_suite_title_separator ? fullSuiteTitle(currentSuite.suite) : currentSuite.suite.fullTitle()
76c93
<       var imagestring = options.imagestring || htmlEscape(currentSuite.suite.fullTitle());
---
>       var imagestring = options.imagestring || htmlEscape(fullTitle);
94c111
<           name: currentSuite.suite.fullTitle(),
---
>           name: fullTitle,
263a281
>     let fullTitle = options.jenkins_suite_title_separator ? fullSuiteTitle(currentSuite.suite) :currentSuite.suite.fullTitle()
273c291
<       return testPackage + delimiter + suite.fullTitle();
---
>       return testPackage + delimiter + fullTitle;
276c294
<       return options.junit_report_name + '.' + suite.fullTitle();
---
>       return options.junit_report_name + '.' + fullTitle;
278c296
<     return suite.fullTitle();
---
>     return fullTitle;

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