@bigbinary/neeto-playwright-reporter 1.5.2 → 1.5.4
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/index.cjs.js +246 -18
- package/index.cjs.js.map +1 -1
- package/index.js +246 -18
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -809,10 +809,233 @@ function _includes(a, list) {
|
|
|
809
809
|
return _indexOf(list, a, 0) >= 0;
|
|
810
810
|
}
|
|
811
811
|
|
|
812
|
+
function _map(fn, functor) {
|
|
813
|
+
var idx = 0;
|
|
814
|
+
var len = functor.length;
|
|
815
|
+
var result = Array(len);
|
|
816
|
+
|
|
817
|
+
while (idx < len) {
|
|
818
|
+
result[idx] = fn(functor[idx]);
|
|
819
|
+
idx += 1;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
return result;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
function _arrayReduce(reducer, acc, list) {
|
|
826
|
+
var index = 0;
|
|
827
|
+
var length = list.length;
|
|
828
|
+
|
|
829
|
+
while (index < length) {
|
|
830
|
+
acc = reducer(acc, list[index]);
|
|
831
|
+
index += 1;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
return acc;
|
|
835
|
+
}
|
|
836
|
+
|
|
812
837
|
function _isObject(x) {
|
|
813
838
|
return Object.prototype.toString.call(x) === '[object Object]';
|
|
814
839
|
}
|
|
815
840
|
|
|
841
|
+
var XMap =
|
|
842
|
+
/*#__PURE__*/
|
|
843
|
+
function () {
|
|
844
|
+
function XMap(f, xf) {
|
|
845
|
+
this.xf = xf;
|
|
846
|
+
this.f = f;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
XMap.prototype['@@transducer/init'] = _xfBase.init;
|
|
850
|
+
XMap.prototype['@@transducer/result'] = _xfBase.result;
|
|
851
|
+
|
|
852
|
+
XMap.prototype['@@transducer/step'] = function (result, input) {
|
|
853
|
+
return this.xf['@@transducer/step'](result, this.f(input));
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
return XMap;
|
|
857
|
+
}();
|
|
858
|
+
|
|
859
|
+
var _xmap = function _xmap(f) {
|
|
860
|
+
return function (xf) {
|
|
861
|
+
return new XMap(f, xf);
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Takes a function and
|
|
867
|
+
* a [functor](https://github.com/fantasyland/fantasy-land#functor),
|
|
868
|
+
* applies the function to each of the functor's values, and returns
|
|
869
|
+
* a functor of the same shape.
|
|
870
|
+
*
|
|
871
|
+
* Ramda provides suitable `map` implementations for `Array` and `Object`,
|
|
872
|
+
* so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.
|
|
873
|
+
*
|
|
874
|
+
* Dispatches to the `map` method of the second argument, if present.
|
|
875
|
+
*
|
|
876
|
+
* Acts as a transducer if a transformer is given in list position.
|
|
877
|
+
*
|
|
878
|
+
* Also treats functions as functors and will compose them together.
|
|
879
|
+
*
|
|
880
|
+
* @func
|
|
881
|
+
* @memberOf R
|
|
882
|
+
* @since v0.1.0
|
|
883
|
+
* @category List
|
|
884
|
+
* @sig Functor f => (a -> b) -> f a -> f b
|
|
885
|
+
* @param {Function} fn The function to be called on every element of the input `list`.
|
|
886
|
+
* @param {Array} list The list to be iterated over.
|
|
887
|
+
* @return {Array} The new list.
|
|
888
|
+
* @see R.transduce, R.addIndex, R.pluck, R.project
|
|
889
|
+
* @example
|
|
890
|
+
*
|
|
891
|
+
* const double = x => x * 2;
|
|
892
|
+
*
|
|
893
|
+
* R.map(double, [1, 2, 3]); //=> [2, 4, 6]
|
|
894
|
+
*
|
|
895
|
+
* R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}
|
|
896
|
+
* @symb R.map(f, [a, b]) = [f(a), f(b)]
|
|
897
|
+
* @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }
|
|
898
|
+
* @symb R.map(f, functor_o) = functor_o.map(f)
|
|
899
|
+
*/
|
|
900
|
+
|
|
901
|
+
var map =
|
|
902
|
+
/*#__PURE__*/
|
|
903
|
+
_curry2(
|
|
904
|
+
/*#__PURE__*/
|
|
905
|
+
_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
906
|
+
switch (Object.prototype.toString.call(functor)) {
|
|
907
|
+
case '[object Function]':
|
|
908
|
+
return curryN(functor.length, function () {
|
|
909
|
+
return fn.call(this, functor.apply(this, arguments));
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
case '[object Object]':
|
|
913
|
+
return _arrayReduce(function (acc, key) {
|
|
914
|
+
acc[key] = fn(functor[key]);
|
|
915
|
+
return acc;
|
|
916
|
+
}, {}, keys(functor));
|
|
917
|
+
|
|
918
|
+
default:
|
|
919
|
+
return _map(fn, functor);
|
|
920
|
+
}
|
|
921
|
+
}));
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Determine if the passed argument is an integer.
|
|
925
|
+
*
|
|
926
|
+
* @private
|
|
927
|
+
* @param {*} n
|
|
928
|
+
* @category Type
|
|
929
|
+
* @return {Boolean}
|
|
930
|
+
*/
|
|
931
|
+
var _isInteger = Number.isInteger || function _isInteger(n) {
|
|
932
|
+
return n << 0 === n;
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
function _isString(x) {
|
|
936
|
+
return Object.prototype.toString.call(x) === '[object String]';
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Returns the nth element of the given list or string. If n is negative the
|
|
941
|
+
* element at index length + n is returned.
|
|
942
|
+
*
|
|
943
|
+
* @func
|
|
944
|
+
* @memberOf R
|
|
945
|
+
* @since v0.1.0
|
|
946
|
+
* @category List
|
|
947
|
+
* @sig Number -> [a] -> a | Undefined
|
|
948
|
+
* @sig Number -> String -> String
|
|
949
|
+
* @param {Number} offset
|
|
950
|
+
* @param {*} list
|
|
951
|
+
* @return {*}
|
|
952
|
+
* @example
|
|
953
|
+
*
|
|
954
|
+
* const list = ['foo', 'bar', 'baz', 'quux'];
|
|
955
|
+
* R.nth(1, list); //=> 'bar'
|
|
956
|
+
* R.nth(-1, list); //=> 'quux'
|
|
957
|
+
* R.nth(-99, list); //=> undefined
|
|
958
|
+
*
|
|
959
|
+
* R.nth(2, 'abc'); //=> 'c'
|
|
960
|
+
* R.nth(3, 'abc'); //=> ''
|
|
961
|
+
* @symb R.nth(-1, [a, b, c]) = c
|
|
962
|
+
* @symb R.nth(0, [a, b, c]) = a
|
|
963
|
+
* @symb R.nth(1, [a, b, c]) = b
|
|
964
|
+
*/
|
|
965
|
+
|
|
966
|
+
var nth =
|
|
967
|
+
/*#__PURE__*/
|
|
968
|
+
_curry2(function nth(offset, list) {
|
|
969
|
+
var idx = offset < 0 ? list.length + offset : offset;
|
|
970
|
+
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Returns a function that when supplied an object returns the indicated
|
|
975
|
+
* property of that object, if it exists.
|
|
976
|
+
*
|
|
977
|
+
* @func
|
|
978
|
+
* @memberOf R
|
|
979
|
+
* @since v0.1.0
|
|
980
|
+
* @category Object
|
|
981
|
+
* @typedefn Idx = String | Int | Symbol
|
|
982
|
+
* @sig Idx -> {s: a} -> a | Undefined
|
|
983
|
+
* @param {String|Number} p The property name or array index
|
|
984
|
+
* @param {Object} obj The object to query
|
|
985
|
+
* @return {*} The value at `obj.p`.
|
|
986
|
+
* @see R.path, R.props, R.pluck, R.project, R.nth
|
|
987
|
+
* @example
|
|
988
|
+
*
|
|
989
|
+
* R.prop('x', {x: 100}); //=> 100
|
|
990
|
+
* R.prop('x', {}); //=> undefined
|
|
991
|
+
* R.prop(0, [100]); //=> 100
|
|
992
|
+
* R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4
|
|
993
|
+
*/
|
|
994
|
+
|
|
995
|
+
var prop =
|
|
996
|
+
/*#__PURE__*/
|
|
997
|
+
_curry2(function prop(p, obj) {
|
|
998
|
+
if (obj == null) {
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return _isInteger(p) ? nth(p, obj) : obj[p];
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Returns a new list by plucking the same named property off all objects in
|
|
1007
|
+
* the list supplied.
|
|
1008
|
+
*
|
|
1009
|
+
* `pluck` will work on
|
|
1010
|
+
* any [functor](https://github.com/fantasyland/fantasy-land#functor) in
|
|
1011
|
+
* addition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.
|
|
1012
|
+
*
|
|
1013
|
+
* @func
|
|
1014
|
+
* @memberOf R
|
|
1015
|
+
* @since v0.1.0
|
|
1016
|
+
* @category List
|
|
1017
|
+
* @sig Functor f => k -> f {k: v} -> f v
|
|
1018
|
+
* @param {Number|String} key The key name to pluck off of each object.
|
|
1019
|
+
* @param {Array} f The array or functor to consider.
|
|
1020
|
+
* @return {Array} The list of values for the given key.
|
|
1021
|
+
* @see R.project, R.prop, R.props
|
|
1022
|
+
* @example
|
|
1023
|
+
*
|
|
1024
|
+
* var getAges = R.pluck('age');
|
|
1025
|
+
* getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]
|
|
1026
|
+
*
|
|
1027
|
+
* R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]
|
|
1028
|
+
* R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}
|
|
1029
|
+
* @symb R.pluck('x', [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]
|
|
1030
|
+
* @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]
|
|
1031
|
+
*/
|
|
1032
|
+
|
|
1033
|
+
var pluck =
|
|
1034
|
+
/*#__PURE__*/
|
|
1035
|
+
_curry2(function pluck(p, list) {
|
|
1036
|
+
return map(prop(p), list);
|
|
1037
|
+
});
|
|
1038
|
+
|
|
816
1039
|
/**
|
|
817
1040
|
* Checks if the input value is `null` or `undefined`.
|
|
818
1041
|
*
|
|
@@ -2204,11 +2427,9 @@ class ConsoleLogFormatted {
|
|
|
2204
2427
|
}
|
|
2205
2428
|
createMethod(logLevel, ansiFormatter) {
|
|
2206
2429
|
this[logLevel] = (message) => {
|
|
2207
|
-
if (this.shouldPrintMessage(logLevel))
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
process.stdout.write("\x1B[" + 3 + "B");
|
|
2211
|
-
}
|
|
2430
|
+
if (!this.shouldPrintMessage(logLevel))
|
|
2431
|
+
return;
|
|
2432
|
+
process.stdout.write(`\n${ansiFormatter}${message}\x1b[0m\u001b[0m`);
|
|
2212
2433
|
};
|
|
2213
2434
|
}
|
|
2214
2435
|
}
|
|
@@ -21152,7 +21373,7 @@ CI Build ID: ${ciBuildId}\n`;
|
|
|
21152
21373
|
\n`,
|
|
21153
21374
|
},
|
|
21154
21375
|
onEnd: {
|
|
21155
|
-
runReported: "Run completed and reported to NeetoPlaydash
|
|
21376
|
+
runReported: "Run completed and reported to NeetoPlaydash 🎉\n\n",
|
|
21156
21377
|
},
|
|
21157
21378
|
};
|
|
21158
21379
|
|
|
@@ -21226,6 +21447,10 @@ const onBegin = async (self, config, rootSuite) => {
|
|
|
21226
21447
|
let attempts = {};
|
|
21227
21448
|
self.totalTestCount = rootSuite.allTests().length;
|
|
21228
21449
|
self.rootDir = config.rootDir;
|
|
21450
|
+
if (self.totalTestCount === 0) {
|
|
21451
|
+
consoleLogFormatted.error(ERRORS.onBegin.noTestsToReport);
|
|
21452
|
+
return;
|
|
21453
|
+
}
|
|
21229
21454
|
try {
|
|
21230
21455
|
const runDetails = {
|
|
21231
21456
|
commitId: getCurrentCommitSha(),
|
|
@@ -21239,10 +21464,6 @@ const onBegin = async (self, config, rootSuite) => {
|
|
|
21239
21464
|
};
|
|
21240
21465
|
await runsApi.create(runDetails);
|
|
21241
21466
|
self.hasRunStarted = true;
|
|
21242
|
-
if (self.totalTestCount === 0) {
|
|
21243
|
-
consoleLogFormatted.error(ERRORS.onBegin.noTestsToReport);
|
|
21244
|
-
return;
|
|
21245
|
-
}
|
|
21246
21467
|
({ data: attempts } = await testEntitiesApi.create(self.ciBuildId, {
|
|
21247
21468
|
testEntities: getInitializerData(config, rootSuite),
|
|
21248
21469
|
shard: currentShard,
|
|
@@ -21299,15 +21520,15 @@ const onTestBegin = async (self, test, { retry }) => {
|
|
|
21299
21520
|
const { title, repeatEachIndex } = test;
|
|
21300
21521
|
const { rootDir, currentShard, ciBuildId } = self;
|
|
21301
21522
|
const { historyId } = getTestData(test, rootDir);
|
|
21302
|
-
const startedAt = new Date();
|
|
21523
|
+
const startedAt = new Date().toString();
|
|
21303
21524
|
const attemptIndex = joinHyphenCase(retry, repeatEachIndex);
|
|
21304
21525
|
self.unreportedAttemptCount++;
|
|
21305
|
-
consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
|
|
21306
21526
|
try {
|
|
21307
21527
|
await waitUntilCondition(() => { var _a, _b; return (_b = (_a = self.attempts) === null || _a === void 0 ? void 0 : _a[historyId]) === null || _b === void 0 ? void 0 : _b[FIRST_ATTEMPT_INDEX]; });
|
|
21528
|
+
consoleLogFormatted.invertBackground(MESSAGES.onTestBegin.startingTest(title, historyId));
|
|
21308
21529
|
const attemptsPayload = {
|
|
21309
21530
|
status: "running",
|
|
21310
|
-
startedAt
|
|
21531
|
+
startedAt,
|
|
21311
21532
|
shard: currentShard,
|
|
21312
21533
|
repeatEachIndex,
|
|
21313
21534
|
};
|
|
@@ -21315,7 +21536,7 @@ const onTestBegin = async (self, test, { retry }) => {
|
|
|
21315
21536
|
await attemptsApi.update(ciBuildId, historyId, self.attempts[historyId][FIRST_ATTEMPT_INDEX], attemptsPayload);
|
|
21316
21537
|
}
|
|
21317
21538
|
else {
|
|
21318
|
-
const { data: { attemptId
|
|
21539
|
+
const { data: { attemptId }, } = await attemptsApi.create(ciBuildId, historyId, attemptsPayload);
|
|
21319
21540
|
self.attempts = mergeDeepRight(self.attempts, {
|
|
21320
21541
|
[historyId]: { [attemptIndex]: attemptId },
|
|
21321
21542
|
});
|
|
@@ -22706,15 +22927,22 @@ const onTestEnd = async (self, testCase, { status, duration, errors, error, retr
|
|
|
22706
22927
|
errorSnippet: error && generateErrorReport(error),
|
|
22707
22928
|
};
|
|
22708
22929
|
consoleLogFormatted.underline(title);
|
|
22709
|
-
const
|
|
22930
|
+
const files = attachments
|
|
22931
|
+
.map(({ name, path, body, contentType }) => {
|
|
22710
22932
|
if (VALID_ASSET_TYPES.includes(name)) {
|
|
22711
22933
|
const buffer = path ? require$$6.readFileSync(path) : body;
|
|
22712
22934
|
const fileName = generateFileName(path, name, contentType);
|
|
22713
22935
|
const { file, ...metadata } = getFileData(buffer, contentType, fileName);
|
|
22714
|
-
|
|
22715
|
-
testResult[`${name}s`].push(signedId);
|
|
22716
|
-
return uploadToS3(file, directUploadMetaData, `${title} - ${name}`);
|
|
22936
|
+
return { file, metadata, name };
|
|
22717
22937
|
}
|
|
22938
|
+
})
|
|
22939
|
+
.filter((fileData) => fileData !== undefined);
|
|
22940
|
+
const payload = { metadata: pluck("metadata", files) };
|
|
22941
|
+
const { data: directUploadResponses } = await getDirectUploadURL(payload);
|
|
22942
|
+
const bars = await Promise.all(directUploadResponses.map(async ({ signedId, directUpload }, index) => {
|
|
22943
|
+
var _a, _b;
|
|
22944
|
+
testResult[`${(_a = files[index]) === null || _a === void 0 ? void 0 : _a.name}s`].push(signedId);
|
|
22945
|
+
return uploadToS3(files[index].file, directUpload, `${title} - ${(_b = files[index]) === null || _b === void 0 ? void 0 : _b.name}`);
|
|
22718
22946
|
}));
|
|
22719
22947
|
self.progressBars.push(...bars);
|
|
22720
22948
|
await waitUntilCondition(() => self.attempts[historyId][attemptIndex]);
|