@arghajit/dummy 0.1.0-beta-6 → 0.1.0-beta-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -150,10 +150,10 @@ class PlaywrightPulseReporter {
150
150
  };
151
151
  }
152
152
  getBrowserInfo(test) {
153
- var _a, _b, _c, _d;
153
+ var _a, _b, _c;
154
154
  const project = (_a = test.parent) === null || _a === void 0 ? void 0 : _a.project();
155
155
  const configuredBrowserType = (_c = (_b = project === null || project === void 0 ? void 0 : project.use) === null || _b === void 0 ? void 0 : _b.defaultBrowserType) === null || _c === void 0 ? void 0 : _c.toLowerCase();
156
- const userAgentString = (_d = project === null || project === void 0 ? void 0 : project.use) === null || _d === void 0 ? void 0 : _d.userAgent;
156
+ const userAgentString = test.info().project.use.userAgent;
157
157
  // --- DEBUG LOGS (IMPORTANT! Check these in your console output) ---
158
158
  console.log(`[PulseReporter DEBUG] Project: ${(project === null || project === void 0 ? void 0 : project.name) || "N/A"}`);
159
159
  console.log(`[PulseReporter DEBUG] Configured Browser Type: "${configuredBrowserType}"`);
@@ -238,7 +238,11 @@ class PlaywrightPulseReporter {
238
238
  async onTestEnd(test, result) {
239
239
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
240
240
  const project = (_a = test.parent) === null || _a === void 0 ? void 0 : _a.project();
241
- const browserDisplayInfo = this.getBrowserInfo(test);
241
+ // const browserDisplayInfo = this.getBrowserInfo(test);
242
+ const ua = test.info().project.use.userAgent;
243
+ const parser = new ua_parser_js_1.UAParser(ua);
244
+ const res = parser.getResult();
245
+ const browserDisplayInfo = res.browser.name || "";
242
246
  const testStatus = convertStatus(result.status, test);
243
247
  const startTime = new Date(result.startTime);
244
248
  const endTime = new Date(startTime.getTime() + result.duration);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arghajit/dummy",
3
3
  "author": "Arghajit Singha",
4
- "version": "0.1.0-beta-6",
4
+ "version": "0.1.0-beta-7",
5
5
  "description": "A Playwright reporter and dashboard for visualizing test results.",
6
6
  "keywords": [
7
7
  "playwright",