browserstack / mocha-browserstack

Selenium examples for Mocha and BrowserStack Automate
7 stars 19 forks source link

configure mocha runner mocha-junit-reporter #45

Open fbuecklers opened 1 year ago

fbuecklers commented 1 year ago

Hi

I try to get an junit report as wll with a browserstack run.

My package.json section looks like the following:

 "scripts": {
    "smoke-tests": "mocha customers/**/smoke.spec.js",
    "smoke-tests-browserstack": "browserstack-node-sdk mocha customers/**/smoke.spec.js"
  },

And I have the following .mocharc.yml file

# This is an example Mocha config containing every Mocha option plus others.
# Full reference https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
reporter: 'mocha-junit-reporter'
reporter-option: # array, not object
  - 'mochaFile=./junit.xml'

If I run the command npm run smoke-tests I get a junit.xml in my root folder of my project But if I'm running npm run smoke-tests-browserstack then I will not get a junit report

What I need to change that it will also work with the browserstack-node-sdk wrapper?

Thanks in advance

rohit-y180 commented 1 year ago

Is the test running successfully? Is there any console error? If yes, could you please share the entire error stack trace?

fbuecklers commented 1 year ago

Hi

The test runs with an error to test the functionality of generating a junit.xml report. But the general code works and the test is executed. Also in the console I see the test summary. It is just not generating a junit.xml

It looks like the reporter option is not correctly picked up or is just ignored

Thanks

rohit-y180 @.***> schrieb am Mo., 19. Juni 2023, 03:59:

Is the test running successfully? Is there any console error? If yes, could you please share the entire error stack trace?

— Reply to this email directly, view it on GitHub https://github.com/browserstack/mocha-browserstack/issues/45#issuecomment-1596374238, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEJSNYHCLOGFXAKQCILU6LXL6XBLANCNFSM6AAAAAAZLDQYQY . You are receiving this because you authored the thread.Message ID: @.***>