AppiumTestDistribution / appium-reporter-plugin

Appium2 plugin to generate html report with screenshots.
Apache License 2.0
30 stars 12 forks source link

Unable to get reports #141

Closed yshnaviganapathi closed 1 year ago

yshnaviganapathi commented 1 year ago

Installed sharp version 0.31.3 and appium-reporter-plugin. Tried fetching the reports by hitting the server "http://localhost:4723/getReport", but reports are not generated. @Dileep17 Could you help us resolve the issue and get the reports?

Platform: windows C:>npm -v 9.8.1

C:>node -v v18.17.0

C:>appium driver list √ Listing available drivers

C:> appium plugin list √ Listing available plugins

C:>npm ls sharp `-- sharp@0.31.3

We are getting this error:

[HTTP] <-- POST /wd/hub/session 200 13769 ms - 1704 [HTTP] [HTTP] --> GET /getReport [HTTP] {} uncaughtException: Cannot read properties of undefined (reading 'map') TypeError: Cannot read properties of undefined (reading 'map') at Object. (C:\Users\vganapa.appium\node_modules\appium-reporter-plugin\lib\reporter.js:130:39) at Generator.next () at fulfilled (C:\Users\vganapa.appium\node_modules\appium-reporter-plugin\lib\reporter.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)

Dileep17 commented 1 year ago

@yshnaviganapathi Could you provide sample code to reproduce the issue. Would be easy & fast for me to debug and provide resolution.

Dileep17 commented 1 year ago

@yshnaviganapathi check https://github.com/AppiumTestDistribution/appium-reporter-plugin/tree/main/examples for Java and JS implementation.

Closing this issue.

vaishnavi-ganapathi commented 1 year ago

@Dileep17 , I tried installing the plugin then activated - appium --use-plugins=appium-reporter-plugin mvn test after successful execution, I don't see the report. May I know in which location it will get downloaded?

Dileep17 commented 1 year ago

Hi @TestVaishnavi, report file wont be created by the plugin.

I hope you are comfortable with JS. Have a look at https://github.com/AppiumTestDistribution/appium-reporter-plugin/blob/main/examples/js/AppiumReportPluginDemo/config/wdio.shared.conf.ts#L62 the response of /getReport should be written to a file (*.html). This would be the report.