@empiricalrun/reporter
Advanced tools
Comparing version 0.6.4 to 0.6.5
# @empiricalrun/reporter | ||
## 0.6.5 | ||
### Patch Changes | ||
- 5fbf862: feat(reporter): add platform in slack message | ||
## 0.6.4 | ||
@@ -4,0 +10,0 @@ |
@@ -25,3 +25,3 @@ "use strict"; | ||
const message = { | ||
text: "Tests started", | ||
text: `Tests started for ${(0, utils_1.cleanName)(this.reportSource.platform())}`, | ||
attachments: [ | ||
@@ -49,3 +49,3 @@ { | ||
const message = { | ||
text: "Tests were not run", | ||
text: `Tests were not run for ${(0, utils_1.cleanName)(this.reportSource.platform())}`, | ||
attachments: [ | ||
@@ -74,3 +74,3 @@ { | ||
const message = { | ||
text: "Tests completed", | ||
text: `Tests completed for ${(0, utils_1.cleanName)(this.reportSource.platform())}`, | ||
attachments: [ | ||
@@ -77,0 +77,0 @@ { |
@@ -1,2 +0,2 @@ | ||
import { BaseReportSource, ReportFilter } from "./base"; | ||
import { BaseReportSource, Platform, ReportFilter } from "./base"; | ||
export declare class AppiumReportSource implements BaseReportSource { | ||
@@ -7,2 +7,3 @@ private repoName; | ||
constructor(repoName: string, runId: string); | ||
platform(): Platform.Android | Platform.iOS; | ||
reportExists(): boolean; | ||
@@ -9,0 +10,0 @@ resultsSummary(): { |
@@ -18,2 +18,6 @@ "use strict"; | ||
} | ||
platform() { | ||
const report = (0, utils_1.parseJsonReport)(this.srcFile); | ||
return report.results.environment.osPlatform.toLowerCase(); | ||
} | ||
reportExists() { | ||
@@ -45,5 +49,3 @@ return fs_1.default.existsSync(this.srcFile); | ||
buildReportLink(filter) { | ||
const report = (0, utils_1.parseJsonReport)(this.srcFile); | ||
const platform = report.results.environment.osPlatform.toLowerCase(); | ||
const base = `https://reports.empirical.run/${this.repoName}/mobile/${this.runId}/${platform}/index.html`; | ||
const base = `https://reports.empirical.run/${this.repoName}/mobile/${this.runId}/${this.platform}/index.html`; | ||
if (filter && "status" in filter) { | ||
@@ -50,0 +52,0 @@ return `${base}#?q=s:${filter.status}`; |
@@ -15,3 +15,9 @@ export type Results = { | ||
}; | ||
export declare enum Platform { | ||
Web = "web", | ||
Android = "android", | ||
iOS = "ios" | ||
} | ||
export interface BaseReportSource { | ||
platform(): Platform; | ||
reportExists(): boolean; | ||
@@ -18,0 +24,0 @@ resultsSummary(): Results; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Platform = void 0; | ||
var Platform; | ||
(function (Platform) { | ||
Platform["Web"] = "web"; | ||
Platform["Android"] = "android"; | ||
Platform["iOS"] = "ios"; | ||
})(Platform || (exports.Platform = Platform = {})); |
@@ -1,2 +0,2 @@ | ||
import { BaseReportSource, FailedTestWithLink } from "./base"; | ||
import { BaseReportSource, FailedTestWithLink, Platform } from "./base"; | ||
type PlaywrightReportFilter = { | ||
@@ -12,2 +12,3 @@ status: string; | ||
constructor(repoName: string, runId: string); | ||
platform(): Platform; | ||
reportExists(): boolean; | ||
@@ -14,0 +15,0 @@ resultsSummary(): { |
@@ -10,2 +10,3 @@ "use strict"; | ||
const utils_1 = require("../utils"); | ||
const base_1 = require("./base"); | ||
class PlaywrightReportSource { | ||
@@ -19,2 +20,5 @@ repoName; | ||
} | ||
platform() { | ||
return base_1.Platform.Web; | ||
} | ||
reportExists() { | ||
@@ -21,0 +25,0 @@ return fs_1.default.existsSync(this.srcFile); |
@@ -0,3 +1,5 @@ | ||
import { Platform } from "./sources/base"; | ||
export declare function humanReadable(duration: number): string; | ||
export declare function parseJsonReport<T>(srcFile: string): T; | ||
export declare function cleanName(platform: Platform): string; | ||
/** | ||
@@ -4,0 +6,0 @@ * method to generate github action run link using `runId` and `repoName` |
@@ -6,3 +6,10 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getGhEventPrLink = exports.isRunningForAutomatedPR = exports.getGhEventPullNumber = exports.getGhEvent = exports.buildGhRunLink = exports.parseJsonReport = exports.humanReadable = void 0; | ||
exports.humanReadable = humanReadable; | ||
exports.parseJsonReport = parseJsonReport; | ||
exports.cleanName = cleanName; | ||
exports.buildGhRunLink = buildGhRunLink; | ||
exports.getGhEvent = getGhEvent; | ||
exports.getGhEventPullNumber = getGhEventPullNumber; | ||
exports.isRunningForAutomatedPR = isRunningForAutomatedPR; | ||
exports.getGhEventPrLink = getGhEventPrLink; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -15,7 +22,13 @@ function humanReadable(duration) { | ||
} | ||
exports.humanReadable = humanReadable; | ||
function parseJsonReport(srcFile) { | ||
return JSON.parse(fs_1.default.readFileSync(srcFile, { encoding: "utf-8" })); | ||
} | ||
exports.parseJsonReport = parseJsonReport; | ||
function cleanName(platform) { | ||
const map = { | ||
web: "Web", | ||
android: "Android", | ||
ios: "iOS", | ||
}; | ||
return map[platform]; | ||
} | ||
/** | ||
@@ -31,3 +44,2 @@ * method to generate github action run link using `runId` and `repoName` | ||
} | ||
exports.buildGhRunLink = buildGhRunLink; | ||
/** | ||
@@ -44,3 +56,2 @@ * | ||
} | ||
exports.getGhEvent = getGhEvent; | ||
/** | ||
@@ -56,3 +67,2 @@ * | ||
} | ||
exports.getGhEventPullNumber = getGhEventPullNumber; | ||
function isRunningForAutomatedPR() { | ||
@@ -66,3 +76,2 @@ const event = getGhEvent(); | ||
} | ||
exports.isRunningForAutomatedPR = isRunningForAutomatedPR; | ||
/** | ||
@@ -79,2 +88,1 @@ * | ||
} | ||
exports.getGhEventPrLink = getGhEventPrLink; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getWorkflow = void 0; | ||
exports.getWorkflow = getWorkflow; | ||
const types_1 = require("../types"); | ||
@@ -21,2 +21,1 @@ const test_generation_1 = require("./test-generation"); | ||
} | ||
exports.getWorkflow = getWorkflow; |
{ | ||
"name": "@empiricalrun/reporter", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "registry": "https://registry.npmjs.org/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45257
1067