@arghajit/dummy 0.1.0-beta-9 → 0.1.0-beta-11
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,24 +40,6 @@ 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
|
-
}
|
|
61
43
|
const convertStatus = (status, testCase) => {
|
|
62
44
|
if ((testCase === null || testCase === void 0 ? void 0 : testCase.expectedStatus) === "failed") {
|
|
63
45
|
return "failed";
|
|
@@ -124,14 +106,14 @@ class PlaywrightPulseReporter {
|
|
|
124
106
|
.catch((err) => console.error("Pulse Reporter: Error during initialization:", err));
|
|
125
107
|
}
|
|
126
108
|
onTestBegin(test) {
|
|
127
|
-
console.log(
|
|
109
|
+
console.log(`Starting test: ${test.title}`);
|
|
128
110
|
}
|
|
129
111
|
getBrowserDetails(test) {
|
|
130
112
|
var _a, _b, _c, _d;
|
|
131
113
|
const project = (_a = test.parent) === null || _a === void 0 ? void 0 : _a.project(); // project() can return undefined if not in a project context
|
|
132
114
|
const projectConfig = project === null || project === void 0 ? void 0 : project.use; // This is where options like userAgent, defaultBrowserType are
|
|
133
115
|
const userAgent = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.userAgent;
|
|
134
|
-
const configuredBrowserType = (_b = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.
|
|
116
|
+
const configuredBrowserType = (_b = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.browserName) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
135
117
|
const parser = new ua_parser_js_1.UAParser(userAgent);
|
|
136
118
|
const result = parser.getResult();
|
|
137
119
|
let browserName = result.browser.name;
|
package/package.json
CHANGED