@arghajit/dummy 0.1.0-beta-8 → 0.1.0-beta-9

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.
@@ -40,6 +40,24 @@ const path = __importStar(require("path"));
40
40
  const crypto_1 = require("crypto");
41
41
  const attachment_utils_1 = require("./attachment-utils"); // Use relative path
42
42
  const ua_parser_js_1 = require("ua-parser-js"); // Added UAParser import
43
+ // Use dynamic import for chalk as it's ESM only
44
+ let chalk;
45
+ try {
46
+ (async () => {
47
+ chalk = (await Promise.resolve().then(() => __importStar(require("chalk")))).default;
48
+ })();
49
+ }
50
+ catch (e) {
51
+ console.warn("Chalk could not be imported. Using plain console logs.");
52
+ chalk = {
53
+ green: (text) => text,
54
+ red: (text) => text,
55
+ yellow: (text) => text,
56
+ blue: (text) => text,
57
+ bold: (text) => text,
58
+ gray: (text) => text,
59
+ };
60
+ }
43
61
  const convertStatus = (status, testCase) => {
44
62
  if ((testCase === null || testCase === void 0 ? void 0 : testCase.expectedStatus) === "failed") {
45
63
  return "failed";
@@ -106,7 +124,7 @@ class PlaywrightPulseReporter {
106
124
  .catch((err) => console.error("Pulse Reporter: Error during initialization:", err));
107
125
  }
108
126
  onTestBegin(test) {
109
- console.log(`Starting test: ${test.title}`);
127
+ console.log(`${chalk.blue("Starting test:")} ${test.title}`);
110
128
  }
111
129
  getBrowserDetails(test) {
112
130
  var _a, _b, _c, _d;
@@ -114,24 +132,8 @@ class PlaywrightPulseReporter {
114
132
  const projectConfig = project === null || project === void 0 ? void 0 : project.use; // This is where options like userAgent, defaultBrowserType are
115
133
  const userAgent = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.userAgent;
116
134
  const configuredBrowserType = (_b = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.defaultBrowserType) === null || _b === void 0 ? void 0 : _b.toLowerCase();
117
- // --- DEBUG LOGS (Uncomment if needed for diagnosing) ---
118
- // console.log(`[PulseReporter DEBUG] Project: ${test.info().project.name}`);
119
- // console.log(`[PulseReporter DEBUG] Configured Browser Type: "${configuredBrowserType}"`);
120
- // console.log(`[PulseReporter DEBUG] User Agent for UAParser: "${userAgent}"`);
121
- // --- END DEBUG LOGS ---
122
- // if (!userAgent) {
123
- // // Fallback if no user agent is available
124
- // return configuredBrowserType
125
- // ? configuredBrowserType.charAt(0).toUpperCase() +
126
- // configuredBrowserType.slice(1)
127
- // : "Unknown Browser";
128
- // }
129
- // try {
130
135
  const parser = new ua_parser_js_1.UAParser(userAgent);
131
136
  const result = parser.getResult();
132
- // --- DEBUG LOGS (Uncomment if needed for diagnosing) ---
133
- // console.log("[PulseReporter DEBUG] UAParser Result:", JSON.stringify(result, null, 2));
134
- // --- END DEBUG LOGS ---
135
137
  let browserName = result.browser.name;
136
138
  const browserVersion = result.browser.version
137
139
  ? ` v${result.browser.version.split(".")[0]}`
@@ -141,12 +143,11 @@ class PlaywrightPulseReporter {
141
143
  ? ` ${result.os.version.split(".")[0]}`
142
144
  : ""; // Major version
143
145
  const deviceType = result.device.type; // "mobile", "tablet", etc.
146
+ let finalString;
144
147
  // If UAParser couldn't determine browser name, fallback to configured type
145
- if (!browserName) {
146
- browserName = configuredBrowserType
147
- ? configuredBrowserType.charAt(0).toUpperCase() +
148
- configuredBrowserType.slice(1)
149
- : "Unknown";
148
+ if (browserName === undefined) {
149
+ browserName = configuredBrowserType;
150
+ finalString = `${browserName}`;
150
151
  }
151
152
  else {
152
153
  // Specific refinements for mobile based on parsed OS and device type
@@ -173,19 +174,9 @@ class PlaywrightPulseReporter {
173
174
  else if (browserName === "Electron") {
174
175
  browserName = "Electron App";
175
176
  }
177
+ finalString = `${browserName}${browserVersion}${osName}${osVersion}`;
176
178
  }
177
- let finalString = `${browserName}${browserVersion}${osName}${osVersion}`;
178
- return finalString.trim() || "Unknown Browser";
179
- // } catch (error) {
180
- // console.warn(
181
- // `Pulse Reporter: Error parsing User-Agent string "${userAgent}":`,
182
- // error
183
- // );
184
- // return configuredBrowserType
185
- // ? configuredBrowserType.charAt(0).toUpperCase() +
186
- // configuredBrowserType.slice(1)
187
- // : "Unknown Browser";
188
- // }
179
+ return finalString.trim();
189
180
  }
190
181
  async processStep(step, testId, browserDetails, testCase) {
191
182
  var _a, _b, _c, _d;
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-8",
4
+ "version": "0.1.0-beta-9",
5
5
  "description": "A Playwright reporter and dashboard for visualizing test results.",
6
6
  "keywords": [
7
7
  "playwright",
@@ -45,65 +45,25 @@
45
45
  "report:email": "node ./scripts/sendReport.js"
46
46
  },
47
47
  "dependencies": {
48
- "@genkit-ai/googleai": "^1.6.2",
49
- "@genkit-ai/next": "^1.6.2",
50
- "@hookform/resolvers": "^4.1.3",
51
- "@radix-ui/react-accordion": "^1.2.3",
52
- "@radix-ui/react-alert-dialog": "^1.1.6",
53
- "@radix-ui/react-avatar": "^1.1.3",
54
- "@radix-ui/react-checkbox": "^1.1.4",
55
- "@radix-ui/react-dialog": "^1.1.6",
56
- "@radix-ui/react-dropdown-menu": "^2.1.6",
57
- "@radix-ui/react-label": "^2.1.2",
58
- "@radix-ui/react-menubar": "^1.1.6",
59
- "@radix-ui/react-popover": "^1.1.6",
60
- "@radix-ui/react-progress": "^1.1.2",
61
- "@radix-ui/react-radio-group": "^1.2.3",
62
- "@radix-ui/react-scroll-area": "^1.2.3",
63
- "@radix-ui/react-select": "^2.1.6",
64
- "@radix-ui/react-separator": "^1.1.2",
65
- "@radix-ui/react-slider": "^1.2.3",
66
- "@radix-ui/react-slot": "^1.1.2",
67
- "@radix-ui/react-switch": "^1.1.3",
68
- "@radix-ui/react-tabs": "^1.1.3",
69
- "@radix-ui/react-toast": "^1.2.6",
70
- "@radix-ui/react-tooltip": "^1.1.8",
71
- "@tanstack-query-firebase/react": "^1.0.5",
72
- "@tanstack/react-query": "^5.66.0",
73
48
  "archiver": "^7.0.1",
74
49
  "class-variance-authority": "^0.7.1",
75
50
  "clsx": "^2.1.1",
76
51
  "d3": "^7.9.0",
77
52
  "date-fns": "^3.6.0",
78
53
  "dotenv": "^16.5.0",
79
- "firebase": "^11.3.0",
80
- "genkit": "^1.6.2",
81
54
  "highcharts": "^12.2.0",
82
55
  "jsdom": "^26.1.0",
83
- "lucide-react": "^0.475.0",
84
- "next": "15.2.3",
85
56
  "nodemailer": "^7.0.3",
86
57
  "patch-package": "^8.0.0",
87
- "react": "^18.3.1",
88
- "react-day-picker": "^8.10.1",
89
- "react-dom": "^18.3.1",
90
- "react-hook-form": "^7.54.2",
91
58
  "recharts": "^2.15.1",
92
- "tailwind-merge": "^3.0.1",
93
- "tailwindcss-animate": "^1.0.7",
94
59
  "ua-parser-js": "^2.0.3",
95
- "zod": "^3.24.2"
60
+ "zod": "^3.24.2",
61
+ "lucide-react": "^0.475.0"
96
62
  },
97
63
  "devDependencies": {
98
64
  "@types/node": "^20",
99
- "@types/react": "^18",
100
- "@types/react-dom": "^18",
101
65
  "@types/ua-parser-js": "^0.7.39",
102
66
  "eslint": "9.25.1",
103
- "eslint-config-next": "15.3.1",
104
- "genkit-cli": "^1.6.1",
105
- "postcss": "^8",
106
- "tailwindcss": "^3.4.1",
107
67
  "typescript": "^5"
108
68
  },
109
69
  "engines": {
@@ -874,8 +874,11 @@ function generateSuitesWidget(suitesData) {
874
874
  <h3 class="suite-name" title="${sanitizeHTML(
875
875
  suite.name
876
876
  )} (${sanitizeHTML(suite.browser)})">${sanitizeHTML(suite.name)}</h3>
877
- <span class="browser-tag">${sanitizeHTML(suite.browser)}</span>
878
877
  </div>
878
+ <div>
879
+ 🖥️
880
+ <span class="browser-tag">${sanitizeHTML(suite.browser)}</span>
881
+ </div>
879
882
  <div class="suite-card-body">
880
883
  <span class="test-count">${suite.count} test${
881
884
  suite.count !== 1 ? "s" : ""