wdio-performancetotal-service
Advanced tools
Comparing version 1.0.8 to 1.0.9-0
@@ -55,3 +55,3 @@ "use strict"; | ||
try { | ||
yield fs_1.promises.mkdir(dirPath); | ||
yield fs_1.promises.mkdir(dirPath, { recursive: true }); | ||
} | ||
@@ -58,0 +58,0 @@ catch (err) { |
@@ -15,3 +15,3 @@ declare class PerformanceTotal { | ||
*/ | ||
initialize(disableAppendToExistingFile: boolean): Promise<void>; | ||
initialize(disableAppendToExistingFile: boolean, performanceResultsDirectory?: string): Promise<void>; | ||
/** | ||
@@ -18,0 +18,0 @@ * @deprecated Don't use this method if *wdio-performancetotal-service* is enabled. |
@@ -40,5 +40,5 @@ "use strict"; | ||
*/ | ||
initialize(disableAppendToExistingFile) { | ||
initialize(disableAppendToExistingFile, performanceResultsDirectory) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this._resultsDir = yield this.createResultsDirIfNotExist(); | ||
this._resultsDir = yield this.createResultsDirIfNotExist(performanceResultsDirectory); | ||
const initObj = JSON.stringify({ "startDisplayTime": new Date().toLocaleString(), "instanceID": this._instanceid }); | ||
@@ -78,6 +78,12 @@ const fileName = path_1.default.join(this._resultsDir, this.logFileName); | ||
} | ||
createResultsDirIfNotExist() { | ||
createResultsDirIfNotExist(resultsPath) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const resultsDir = "performance-results"; | ||
let npath = ""; | ||
let isNotLegal = true; | ||
if (resultsPath) { | ||
isNotLegal = /[*."\[\]:;|,]/g.test(resultsPath); | ||
npath = path_1.default.normalize(resultsPath); | ||
} | ||
const resultsDir = npath == undefined || npath == "" || isNotLegal ? "performance-results" : npath; | ||
const root = (_a = require.main) === null || _a === void 0 ? void 0 : _a.paths[0].split('node_modules')[0].slice(0, -1); | ||
@@ -84,0 +90,0 @@ if (!root) { |
@@ -9,2 +9,3 @@ /// <reference types="@wdio/sync/webdriverio-core" /> | ||
dropResultsFromFailedTest: boolean; | ||
performanceResultsDirectory: string; | ||
}; | ||
@@ -25,2 +26,3 @@ /** | ||
dropResultsFromFailedTest: boolean; | ||
performanceResultsDirectory: string; | ||
}, capabilities: any, config: any, browser: WebdriverIO.Browser); | ||
@@ -27,0 +29,0 @@ before(config: any, capabilities: any): void; |
@@ -36,3 +36,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield performance_total_1.default.initialize(this._serviceOptions.disableAppendToExistingFile); | ||
yield performance_total_1.default.initialize(this._serviceOptions.disableAppendToExistingFile, this._serviceOptions.performanceResultsDirectory); | ||
}); | ||
@@ -39,0 +39,0 @@ } |
{ | ||
"name": "wdio-performancetotal-service", | ||
"version": "1.0.8", | ||
"version": "1.0.9-0", | ||
"description": "WebdriverIO service for analyzing test flow performance", | ||
@@ -5,0 +5,0 @@ "main": "build/app.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
34623
711
3