webrtc / KITE

KITE is a test engine designed to test WebRTC interoperability across browsers
Apache License 2.0
468 stars 126 forks source link

Browser Console Logs to be displayed as a part of Allure Report #116

Closed ImranTelebu closed 4 years ago

ImranTelebu commented 4 years ago

Hi,

  1. I need browser console logs, so for that I wrote a method and I can now fetch console errors and store in a log file, now I wish to show that file in allure report, as an attachment.
    kindly suggest me the way to achieve it, or kite has a way to do it.
  2. I want this attachment irrespective of the test result , if there is any console error log there should be an attachment of that stacktrace.
namvuCosmo commented 4 years ago

Hi,

In you step, after you get the browser log, you can attach it to the report like so:

      reporter.textAttachment(report, "Browser Log", "some text", "plain");
      reporter.textAttachment(report, "Browser Log", "some json text", "json");
      // or if you have a JsonObject or JsonValue
      JsonObject log = someJsonObject;
      reporter.jsonAttachment(report, "Browser Log", log);

This doesn't work with a file, you'll need to read the file and attach the content to the report.

Out of curiosity, can your method get the browser console log on firefox?

ImranTelebu commented 4 years ago

Thanks for your help.

currently, This method is working for chrome only. But I am working on firefox also if I get any solution, will let u know.

namvuCosmo commented 4 years ago

Thanks,

FYI, we do have a step to get the console log on Chrome, not sure if it's the same with what you have:

runner.addStep(new ConsoleLogStep(runner));

However this has some inconsistency with the recent chrome versions.