@telefonica/acceptance-testing 4.0.0 → 4.1.0
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 +4 -1
- package/dist/acceptance-testing.cjs.development.js +198 -162
- package/dist/acceptance-testing.cjs.development.js.map +1 -1
- package/dist/acceptance-testing.cjs.production.min.js +1 -1
- package/dist/acceptance-testing.cjs.production.min.js.map +1 -1
- package/dist/acceptance-testing.esm.js +198 -162
- package/dist/acceptance-testing.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -873,22 +873,41 @@ var getPageApi = function getPageApi(page) {
|
|
|
873
873
|
};
|
|
874
874
|
var needsRequestInterception = false;
|
|
875
875
|
var requestHandlers = [];
|
|
876
|
-
var requestInterceptor = function
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
876
|
+
var requestInterceptor = /*#__PURE__*/function () {
|
|
877
|
+
var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(req) {
|
|
878
|
+
var _requestHandlers$find;
|
|
879
|
+
var _ref12, handler, response;
|
|
880
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
881
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
882
|
+
case 0:
|
|
883
|
+
_ref12 = (_requestHandlers$find = requestHandlers.find(function (_ref13) {
|
|
884
|
+
var matcher = _ref13.matcher;
|
|
885
|
+
return matcher(req);
|
|
886
|
+
})) != null ? _requestHandlers$find : {
|
|
887
|
+
handler: null
|
|
888
|
+
}, handler = _ref12.handler;
|
|
889
|
+
if (handler) {
|
|
890
|
+
_context7.next = 4;
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
req["continue"]();
|
|
894
|
+
return _context7.abrupt("return");
|
|
895
|
+
case 4:
|
|
896
|
+
_context7.next = 6;
|
|
897
|
+
return handler(req);
|
|
898
|
+
case 6:
|
|
899
|
+
response = _context7.sent;
|
|
900
|
+
req.respond(response);
|
|
901
|
+
case 8:
|
|
902
|
+
case "end":
|
|
903
|
+
return _context7.stop();
|
|
904
|
+
}
|
|
905
|
+
}, _callee7);
|
|
906
|
+
}));
|
|
907
|
+
return function requestInterceptor(_x11) {
|
|
908
|
+
return _ref11.apply(this, arguments);
|
|
909
|
+
};
|
|
910
|
+
}();
|
|
892
911
|
var interceptRequest = function interceptRequest(matcher) {
|
|
893
912
|
needsRequestInterception = true;
|
|
894
913
|
var spy = jest.fn();
|
|
@@ -899,11 +918,11 @@ var interceptRequest = function interceptRequest(matcher) {
|
|
|
899
918
|
return spy;
|
|
900
919
|
};
|
|
901
920
|
var createApiEndpointMock = function createApiEndpointMock(_temp3) {
|
|
902
|
-
var
|
|
903
|
-
var
|
|
904
|
-
origin =
|
|
905
|
-
baseUrl =
|
|
906
|
-
var originRegExp = globToRegExp((
|
|
921
|
+
var _ref15;
|
|
922
|
+
var _ref14 = _temp3 === void 0 ? {} : _temp3,
|
|
923
|
+
origin = _ref14.origin,
|
|
924
|
+
baseUrl = _ref14.baseUrl;
|
|
925
|
+
var originRegExp = globToRegExp((_ref15 = origin != null ? origin : baseUrl) != null ? _ref15 : '*');
|
|
907
926
|
interceptRequest(function (req) {
|
|
908
927
|
var _URL = new URL(req.url()),
|
|
909
928
|
origin = _URL.origin;
|
|
@@ -932,31 +951,48 @@ var createApiEndpointMock = function createApiEndpointMock(_temp3) {
|
|
|
932
951
|
return req.method() === method && !!origin.match(originRegExp) && matchPath(spiedPath, pathWithParams);
|
|
933
952
|
};
|
|
934
953
|
var spy = jest.fn();
|
|
935
|
-
interceptRequest(matcher).mockImplementation(function (
|
|
936
|
-
var
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
954
|
+
interceptRequest(matcher).mockImplementation( /*#__PURE__*/function () {
|
|
955
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(req) {
|
|
956
|
+
var _spyResult$status;
|
|
957
|
+
var spyResult, status, resBody;
|
|
958
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
959
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
960
|
+
case 0:
|
|
961
|
+
_context8.next = 2;
|
|
962
|
+
return spy(req);
|
|
963
|
+
case 2:
|
|
964
|
+
spyResult = _context8.sent;
|
|
965
|
+
status = (_spyResult$status = spyResult.status) != null ? _spyResult$status : 200;
|
|
966
|
+
resBody = spyResult.body || spyResult;
|
|
967
|
+
return _context8.abrupt("return", {
|
|
968
|
+
status: status,
|
|
969
|
+
headers: {
|
|
970
|
+
'Access-Control-Allow-Origin': '*'
|
|
971
|
+
},
|
|
972
|
+
contentType: 'application/json',
|
|
973
|
+
body: JSON.stringify(resBody)
|
|
974
|
+
});
|
|
975
|
+
case 6:
|
|
976
|
+
case "end":
|
|
977
|
+
return _context8.stop();
|
|
978
|
+
}
|
|
979
|
+
}, _callee8);
|
|
980
|
+
}));
|
|
981
|
+
return function (_x12) {
|
|
982
|
+
return _ref16.apply(this, arguments);
|
|
947
983
|
};
|
|
948
|
-
});
|
|
984
|
+
}());
|
|
949
985
|
return spy;
|
|
950
986
|
}
|
|
951
987
|
};
|
|
952
988
|
};
|
|
953
989
|
var openPage = /*#__PURE__*/function () {
|
|
954
|
-
var
|
|
990
|
+
var _ref18 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref17) {
|
|
955
991
|
var userAgent, isDarkMode, viewport, cookies, urlConfig, url, currentUserAgent, page, connectionError;
|
|
956
|
-
return _regeneratorRuntime().wrap(function
|
|
957
|
-
while (1) switch (
|
|
992
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
993
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
958
994
|
case 0:
|
|
959
|
-
userAgent =
|
|
995
|
+
userAgent = _ref17.userAgent, isDarkMode = _ref17.isDarkMode, viewport = _ref17.viewport, cookies = _ref17.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref17, _excluded2);
|
|
960
996
|
url = function () {
|
|
961
997
|
if (urlConfig.url !== undefined) {
|
|
962
998
|
return urlConfig.url;
|
|
@@ -976,45 +1012,45 @@ var openPage = /*#__PURE__*/function () {
|
|
|
976
1012
|
return protocol + "://" + hostname + ":" + port + path;
|
|
977
1013
|
}();
|
|
978
1014
|
debug('Opening page:', url);
|
|
979
|
-
|
|
980
|
-
if (
|
|
981
|
-
|
|
1015
|
+
_context9.t0 = userAgent;
|
|
1016
|
+
if (_context9.t0) {
|
|
1017
|
+
_context9.next = 8;
|
|
982
1018
|
break;
|
|
983
1019
|
}
|
|
984
|
-
|
|
1020
|
+
_context9.next = 7;
|
|
985
1021
|
return getGlobalBrowser().userAgent();
|
|
986
1022
|
case 7:
|
|
987
|
-
|
|
1023
|
+
_context9.t0 = _context9.sent;
|
|
988
1024
|
case 8:
|
|
989
|
-
currentUserAgent =
|
|
1025
|
+
currentUserAgent = _context9.t0;
|
|
990
1026
|
page = getGlobalPage$1();
|
|
991
|
-
|
|
1027
|
+
_context9.next = 12;
|
|
992
1028
|
return page.bringToFront();
|
|
993
1029
|
case 12:
|
|
994
1030
|
if (!viewport) {
|
|
995
|
-
|
|
1031
|
+
_context9.next = 15;
|
|
996
1032
|
break;
|
|
997
1033
|
}
|
|
998
|
-
|
|
1034
|
+
_context9.next = 15;
|
|
999
1035
|
return page.setViewport(viewport);
|
|
1000
1036
|
case 15:
|
|
1001
1037
|
if (!cookies) {
|
|
1002
|
-
|
|
1038
|
+
_context9.next = 18;
|
|
1003
1039
|
break;
|
|
1004
1040
|
}
|
|
1005
|
-
|
|
1041
|
+
_context9.next = 18;
|
|
1006
1042
|
return page.setCookie.apply(page, cookies);
|
|
1007
1043
|
case 18:
|
|
1008
|
-
|
|
1044
|
+
_context9.next = 20;
|
|
1009
1045
|
return page.setUserAgent(currentUserAgent + " acceptance-test");
|
|
1010
1046
|
case 20:
|
|
1011
|
-
|
|
1047
|
+
_context9.next = 22;
|
|
1012
1048
|
return page.emulateMediaFeatures([{
|
|
1013
1049
|
name: 'prefers-color-scheme',
|
|
1014
1050
|
value: isDarkMode ? 'dark' : 'light'
|
|
1015
1051
|
}]);
|
|
1016
1052
|
case 22:
|
|
1017
|
-
|
|
1053
|
+
_context9.next = 24;
|
|
1018
1054
|
return page.evaluateOnNewDocument(function (viewport) {
|
|
1019
1055
|
var _viewport$safeAreaIns;
|
|
1020
1056
|
var overriddenSafeAreaInsets = !viewport ? [] : Object.keys((_viewport$safeAreaIns = viewport == null ? void 0 : viewport.safeAreaInset) != null ? _viewport$safeAreaIns : {}).map(function (key) {
|
|
@@ -1030,57 +1066,57 @@ var openPage = /*#__PURE__*/function () {
|
|
|
1030
1066
|
}, viewport);
|
|
1031
1067
|
case 24:
|
|
1032
1068
|
if (!needsRequestInterception) {
|
|
1033
|
-
|
|
1069
|
+
_context9.next = 28;
|
|
1034
1070
|
break;
|
|
1035
1071
|
}
|
|
1036
|
-
|
|
1072
|
+
_context9.next = 27;
|
|
1037
1073
|
return page.setRequestInterception(true);
|
|
1038
1074
|
case 27:
|
|
1039
1075
|
page.on('request', requestInterceptor);
|
|
1040
1076
|
case 28:
|
|
1041
|
-
|
|
1042
|
-
|
|
1077
|
+
_context9.prev = 28;
|
|
1078
|
+
_context9.next = 31;
|
|
1043
1079
|
return page["goto"](url);
|
|
1044
1080
|
case 31:
|
|
1045
|
-
|
|
1081
|
+
_context9.next = 42;
|
|
1046
1082
|
break;
|
|
1047
1083
|
case 33:
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
if (!
|
|
1051
|
-
|
|
1084
|
+
_context9.prev = 33;
|
|
1085
|
+
_context9.t1 = _context9["catch"](28);
|
|
1086
|
+
if (!_context9.t1.message.includes('net::ERR_CONNECTION_REFUSED')) {
|
|
1087
|
+
_context9.next = 41;
|
|
1052
1088
|
break;
|
|
1053
1089
|
}
|
|
1054
1090
|
connectionError = new Error("Could not connect to " + url + ". Is the server running?");
|
|
1055
1091
|
Error.captureStackTrace(connectionError, openPage);
|
|
1056
1092
|
throw connectionError;
|
|
1057
1093
|
case 41:
|
|
1058
|
-
throw
|
|
1094
|
+
throw _context9.t1;
|
|
1059
1095
|
case 42:
|
|
1060
|
-
|
|
1096
|
+
_context9.next = 44;
|
|
1061
1097
|
return page.waitForFunction('document.fonts.status === "loaded"');
|
|
1062
1098
|
case 44:
|
|
1063
|
-
return
|
|
1099
|
+
return _context9.abrupt("return", getPageApi(page));
|
|
1064
1100
|
case 45:
|
|
1065
1101
|
case "end":
|
|
1066
|
-
return
|
|
1102
|
+
return _context9.stop();
|
|
1067
1103
|
}
|
|
1068
|
-
},
|
|
1104
|
+
}, _callee9, null, [[28, 33]]);
|
|
1069
1105
|
}));
|
|
1070
|
-
return function openPage(
|
|
1071
|
-
return
|
|
1106
|
+
return function openPage(_x13) {
|
|
1107
|
+
return _ref18.apply(this, arguments);
|
|
1072
1108
|
};
|
|
1073
1109
|
}();
|
|
1074
1110
|
var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
1075
|
-
var
|
|
1076
|
-
page =
|
|
1077
|
-
element =
|
|
1111
|
+
var _ref19 = _temp4 === void 0 ? {} : _temp4,
|
|
1112
|
+
page = _ref19.page,
|
|
1113
|
+
element = _ref19.element;
|
|
1078
1114
|
var boundQueries = {};
|
|
1079
1115
|
var _loop = function _loop() {
|
|
1080
1116
|
var _Object$entries$_i = _Object$entries[_i],
|
|
1081
1117
|
queryName = _Object$entries$_i[0],
|
|
1082
1118
|
queryFn = _Object$entries$_i[1];
|
|
1083
|
-
boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1119
|
+
boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
1084
1120
|
var doc,
|
|
1085
1121
|
body,
|
|
1086
1122
|
_len2,
|
|
@@ -1089,20 +1125,20 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1089
1125
|
queryArgs,
|
|
1090
1126
|
elementHandle,
|
|
1091
1127
|
newElementHandle,
|
|
1092
|
-
|
|
1093
|
-
return _regeneratorRuntime().wrap(function
|
|
1094
|
-
while (1) switch (
|
|
1128
|
+
_args14 = arguments;
|
|
1129
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1130
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1095
1131
|
case 0:
|
|
1096
|
-
|
|
1132
|
+
_context14.next = 2;
|
|
1097
1133
|
return getDocument(page != null ? page : getGlobalPage$1());
|
|
1098
1134
|
case 2:
|
|
1099
|
-
doc =
|
|
1100
|
-
|
|
1135
|
+
doc = _context14.sent;
|
|
1136
|
+
_context14.next = 5;
|
|
1101
1137
|
return doc.$('body');
|
|
1102
1138
|
case 5:
|
|
1103
|
-
body =
|
|
1104
|
-
for (_len2 =
|
|
1105
|
-
args[_key2] =
|
|
1139
|
+
body = _context14.sent;
|
|
1140
|
+
for (_len2 = _args14.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1141
|
+
args[_key2] = _args14[_key2];
|
|
1106
1142
|
}
|
|
1107
1143
|
queryArgs = [].concat(args);
|
|
1108
1144
|
if (queryName.startsWith('findBy')) {
|
|
@@ -1113,98 +1149,98 @@ var buildQueryMethods = function buildQueryMethods(_temp4) {
|
|
|
1113
1149
|
timeout: 10000
|
|
1114
1150
|
});
|
|
1115
1151
|
}
|
|
1116
|
-
|
|
1152
|
+
_context14.next = 11;
|
|
1117
1153
|
return queryFn.apply(void 0, [element != null ? element : body].concat(queryArgs));
|
|
1118
1154
|
case 11:
|
|
1119
|
-
elementHandle =
|
|
1155
|
+
elementHandle = _context14.sent;
|
|
1120
1156
|
newElementHandle = Object.create(elementHandle);
|
|
1121
1157
|
newElementHandle.screenshot = /*#__PURE__*/function () {
|
|
1122
|
-
var
|
|
1123
|
-
return _regeneratorRuntime().wrap(function
|
|
1124
|
-
while (1) switch (
|
|
1158
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(options) {
|
|
1159
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1160
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1125
1161
|
case 0:
|
|
1126
1162
|
if (options != null && options.skipNetworkWait) {
|
|
1127
|
-
|
|
1163
|
+
_context10.next = 3;
|
|
1128
1164
|
break;
|
|
1129
1165
|
}
|
|
1130
|
-
|
|
1166
|
+
_context10.next = 3;
|
|
1131
1167
|
return (page != null ? page : getGlobalPage$1()).waitForNetworkIdle();
|
|
1132
1168
|
case 3:
|
|
1133
|
-
|
|
1169
|
+
_context10.next = 5;
|
|
1134
1170
|
return waitForPaintEnd(elementHandle, _extends({}, options, {
|
|
1135
1171
|
fullPage: false
|
|
1136
1172
|
}));
|
|
1137
1173
|
case 5:
|
|
1138
|
-
return
|
|
1174
|
+
return _context10.abrupt("return", elementHandle.screenshot(normalizeSreenshotOptions(options)));
|
|
1139
1175
|
case 6:
|
|
1140
1176
|
case "end":
|
|
1141
|
-
return
|
|
1177
|
+
return _context10.stop();
|
|
1142
1178
|
}
|
|
1143
|
-
},
|
|
1179
|
+
}, _callee10);
|
|
1144
1180
|
}));
|
|
1145
|
-
return function (
|
|
1146
|
-
return
|
|
1181
|
+
return function (_x14) {
|
|
1182
|
+
return _ref21.apply(this, arguments);
|
|
1147
1183
|
};
|
|
1148
1184
|
}();
|
|
1149
1185
|
newElementHandle.click = /*#__PURE__*/function () {
|
|
1150
|
-
var
|
|
1151
|
-
return _regeneratorRuntime().wrap(function
|
|
1152
|
-
while (1) switch (
|
|
1186
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(options) {
|
|
1187
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1188
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1153
1189
|
case 0:
|
|
1154
|
-
|
|
1190
|
+
_context11.next = 2;
|
|
1155
1191
|
return scrollIntoView(elementHandle);
|
|
1156
1192
|
case 2:
|
|
1157
|
-
return
|
|
1193
|
+
return _context11.abrupt("return", elementHandle.click(options));
|
|
1158
1194
|
case 3:
|
|
1159
1195
|
case "end":
|
|
1160
|
-
return
|
|
1196
|
+
return _context11.stop();
|
|
1161
1197
|
}
|
|
1162
|
-
},
|
|
1198
|
+
}, _callee11);
|
|
1163
1199
|
}));
|
|
1164
|
-
return function (
|
|
1165
|
-
return
|
|
1200
|
+
return function (_x15) {
|
|
1201
|
+
return _ref22.apply(this, arguments);
|
|
1166
1202
|
};
|
|
1167
1203
|
}();
|
|
1168
1204
|
newElementHandle.type = /*#__PURE__*/function () {
|
|
1169
|
-
var
|
|
1170
|
-
return _regeneratorRuntime().wrap(function
|
|
1171
|
-
while (1) switch (
|
|
1205
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(text, options) {
|
|
1206
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1207
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1172
1208
|
case 0:
|
|
1173
|
-
|
|
1209
|
+
_context12.next = 2;
|
|
1174
1210
|
return scrollIntoView(elementHandle);
|
|
1175
1211
|
case 2:
|
|
1176
|
-
return
|
|
1212
|
+
return _context12.abrupt("return", elementHandle.type(text, options));
|
|
1177
1213
|
case 3:
|
|
1178
1214
|
case "end":
|
|
1179
|
-
return
|
|
1215
|
+
return _context12.stop();
|
|
1180
1216
|
}
|
|
1181
|
-
},
|
|
1217
|
+
}, _callee12);
|
|
1182
1218
|
}));
|
|
1183
|
-
return function (
|
|
1184
|
-
return
|
|
1219
|
+
return function (_x16, _x17) {
|
|
1220
|
+
return _ref23.apply(this, arguments);
|
|
1185
1221
|
};
|
|
1186
1222
|
}();
|
|
1187
|
-
newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1188
|
-
var
|
|
1189
|
-
return _regeneratorRuntime().wrap(function
|
|
1190
|
-
while (1) switch (
|
|
1223
|
+
newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
1224
|
+
var _args13 = arguments;
|
|
1225
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1226
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1191
1227
|
case 0:
|
|
1192
|
-
|
|
1228
|
+
_context13.next = 2;
|
|
1193
1229
|
return scrollIntoView(elementHandle);
|
|
1194
1230
|
case 2:
|
|
1195
|
-
return
|
|
1231
|
+
return _context13.abrupt("return", elementHandle.select.apply(elementHandle, _args13));
|
|
1196
1232
|
case 3:
|
|
1197
1233
|
case "end":
|
|
1198
|
-
return
|
|
1234
|
+
return _context13.stop();
|
|
1199
1235
|
}
|
|
1200
|
-
},
|
|
1236
|
+
}, _callee13);
|
|
1201
1237
|
}));
|
|
1202
|
-
return
|
|
1238
|
+
return _context14.abrupt("return", newElementHandle);
|
|
1203
1239
|
case 18:
|
|
1204
1240
|
case "end":
|
|
1205
|
-
return
|
|
1241
|
+
return _context14.stop();
|
|
1206
1242
|
}
|
|
1207
|
-
},
|
|
1243
|
+
}, _callee14);
|
|
1208
1244
|
}));
|
|
1209
1245
|
};
|
|
1210
1246
|
for (var _i = 0, _Object$entries = Object.entries(queries); _i < _Object$entries.length; _i++) {
|
|
@@ -1223,73 +1259,73 @@ var within = function within(element) {
|
|
|
1223
1259
|
element: element
|
|
1224
1260
|
});
|
|
1225
1261
|
};
|
|
1226
|
-
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1227
|
-
return _regeneratorRuntime().wrap(function
|
|
1228
|
-
while (1) switch (
|
|
1262
|
+
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
1263
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1264
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1229
1265
|
case 0:
|
|
1230
|
-
|
|
1266
|
+
_context15.next = 2;
|
|
1231
1267
|
return getGlobalPage$1().setRequestInterception(false);
|
|
1232
1268
|
case 2:
|
|
1233
|
-
|
|
1269
|
+
_context15.next = 4;
|
|
1234
1270
|
return global.jestPuppeteer.resetPage();
|
|
1235
1271
|
case 4:
|
|
1236
1272
|
case "end":
|
|
1237
|
-
return
|
|
1273
|
+
return _context15.stop();
|
|
1238
1274
|
}
|
|
1239
|
-
},
|
|
1275
|
+
}, _callee15);
|
|
1240
1276
|
})));
|
|
1241
|
-
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1277
|
+
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
1242
1278
|
var page;
|
|
1243
|
-
return _regeneratorRuntime().wrap(function
|
|
1244
|
-
while (1) switch (
|
|
1279
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1280
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1245
1281
|
case 0:
|
|
1246
1282
|
if (!process.env.COLLECT_ACCEPTANCE_COVERAGE) {
|
|
1247
|
-
|
|
1283
|
+
_context16.next = 3;
|
|
1248
1284
|
break;
|
|
1249
1285
|
}
|
|
1250
|
-
|
|
1286
|
+
_context16.next = 3;
|
|
1251
1287
|
return collectFrontendCoverage({
|
|
1252
1288
|
coveragePath: coveragePath
|
|
1253
1289
|
});
|
|
1254
1290
|
case 3:
|
|
1255
|
-
|
|
1291
|
+
_context16.prev = 3;
|
|
1256
1292
|
page = getGlobalPage$1();
|
|
1257
1293
|
requestHandlers = [];
|
|
1258
1294
|
needsRequestInterception = false;
|
|
1259
1295
|
page.off('request', requestInterceptor);
|
|
1260
1296
|
// clear tab, this way we clear the DOM and stop js execution or pending requests
|
|
1261
|
-
|
|
1297
|
+
_context16.next = 10;
|
|
1262
1298
|
return page["goto"]('about:blank');
|
|
1263
1299
|
case 10:
|
|
1264
|
-
|
|
1300
|
+
_context16.next = 14;
|
|
1265
1301
|
break;
|
|
1266
1302
|
case 12:
|
|
1267
|
-
|
|
1268
|
-
|
|
1303
|
+
_context16.prev = 12;
|
|
1304
|
+
_context16.t0 = _context16["catch"](3);
|
|
1269
1305
|
case 14:
|
|
1270
1306
|
case "end":
|
|
1271
|
-
return
|
|
1307
|
+
return _context16.stop();
|
|
1272
1308
|
}
|
|
1273
|
-
},
|
|
1309
|
+
}, _callee16, null, [[3, 12]]);
|
|
1274
1310
|
})));
|
|
1275
|
-
afterAll( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1276
|
-
return _regeneratorRuntime().wrap(function
|
|
1277
|
-
while (1) switch (
|
|
1311
|
+
afterAll( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1312
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1313
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1278
1314
|
case 0:
|
|
1279
1315
|
if (!process.env.COLLECT_ACCEPTANCE_COVERAGE) {
|
|
1280
|
-
|
|
1316
|
+
_context17.next = 3;
|
|
1281
1317
|
break;
|
|
1282
1318
|
}
|
|
1283
|
-
|
|
1319
|
+
_context17.next = 3;
|
|
1284
1320
|
return collectBackendCoverage({
|
|
1285
1321
|
coveragePath: coveragePath,
|
|
1286
1322
|
coverageUrls: coverageUrls
|
|
1287
1323
|
});
|
|
1288
1324
|
case 3:
|
|
1289
1325
|
case "end":
|
|
1290
|
-
return
|
|
1326
|
+
return _context17.stop();
|
|
1291
1327
|
}
|
|
1292
|
-
},
|
|
1328
|
+
}, _callee17);
|
|
1293
1329
|
})));
|
|
1294
1330
|
/**
|
|
1295
1331
|
* Returns a new path to the file that can be used by chromium in acceptance tests
|
|
@@ -1365,44 +1401,44 @@ var waitForElementToBeRemoved = function waitForElementToBeRemoved(element, time
|
|
|
1365
1401
|
}
|
|
1366
1402
|
var startStack = new Error().stack;
|
|
1367
1403
|
var wait = /*#__PURE__*/function () {
|
|
1368
|
-
var
|
|
1404
|
+
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1369
1405
|
var t0, box;
|
|
1370
|
-
return _regeneratorRuntime().wrap(function
|
|
1371
|
-
while (1) switch (
|
|
1406
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1407
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1372
1408
|
case 0:
|
|
1373
1409
|
t0 = Date.now();
|
|
1374
1410
|
case 1:
|
|
1375
1411
|
if (!(Date.now() - t0 < timeout)) {
|
|
1376
|
-
|
|
1412
|
+
_context18.next = 11;
|
|
1377
1413
|
break;
|
|
1378
1414
|
}
|
|
1379
|
-
|
|
1415
|
+
_context18.next = 4;
|
|
1380
1416
|
return element.boundingBox();
|
|
1381
1417
|
case 4:
|
|
1382
|
-
box =
|
|
1418
|
+
box = _context18.sent;
|
|
1383
1419
|
if (box) {
|
|
1384
|
-
|
|
1420
|
+
_context18.next = 7;
|
|
1385
1421
|
break;
|
|
1386
1422
|
}
|
|
1387
|
-
return
|
|
1423
|
+
return _context18.abrupt("return");
|
|
1388
1424
|
case 7:
|
|
1389
|
-
|
|
1425
|
+
_context18.next = 9;
|
|
1390
1426
|
return new Promise(function (resolve) {
|
|
1391
1427
|
return setTimeout(resolve, interval);
|
|
1392
1428
|
});
|
|
1393
1429
|
case 9:
|
|
1394
|
-
|
|
1430
|
+
_context18.next = 1;
|
|
1395
1431
|
break;
|
|
1396
1432
|
case 11:
|
|
1397
1433
|
throw new Error('Element not removed');
|
|
1398
1434
|
case 12:
|
|
1399
1435
|
case "end":
|
|
1400
|
-
return
|
|
1436
|
+
return _context18.stop();
|
|
1401
1437
|
}
|
|
1402
|
-
},
|
|
1438
|
+
}, _callee18);
|
|
1403
1439
|
}));
|
|
1404
1440
|
return function wait() {
|
|
1405
|
-
return
|
|
1441
|
+
return _ref28.apply(this, arguments);
|
|
1406
1442
|
};
|
|
1407
1443
|
}();
|
|
1408
1444
|
return wait()["catch"](function (error) {
|