angles-javascript-client 1.0.14 → 1.0.15
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.
- package/README.md +0 -33
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/dist/integrations/wdio/AnglesWDIOReporter.d.ts +0 -30
- package/dist/integrations/wdio/AnglesWDIOReporter.js +0 -78
- package/dist/integrations/wdio/AnglesWDIOReporter.js.map +0 -1
package/README.md
CHANGED
|
@@ -66,36 +66,3 @@ const environmentRequests = new EnvironmentRequests(axios);
|
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
To see more details about Angles Dashboard and e.g. how to set it up, have a look at our documentation on our [github](https://angleshq.github.io/) page.
|
|
69
|
-
|
|
70
|
-
### Integrations
|
|
71
|
-
|
|
72
|
-
#### WebDriverIO
|
|
73
|
-
To integrate the Angles Dashboard with your webdriverIO test, we have set-up a customer reporter [AnglesWDIOReporter](/src/integrations/wdio/AnglesWDIOReporter.ts), which you can configure by adding the following custom reporter config to your **wdio.conf.ts** file. A full example of this can be found in our [webdriverio-example](https://github.com/AnglesHQ/webdriverio-example) project.
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
{
|
|
77
|
-
reporters: [
|
|
78
|
-
[
|
|
79
|
-
AnglesWDIOReporter,
|
|
80
|
-
{
|
|
81
|
-
enabled: true,
|
|
82
|
-
baseUrl: 'http://127.0.0.1:3000/rest/api/v1.0/',
|
|
83
|
-
reportingUrl: 'http://127.0.0.1:3001',
|
|
84
|
-
team: 'angles',
|
|
85
|
-
environment: 'qa',
|
|
86
|
-
component: 'wdio-example',
|
|
87
|
-
phase: 'crossbrowser',
|
|
88
|
-
artifacts: [
|
|
89
|
-
{
|
|
90
|
-
groupId: 'anglesHQ',
|
|
91
|
-
artifactId: 'angles-ui',
|
|
92
|
-
version: '1.0.0'
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
More integration examples to come.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { ScreenshotRequests } from './lib/requests/ScreenshotRequests';
|
|
|
6
6
|
import { ExecutionRequests } from './lib/requests/ExecutionRequests';
|
|
7
7
|
import { BaselineRequests } from './lib/requests/BaselineRequests';
|
|
8
8
|
import { MetricRequests } from './lib/requests/MetricRequests';
|
|
9
|
-
|
|
10
|
-
export { BuildRequests, TeamRequests, EnvironmentRequests, ScreenshotRequests, ExecutionRequests, BaselineRequests, MetricRequests, AnglesWDIOReporter };
|
|
9
|
+
export { BuildRequests, TeamRequests, EnvironmentRequests, ScreenshotRequests, ExecutionRequests, BaselineRequests, MetricRequests };
|
|
11
10
|
declare const _default: AnglesReporterClass;
|
|
12
11
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MetricRequests = exports.BaselineRequests = exports.ExecutionRequests = exports.ScreenshotRequests = exports.EnvironmentRequests = exports.TeamRequests = exports.BuildRequests = void 0;
|
|
4
4
|
const AnglesReporter_1 = require("./lib/AnglesReporter");
|
|
5
5
|
const BuildRequests_1 = require("./lib/requests/BuildRequests");
|
|
6
6
|
Object.defineProperty(exports, "BuildRequests", { enumerable: true, get: function () { return BuildRequests_1.BuildRequests; } });
|
|
@@ -16,7 +16,5 @@ const BaselineRequests_1 = require("./lib/requests/BaselineRequests");
|
|
|
16
16
|
Object.defineProperty(exports, "BaselineRequests", { enumerable: true, get: function () { return BaselineRequests_1.BaselineRequests; } });
|
|
17
17
|
const MetricRequests_1 = require("./lib/requests/MetricRequests");
|
|
18
18
|
Object.defineProperty(exports, "MetricRequests", { enumerable: true, get: function () { return MetricRequests_1.MetricRequests; } });
|
|
19
|
-
const AnglesWDIOReporter_1 = require("./integrations/wdio/AnglesWDIOReporter");
|
|
20
|
-
Object.defineProperty(exports, "AnglesWDIOReporter", { enumerable: true, get: function () { return AnglesWDIOReporter_1.AnglesWDIOReporter; } });
|
|
21
19
|
exports.default = AnglesReporter_1.AnglesReporterClass.getInstance();
|
|
22
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA2D;AAC3D,gEAA6D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA2D;AAC3D,gEAA6D;AAS3D,8FATO,6BAAa,OASP;AARf,8DAA2D;AASzD,6FATO,2BAAY,OASP;AARd,4EAAyE;AASvE,oGATO,yCAAmB,OASP;AARrB,0EAAuE;AASrE,mGATO,uCAAkB,OASP;AARpB,wEAAqE;AASnE,kGATO,qCAAiB,OASP;AARnB,sEAAkE;AAShE,iGATO,mCAAgB,OASP;AARlB,kEAA8D;AAS5D,+FATO,+BAAc,OASP;AAEhB,kBAAe,oCAAmB,CAAC,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angles-javascript-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "This is the javascript client for the Angles Dashboard. It allows you to store your test results.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"bugs": {
|
|
28
28
|
"url": "https://github.com/AnglesHQ/angles-javascript-client/issues"
|
|
29
29
|
},
|
|
30
|
-
"homepage": "https://github.
|
|
30
|
+
"homepage": "https://angleshq.github.io",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wdio/spec-reporter": "^7.16.3",
|
|
33
32
|
"axios": "^0.21.2",
|
|
34
33
|
"form-data": "^4.0.0",
|
|
35
34
|
"fs": "^0.0.1-security",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import WDIOReporter from '@wdio/reporter';
|
|
2
|
-
import { Artifact } from '../../lib/models/Artifact';
|
|
3
|
-
export declare class AnglesWDIOReporter extends WDIOReporter {
|
|
4
|
-
isEnabled: boolean;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
reportingUrl: string;
|
|
7
|
-
buildName: string;
|
|
8
|
-
team: string;
|
|
9
|
-
environment: string;
|
|
10
|
-
component: string;
|
|
11
|
-
phase: string;
|
|
12
|
-
artifacts: Artifact[];
|
|
13
|
-
constructor(options: any);
|
|
14
|
-
onRunnerStart(): Promise<void>;
|
|
15
|
-
onTestStart(test: {
|
|
16
|
-
title: string;
|
|
17
|
-
parent: string;
|
|
18
|
-
}): Promise<void>;
|
|
19
|
-
onTestPass(test: {
|
|
20
|
-
title: any;
|
|
21
|
-
}): Promise<void>;
|
|
22
|
-
onTestFail(test: {
|
|
23
|
-
title: any;
|
|
24
|
-
}): Promise<void>;
|
|
25
|
-
onTestSkip(test: {
|
|
26
|
-
title: any;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
onTestEnd(): Promise<void>;
|
|
29
|
-
onRunnerEnd(): void;
|
|
30
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AnglesWDIOReporter = void 0;
|
|
7
|
-
/* tslint:disable:no-console */
|
|
8
|
-
const reporter_1 = __importDefault(require("@wdio/reporter"));
|
|
9
|
-
const index_1 = __importDefault(require("../../index"));
|
|
10
|
-
const Artifact_1 = require("../../lib/models/Artifact");
|
|
11
|
-
class AnglesWDIOReporter extends reporter_1.default {
|
|
12
|
-
constructor(options) {
|
|
13
|
-
super(options);
|
|
14
|
-
this.isEnabled = options.enabled || true;
|
|
15
|
-
this.baseUrl = options.baseUrl || 'http://127.0.0.1:3000/rest/api/v1.0/';
|
|
16
|
-
this.reportingUrl = options.reportingUrl || 'http://127.0.0.1:3001';
|
|
17
|
-
this.buildName = options.buildName || 'Test Automation Run';
|
|
18
|
-
this.team = options.team || 'angles';
|
|
19
|
-
this.environment = options.environment || 'qa';
|
|
20
|
-
this.component = options.component || 'wdio-example';
|
|
21
|
-
this.phase = options.phase || undefined;
|
|
22
|
-
this.artifacts = options.artifacts || undefined;
|
|
23
|
-
index_1.default.setBaseUrl(this.baseUrl);
|
|
24
|
-
index_1.default.startBuild(this.buildName, this.team, this.environment, this.component, this.phase).then((build) => {
|
|
25
|
-
process.env.ANGLES_ID = build._id;
|
|
26
|
-
console.log(`Created build with id ${process.env.ANGLES_ID} in Angles`);
|
|
27
|
-
if (this.artifacts) {
|
|
28
|
-
const artifactArray = [];
|
|
29
|
-
this.artifacts.forEach((artifact) => {
|
|
30
|
-
const { groupId, artifactId, version } = artifact;
|
|
31
|
-
artifactArray.push(new Artifact_1.Artifact(groupId, artifactId, version));
|
|
32
|
-
});
|
|
33
|
-
index_1.default.addArtifacts(artifactArray).then((buildWithArtifacts) => {
|
|
34
|
-
console.log(`Stored artifacts for build ${buildWithArtifacts._id}`);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async onRunnerStart() {
|
|
40
|
-
if (this.isEnabled) {
|
|
41
|
-
index_1.default.setBaseUrl(this.baseUrl);
|
|
42
|
-
await index_1.default.setCurrentBuild(process.env.ANGLES_ID);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
async onTestStart(test) {
|
|
46
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
47
|
-
index_1.default.startTest(test.title, test.parent);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async onTestPass(test) {
|
|
51
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
52
|
-
index_1.default.pass(`Test ${test.title} has passed`, 'Test Passed', 'Test Passed', '');
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
async onTestFail(test) {
|
|
56
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
57
|
-
index_1.default.fail(`Test ${test.title} has failed`, 'Test Passed', 'Test Failed', '');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
async onTestSkip(test) {
|
|
61
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
62
|
-
index_1.default.info(`Test ${test.title} has skipped`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async onTestEnd() {
|
|
66
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
67
|
-
await index_1.default.saveTest();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
onRunnerEnd() {
|
|
71
|
-
if (this.isEnabled && process.env.ANGLES_ID) {
|
|
72
|
-
console.info(`Angles Dashboard Results: ${this.reportingUrl}/build/?buildId=${process.env.ANGLES_ID}`);
|
|
73
|
-
process.env.ANGLES_ID = undefined;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.AnglesWDIOReporter = AnglesWDIOReporter;
|
|
78
|
-
//# sourceMappingURL=AnglesWDIOReporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnglesWDIOReporter.js","sourceRoot":"","sources":["../../../src/integrations/wdio/AnglesWDIOReporter.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,8DAAyC;AACzC,wDAAyC;AACzC,wDAAmD;AAEnD,MAAa,kBAAmB,SAAQ,kBAAY;IAYlD,YAAY,OAAY;QACtB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,SAAS,GAA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