wdio-reportportal-reporter
Advanced tools
Comparing version 6.0.0 to 6.0.1-alpha
@@ -13,2 +13,3 @@ import { STATUS, TYPE } from "./constants"; | ||
addTags(): void; | ||
addSauseLabId(id: string): void; | ||
} | ||
@@ -15,0 +16,0 @@ export declare class EndTestItem { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ReporterOptions_1 = require("./ReporterOptions"); | ||
const utils_1 = require("./utils"); | ||
const ReporterOptions_1 = require("./ReporterOptions"); | ||
class StartTestItem { | ||
@@ -23,2 +23,7 @@ constructor(name, type) { | ||
} | ||
addSauseLabId(id) { | ||
if (id) { | ||
this.attributes.push({ key: "SLID", value: id }); | ||
} | ||
} | ||
} | ||
@@ -25,0 +30,0 @@ exports.StartTestItem = StartTestItem; |
@@ -19,2 +19,3 @@ import Reporter from "@wdio/reporter"; | ||
private sanitizedCapabilities; | ||
private sessionId; | ||
private rpPromisesCompleted; | ||
@@ -21,0 +22,0 @@ private specFile; |
@@ -122,2 +122,5 @@ "use strict"; | ||
} | ||
if (this.options.isSauseLabRun) { | ||
testStartObj.addSauseLabId(this.sessionId); | ||
} | ||
if (this.options.setRetryTrue) { | ||
@@ -183,2 +186,3 @@ testStartObj.retry = true; | ||
this.sanitizedCapabilities = runner.sanitizedCapabilities; | ||
this.sessionId = runner.sessionId; | ||
this.client = client || new ReportPortalClient(this.options.reportPortalClientConfig); | ||
@@ -188,6 +192,6 @@ this.launchId = process.env.RP_LAUNCH_ID; | ||
const startLaunchObj = { | ||
attributes: this.options.reportPortalClientConfig.attributes, | ||
description: this.options.reportPortalClientConfig.description, | ||
id: this.launchId, | ||
mode: this.options.reportPortalClientConfig.mode, | ||
attributes: this.options.reportPortalClientConfig.attributes, | ||
}; | ||
@@ -194,0 +198,0 @@ const { tempId } = this.client.startLaunch(startLaunchObj); |
@@ -15,2 +15,3 @@ import { LEVEL, MODE } from "./constants"; | ||
setRetryTrue: boolean; | ||
isSauseLabRun: boolean; | ||
cucumberNestedSteps: boolean; | ||
@@ -17,0 +18,0 @@ autoAttachCucumberFeatureToScenario: boolean; |
@@ -20,2 +20,3 @@ "use strict"; | ||
this.setRetryTrue = false; | ||
this.isSauseLabRun = false; | ||
this.cucumberNestedSteps = false; | ||
@@ -22,0 +23,0 @@ this.autoAttachCucumberFeatureToScenario = false; |
@@ -0,4 +1,4 @@ | ||
import {Attribute} from "../../build/ReporterOptions"; | ||
import {MODE} from "../constants"; | ||
import {getOptions, RPClient} from "./reportportal-client.mock"; | ||
import {Attribute} from "../../build/ReporterOptions"; | ||
@@ -27,6 +27,6 @@ const Reporter = require("../../build/reporter"); | ||
const launchObj = { | ||
attributes: options.reportPortalClientConfig.attributes, | ||
description: options.reportPortalClientConfig.description, | ||
id: REAL_LAUNCH_ID, | ||
mode: options.reportPortalClientConfig.mode, | ||
attributes: options.reportPortalClientConfig.attributes, | ||
}; | ||
@@ -53,6 +53,6 @@ expect(reporter.client.startLaunch).toBeCalledWith(launchObj); | ||
const launchObj = { | ||
attributes: options.reportPortalClientConfig.attributes, | ||
description: options.reportPortalClientConfig.description, | ||
id: REAL_LAUNCH_ID, | ||
mode: options.reportPortalClientConfig.mode, | ||
attributes: options.reportPortalClientConfig.attributes, | ||
}; | ||
@@ -59,0 +59,0 @@ expect(reporter.client.startLaunch).toBeCalledWith(launchObj); |
@@ -0,0 +0,0 @@ import {CUCUMBER_TYPE, TYPE} from "../constants"; |
@@ -24,2 +24,13 @@ import {TYPE} from "../constants"; | ||
test("should add SauseLab id", () => { | ||
const testStartObj = new StartTestItem("foo", TYPE.STEP); | ||
testStartObj.addSauseLabId("foo"); | ||
expect(testStartObj.attributes).toEqual([{key: "SLID", value: "foo"}]); | ||
}); | ||
test("should not add SauseLab id is empty", () => { | ||
const testStartObj = new StartTestItem("foo", TYPE.STEP); | ||
testStartObj.addSauseLabId(null); | ||
expect(testStartObj.attributes).toEqual([]); | ||
}); | ||
}); |
import {STATUS, TYPE} from "./constants"; | ||
import {Attribute} from "./ReporterOptions"; | ||
import {parseTags} from "./utils"; | ||
import {Attribute} from "./ReporterOptions"; | ||
@@ -30,2 +30,8 @@ export class StartTestItem { | ||
} | ||
public addSauseLabId(id: string) { | ||
if (id) { | ||
this.attributes.push({key: "SLID", value: id}); | ||
} | ||
} | ||
} | ||
@@ -32,0 +38,0 @@ |
@@ -52,2 +52,3 @@ import logger from "@wdio/logger"; | ||
private sanitizedCapabilities: string; | ||
private sessionId: string; | ||
private rpPromisesCompleted = false; | ||
@@ -148,2 +149,5 @@ private specFile: string; | ||
} | ||
if (this.options.isSauseLabRun) { | ||
testStartObj.addSauseLabId(this.sessionId); | ||
} | ||
if (this.options.setRetryTrue) { | ||
@@ -224,2 +228,3 @@ testStartObj.retry = true; | ||
this.sanitizedCapabilities = runner.sanitizedCapabilities; | ||
this.sessionId = runner.sessionId; | ||
this.client = client || new ReportPortalClient(this.options.reportPortalClientConfig); | ||
@@ -229,6 +234,6 @@ this.launchId = process.env.RP_LAUNCH_ID; | ||
const startLaunchObj = { | ||
attributes: this.options.reportPortalClientConfig.attributes, | ||
description: this.options.reportPortalClientConfig.description, | ||
id: this.launchId, | ||
mode: this.options.reportPortalClientConfig.mode, | ||
attributes: this.options.reportPortalClientConfig.attributes, | ||
}; | ||
@@ -235,0 +240,0 @@ const {tempId} = this.client.startLaunch(startLaunchObj); |
@@ -21,2 +21,3 @@ import {LEVEL, MODE} from "./constants"; | ||
public setRetryTrue = false; | ||
public isSauseLabRun = false; | ||
public cucumberNestedSteps = false; | ||
@@ -23,0 +24,0 @@ public autoAttachCucumberFeatureToScenario = false; |
{ | ||
"name": "wdio-reportportal-reporter", | ||
"version": "6.0.0", | ||
"version": "6.0.1-alpha", | ||
"description": "A WebdriverIO v5 plugin. Report results to Report Portal.", | ||
@@ -5,0 +5,0 @@ "main": "build/reporter.js", |
@@ -0,0 +0,0 @@ WDIO Report Portal Reporter |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
78137
1831
1