@rpii/wdio-report-events
Advanced tools
Comparing version 0.1.4 to 0.2.0
export default class ReportEvents { | ||
logMessage(message: string): any; | ||
logScreenshot(filename: string): any; | ||
videoCapture(filename: string): this; | ||
connectMessageEvent(fn: any): any; | ||
connectScreenshotEvent(fn: any): any; | ||
connectVideoCaptureEvent(fn: any): this; | ||
} |
@@ -14,2 +14,7 @@ "use strict"; | ||
; | ||
videoCapture(filename) { | ||
process.emit('test:video-capture', filename); | ||
return this; | ||
} | ||
; | ||
connectMessageEvent(fn) { | ||
@@ -25,3 +30,8 @@ process.on('test:log', fn); | ||
; | ||
connectVideoCaptureEvent(fn) { | ||
process.on('test:video-capture', fn); | ||
return this; | ||
} | ||
; | ||
} | ||
exports.default = ReportEvents; |
{ | ||
"name": "@rpii/wdio-report-events", | ||
"version": "0.1.4", | ||
"description": "Abstracts the event driven messaging to pass screenshots and log data to webdriverio reports", | ||
"version": "0.2.0", | ||
"description": "Abstracts the event driven messaging to pass screenshots, videos and log data to the report module", | ||
"main": "lib/wdio-report-events", | ||
@@ -6,0 +6,0 @@ "types": "lib/wdio-report-events.d.ts", |
@@ -12,2 +12,6 @@ import ReportEvents from "../src/wdio-report-events" ; | ||
saveVideo(filepath:string ) { | ||
console.log("video capture event sink:" + filepath) ; | ||
expect(true,"video capture event fired:" + filepath) ; | ||
} | ||
saveMessage(message:string) { | ||
@@ -24,2 +28,3 @@ console.log("message event sink:" + message) | ||
proxy.connectScreenshotEvent(eventSink.saveScreenshot.bind(this)); | ||
proxy.connectVideoCaptureEvent(eventSink.saveVideo.bind(this)); | ||
test('fire log message', function () { | ||
@@ -34,2 +39,6 @@ console.log("firing message event") ; | ||
}); | ||
test('fire video capture', function () { | ||
console.log("firing video capture event") ; | ||
proxy.videoCapture("test.mp4"); | ||
}); | ||
}); |
4439
103