I have added below dependencies in my project
"mochawesome-report-generator": "^6.0.1", "wdio-mochawesome-reporter": "^4.0.0", "@wdio/dot-reporter": "^7.16.14"
And added in wdio.conf file the below configuration
reporters: [
'dot', 'mochawesome',
],
reporterOptions: {
outputDir: './mochawesome-results', //json file will be written to this directory
},
When I run the spec file in the console log i see the below:
"dot" Reporter:
FF..
"mochawesome" Reporter:
{"stats":{"suites":1,"tests":2,"passes":0,"pending":0,"failures":2,"start":"2022-02-17T09:29:32.518Z","end":"2022-02-17T09:30:46.131Z","duration":73613,"testsRegistered":2,"passPercent":0,"pendingPercent":0,"other":0,"hasOther":false,"skipped":0,"hasSkipped":false,"passPercentClass":"success","pendingPercentClass":"danger"},"suites":{"title":"","suites":[{"title":"Findashop Tile (iphone11.ios.14_5.myproximus-dev_app)","suites":[],"tests":[{"title":"TC-Appointment in a shop-Validate -appointment in a shop- tile","fullTitle":"TC-Appointment in a shop-Validate -appointment in a shop- tile","timedOut":false,"duration":13590,"speed":"fast","pass":false,"fail":true,"pending":false,"code":"","isRoot":false,"uuid":"ca459c43-d36d-4914-992d-545e7d44a41a","parentUUID":"f8720287-98c6-43f0-a043-9a06bc7bd53d","skipped":false,"isHook":false,"context":"[{\"title\":\"Session Id\",\"value\":\"cf2e255d-74b7-4fe8-99f6-c19147bf8202\"}]","state":"failed","err":{"name":"unknown error","message":"An unknown server-side error occurred while processing the command. Original error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil","estack":"unknown error: An unknown server-side error occurred while processing the command. Original error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at whenAcceptPushNotification (/Users/dipikamishra/myproximus-rn/src-dise/legacy-features/__e2e__/common.ts:284:14)\n at Object.givenLandingToDashboard (/Users/dipikamishra/myproximus-rn/src-dise/legacy-features/__e2e__/common.ts:144:3)\n at Object.givenAuthenticatedUserInServices (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/common.ts:90:5)\n at Context.<anonymous> (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/services/findashop.spec.ts:17:5)","stack":"unknown error: An unknown server-side error occurred while processing the command. Original error: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at whenAcceptPushNotification (/Users/dipikamishra/myproximus-rn/src-dise/legacy-features/__e2e__/common.ts:284:14)\n at Object.givenLandingToDashboard (/Users/dipikamishra/myproximus-rn/src-dise/legacy-features/__e2e__/common.ts:144:3)\n at Object.givenAuthenticatedUserInServices (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/common.ts:90:5)\n at Context.<anonymous> (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/services/findashop.spec.ts:17:5)"}},{"title":"TC-Appointment in a shop-Validate web view for -appointment in a shop-","fullTitle":"TC-Appointment in a shop-Validate web view for -appointment in a shop-","timedOut":false,"duration":60001,"speed":"fast","pass":false,"fail":true,"pending":false,"code":"","isRoot":false,"uuid":"92b510d1-bc7d-4fc1-a103-b5409b52c2bb","parentUUID":"f8720287-98c6-43f0-a043-9a06bc7bd53d","skipped":false,"isHook":false,"context":"[{\"title\":\"Session Id\",\"value\":\"cf2e255d-74b7-4fe8-99f6-c19147bf8202\"}]","state":"failed","err":{"name":"Error","message":"Timeout of 60000ms exceeded. The execution in the test \"Findashop Tile TC-Appointment in a shop-Validate web view for -appointment in a shop-\" took too long. Try to reduce the run time or increase your timeout for test specs (https://webdriver.io/docs/timeouts.html). (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/services/findashop.spec.ts)","estack":"Error: Timeout of 60000ms exceeded. The execution in the test \"Findashop Tile TC-Appointment in a shop-Validate web view for -appointment in a shop-\" took too long. Try to reduce the run time or increase your timeout for test specs (https://webdriver.io/docs/timeouts.html). (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/services/findashop.spec.ts)\n at Test.Runnable._timeoutError (/Users/dipikamishra/myproximus-rn/node_modules/mocha/lib/runnable.js:432:10)\n at Timeout.<anonymous> (/Users/dipikamishra/myproximus-rn/node_modules/mocha/lib/runnable.js:244:24)\n at listOnTimeout (internal/timers.js:557:17)\n at processTimers (internal/timers.js:500:7)","stack":"Error: Timeout of 60000ms exceeded. The execution in the test \"Findashop Tile TC-Appointment in a shop-Validate web view for -appointment in a shop-\" took too long. Try to reduce the run time or increase your timeout for test specs (https://webdriver.io/docs/timeouts.html). (/Users/dipikamishra/myproximus-rn/src-dise/services-features/__e2e__/services/findashop.spec.ts)\n at Test.Runnable._timeoutError (/Users/dipikamishra/myproximus-rn/node_modules/mocha/lib/runnable.js:432:10)\n at Timeout.<anonymous> (/Users/dipikamishra/myproximus-rn/node_modules/mocha/lib/runnable.js:244:24)\n at listOnTimeout (internal/timers.js:557:17)\n at processTimers (internal/timers.js:500:7)"}}],"pending":[],"root":false,"fullFile":"","file":"","passes":[],"failures":["ca459c43-d36d-4914-992d-545e7d44a41a","92b510d1-bc7d-4fc1-a103-b5409b52c2bb"],"skipped":[],"duration":73592,"_timeout":0,"uuid":"f8720287-98c6-43f0-a043-9a06bc7bd53d","beforeHooks":[],"afterHooks":[]}],"tests":[],"pending":[],"root":true,"fullFile":"","file":"","passes":[],"failures":[],"skipped":[],"duration":0,"_timeout":0,"uuid":"cd45c312-f5ae-47d3-bf5f-7812f7a3d5fa","beforeHooks":[],"afterHooks":[]},"copyrightYear":2022}{"stats":{"suites":1,"tests":2,"passes":2,"pending":0,"failures":0,"start":"2022-02-17T09:31:01.781Z","end":"2022-02-17T09:31:53.225Z","duration":51444,"testsRegistered":2,"passPercent":100,"pendingPercent":0,"other":0,"hasOther":false,"skipped":0,"hasSkipped":false,"passPercentClass":"success","pendingPercentClass":"danger"},"suites":{"title":"","suites":[{"title":"Findashop Tile (emulator-5554.android.11.app-devmyproximus-release_apk)","suites":[],"tests":[{"title":"TC-Appointment in a shop-Validate -appointment in a shop- tile","fullTitle":"TC-Appointment in a shop-Validate -appointment in a shop- tile","timedOut":false,"duration":22979,"speed":"fast","pass":true,"fail":false,"pending":false,"code":"","isRoot":false,"uuid":"3da11fe9-2796-4283-9474-76858256595b","parentUUID":"53d3c250-f4ec-463c-aa19-ce5602ae1ab3","skipped":false,"isHook":false,"context":"[{\"title\":\"Session Id\",\"value\":\"40aabd96-f546-4fb5-8912-c2de4277d69e\"}]","state":"passed","err":{}},{"title":"TC-Appointment in a shop-Validate web view for -appointment in a shop-","fullTitle":"TC-Appointment in a shop-Validate web view for -appointment in a shop-","timedOut":false,"duration":28175,"speed":"fast","pass":true,"fail":false,"pending":false,"code":"","isRoot":false,"uuid":"aae85dd9-fe6d-419d-8ea8-10f225ab9267","parentUUID":"53d3c250-f4ec-463c-aa19-ce5602ae1ab3","skipped":false,"isHook":false,"context":"[{\"title\":\"Session Id\",\"value\":\"40aabd96-f546-4fb5-8912-c2de4277d69e\"}]","state":"passed","err":{}}],"pending":[],"root":false,"fullFile":"","file":"","passes":["3da11fe9-2796-4283-9474-76858256595b","aae85dd9-fe6d-419d-8ea8-10f225ab9267"],"failures":[],"skipped":[],"duration":51156,"_timeout":0,"uuid":"53d3c250-f4ec-463c-aa19-ce5602ae1ab3","beforeHooks":[],"afterHooks":[]}],"tests":[],"pending":[],"root":true,"fullFile":"","file":"","passes":[],"failures":[],"skipped":[],"duration":0,"_timeout":0,"uuid":"37442765-57d4-4717-bd25-52a6dd25a163","beforeHooks":[],"afterHooks":[]},"copyrightYear":2022}
Now the problem is I dont see the mochawesome-results directory getting created and no json files getting created. Where is this directory or is it only printing in console log and not generating any json file? What more configs i should be doing?