testcafe-reporter-cucumber-json icon indicating copy to clipboard operation
testcafe-reporter-cucumber-json copied to clipboard

json file rewrites when run tests in few browsers simuntaneosly

Open maximkoev opened this issue 6 years ago • 39 comments

Hi guys, you created really good tool, I like it. Could u please help me with my problem. When I run tests in few browsers or run tests again, roport.json deletes and creates each time. how can I avoid it?

maximkoev avatar Jul 03 '19 13:07 maximkoev

Hi @maximkoev, thank you for your feedback. It is possible to have a report filename that is different at each run. The question is: how to do you want to show the report: should it be the merge of each report files, should it be the last generated report file?

hdorgeval avatar Aug 09 '19 09:08 hdorgeval

Hi @hdorgeval in the best case I want to see report with history. So I want to know when case passes and when failed.

maximkoev avatar Aug 09 '19 10:08 maximkoev

Hi @hdorgeval

Maybe to give you an example of this issue consider the following scenario(I am facing a similar situation):

  • Using a test case runner class to perform parallel testing with BrowserStack.
  • If you instance different web browsers in the same runner, it ONLY displays the first browser result ( JSON only have that result). Therefore the rest of the tests are missed in the final report.

*Note: Maybe he might be thinking about the possibility of having a different report per browser or have an HTML report with all the results.

Attaching a test runner example of that particular case. image

JoanEsquivel avatar Mar 25 '20 17:03 JoanEsquivel

Hi @JoanEsquivel I am using this report and running on browserstack . The issue is it doesn't show the browser name and device name properly which was Edge and Windows. CuCumberReport_BrowserstackIssue Would be great you can help me on this

vasantverma-LM avatar Jul 01 '20 13:07 vasantverma-LM

Hi @vasantverma-LM , if you can provide the generated report.json file, it will help me to solve your issue concerning the browser.

hdorgeval avatar Jul 01 '20 18:07 hdorgeval

Hi @hdorgeval Thanks for your response. Regarding the screenshot I will create a sample project and would the report.json file in some time. For this I will create a separate issue.

vasantverma-LM avatar Jul 03 '20 11:07 vasantverma-LM

@hdorgeval Do you have any solution for getting the test results in the report when multiple browsers are running simultaneously. As mentioned by @JoanEsquivel only the report only displays the test results of the first browser

vasantverma-LM avatar Jul 03 '20 11:07 vasantverma-LM

Hi @vasantverma-LM : yes I plan to solve this issue as soon as possible :). I will start the dev this week-end.

hdorgeval avatar Jul 03 '20 11:07 hdorgeval

Hello guys, thank you for your feedbacks and your patience!

I have published a v6.0.0 version to the npm registry that should solve this issue.

Please read the CHANGELOG, as this release is a breaking change.

It would be awesome if you could provide some feedback on this new release.

hdorgeval avatar Jul 04 '20 21:07 hdorgeval

@hdorgeval Thanks for the latest release. I am currently using it in my sample project. Till now its working fine. I have encountered one issue in the latest version. When viewing the error log displayed in the report, there is a symbol which repeated frequently. Due to this the error log is not readable. Attached are the screenshots of version 5.1.0 and latest version 6.0.0. Cucumber JSON TestCafe Reporter_version510 Cucumber JSON TestCafe Reporter_version6

vasantverma-LM avatar Jul 06 '20 09:07 vasantverma-LM

Hi @vasantverma-LM , thanks a lot for your feedback!

This is a side effect caused by the removal of the report.json file declaration together with the reporter. If you put back the file declaration after the reporter, it should work.

This problem is due to the fact that before version 6, the json file was 'cleaned' and written by testcafe itself.

From version 6, the file is entirely managed and written by the reporter itself and not by testcafe.

I fix this issue asap.

hdorgeval avatar Jul 06 '20 19:07 hdorgeval

Hi @vasantverma-LM, I have published a v6.0.1 that should solve the issue.

hdorgeval avatar Jul 06 '20 20:07 hdorgeval

Hi @hdorgeval the error log issue in the report is resolved in the v6.0.1 but the enhancement added in the v6.0.0 is not working. I tested it on v6.0.0 and v6.0.1. In v6.0.0 I am able to run at least three browsers simultaneously and the report was generated accordingly but with the same scenario in v6.0.1 browsers are not getting closed after successfull execution.

vasantverma-LM avatar Jul 07 '20 08:07 vasantverma-LM

Hi @vasantverma-LM, I cannot reproduce locally on my mac your issue. Which browsers are you using? Did you try to rimraf the node_modules and re-install everything?

hdorgeval avatar Jul 07 '20 17:07 hdorgeval

Hi @hdorgeval I have tested it again and it seems that the issue that I have mentioned earlier is intermittent and occurs only when we are running tests on three or more browsers simultaneously.

vasantverma-LM avatar Jul 08 '20 07:07 vasantverma-LM

Hi @hdorgeval , Thanks for your update. There is one query related to the showing the screenshots in the report. Suppose I have executed a test on chrome, edge, and firefox simultaneously. JSON files for these three browsers are created. When viewing the screenshots of the test in the reports for a particular, it shows screenshots of all other browsers also. I have specified below mention naming techniques for screenshots. Screenshot (49) Testcafe_Cucumber_Report_MultiBrowser

Is there any way to show screenshots of each browser separately in the screenshots sections of the report.

vasantverma-LM avatar Jul 08 '20 07:07 vasantverma-LM

Hi @vasantverma-LM , I have pushed a v6.0.2 version that maybe could resolve that browser does not close at the end of the tests.

Concerning the screenshots, I need some more time on my side.

Thanks!

hdorgeval avatar Jul 08 '20 20:07 hdorgeval

Hi @vasantverma-LM, I am working on your issue. I will release a new version in a few days.

hdorgeval avatar Jul 10 '20 18:07 hdorgeval

Hi @vasantverma-LM , Thank's a lot for your feedback, as it helped me to significantly improve the reporter.

I have pushed a v6.0.3 version on npm. This version should correctly handle error messages and screenshots for each browser when TestCafe runs with multiple browsers simultaneously.

There is still some improvements to implement:

  • insert TestCafé warning messages when a screenshot could not be taken
    • If you do not see a screenshot in a failed report, have a look inside the json file at a section called runInfo: you should have a warning sub sections that will explain why the screenshot could not be taken
  • add a column in the HTML report to show the execution date, since you may have multiple entries now for the same feature

Thank's for your feedback on this new version :)

hdorgeval avatar Jul 11 '20 12:07 hdorgeval

Hi, @hdorgeval I have tested the reporter v6.0.3 with chrome, edge, and firefox simultaneously and it is not showing the screenshots for each successful test. In my test code, I have added the code for capturing the screenshot at the end of every test. The screenshots are captured but not shown in the report for each browser. For failing tests, screenshots are shown for the respective browser. Refer screenshots. Screenshot (92) Screenshot (93)

vasantverma-LM avatar Jul 13 '20 12:07 vasantverma-LM

Hi @vasantverma-LM , thanks a lot for your feedback.

I have published v6.0.4 that should solve your issue.

hdorgeval avatar Jul 14 '20 15:07 hdorgeval

Hi @hdorgeval ,thanks for the update. I have tested the latest version 6.0.4 and it is working fine when running tests locally but when testcafe tests are executed on BrowserStack , screenshots(both failure and success screenshots) are captured in testcafe but not shown in the report. The above mentioned observation is for running multiple browsers simultaneously. Attached is the screenshot of my TestRunner.js file TestRunner_BS

vasantverma-LM avatar Jul 15 '20 11:07 vasantverma-LM

Hi @vasantverma-LM : thanks again for your feedback. To solve your issue I need the json files generated by the reporter. Do you think it is possible on your side to forward me at least one of these files?

hdorgeval avatar Jul 15 '20 11:07 hdorgeval

Hi @hdorgeval I will try to reproduce the same on a sample testcafe project and then will share the json files.

vasantverma-LM avatar Jul 15 '20 12:07 vasantverma-LM

Hi @hdorgeval , attached are the json files for tests executed on BrowserStack. v6.0.4 Issues.zip.

Attached below is the screenshot of the report: Screenshot (64) As shown in the screenshot, for iOS and android the OS column shows ? unknown . During test execution, I got testcafe-reporter-cucumber-json: cannot get the Platform name from input string 'Chrome 83.0.4103.106 / Android 10 error message in the terminal. I have a also attached the json file for iOS device.

vasantverma-LM avatar Jul 15 '20 14:07 vasantverma-LM

Hi @vasantverma-LM, thanks for the data. Unfortunately I suspect this is the way TestCafé handles the userAgent on BrowserStack. I will publish a new version that will enable you to output debug data on the console.

I will ping you when this version is ready.

Thanks!

hdorgeval avatar Jul 15 '20 14:07 hdorgeval

Hi @hdorgeval , thanks for the update. Also plz provide a fix the screenshot issue not showing in the report when tests are executed on BrowserStack. The necessary files I have shared with you.

vasantverma-LM avatar Jul 15 '20 14:07 vasantverma-LM

Hi @vasantverma-LM , I have published a v6.0.5, that, I hope, will fix your last issues.

hdorgeval avatar Jul 15 '20 20:07 hdorgeval

Hi @hdorgeval I have tested the latest v6.0.5 but when executing testcafe tests on BrowserStack, screenshots are still not shown in the report

vasantverma-LM avatar Jul 16 '20 07:07 vasantverma-LM

Hi @vasantverma-LM , you should have console logs like : cannot match browser...

hdorgeval avatar Jul 16 '20 08:07 hdorgeval