@o3r/testing 13.0.0-next.1 → 13.0.0-next.10
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/package.json +53 -64
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +4 -1
- package/schematics/ng-add/index.js.map +1 -1
- package/tools/index.d.ts +0 -1
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +0 -1
- package/tools/index.js.map +1 -1
- package/tools/path-replacement/path-replacement.d.ts +2 -2
- package/tools/path-replacement/path-replacement.d.ts.map +1 -1
- package/tools/path-replacement/path-replacement.js +2 -1
- package/tools/path-replacement/path-replacement.js.map +1 -1
- package/core/protractor/angular-materials/autocomplete-material.d.ts +0 -13
- package/core/protractor/angular-materials/autocomplete-material.d.ts.map +0 -1
- package/core/protractor/angular-materials/autocomplete-material.js +0 -37
- package/core/protractor/angular-materials/autocomplete-material.js.map +0 -1
- package/core/protractor/angular-materials/index.d.ts +0 -3
- package/core/protractor/angular-materials/index.d.ts.map +0 -1
- package/core/protractor/angular-materials/index.js +0 -6
- package/core/protractor/angular-materials/index.js.map +0 -1
- package/core/protractor/angular-materials/select-material.d.ts +0 -19
- package/core/protractor/angular-materials/select-material.d.ts.map +0 -1
- package/core/protractor/angular-materials/select-material.js +0 -113
- package/core/protractor/angular-materials/select-material.js.map +0 -1
- package/core/protractor/component-fixture.d.ts +0 -126
- package/core/protractor/component-fixture.d.ts.map +0 -1
- package/core/protractor/component-fixture.js +0 -274
- package/core/protractor/component-fixture.js.map +0 -1
- package/core/protractor/element.d.ts +0 -38
- package/core/protractor/element.d.ts.map +0 -1
- package/core/protractor/element.js +0 -145
- package/core/protractor/element.js.map +0 -1
- package/core/protractor/elements/checkbox-element.d.ts +0 -17
- package/core/protractor/elements/checkbox-element.d.ts.map +0 -1
- package/core/protractor/elements/checkbox-element.js +0 -54
- package/core/protractor/elements/checkbox-element.js.map +0 -1
- package/core/protractor/elements/index.d.ts +0 -4
- package/core/protractor/elements/index.d.ts.map +0 -1
- package/core/protractor/elements/index.js +0 -7
- package/core/protractor/elements/index.js.map +0 -1
- package/core/protractor/elements/radio-element.d.ts +0 -17
- package/core/protractor/elements/radio-element.d.ts.map +0 -1
- package/core/protractor/elements/radio-element.js +0 -56
- package/core/protractor/elements/radio-element.js.map +0 -1
- package/core/protractor/elements/select-element.d.ts +0 -15
- package/core/protractor/elements/select-element.d.ts.map +0 -1
- package/core/protractor/elements/select-element.js +0 -49
- package/core/protractor/elements/select-element.js.map +0 -1
- package/core/protractor/group.d.ts +0 -21
- package/core/protractor/group.d.ts.map +0 -1
- package/core/protractor/group.js +0 -27
- package/core/protractor/group.js.map +0 -1
- package/core/protractor/groups/index.d.ts +0 -2
- package/core/protractor/groups/index.d.ts.map +0 -1
- package/core/protractor/groups/index.js +0 -5
- package/core/protractor/groups/index.js.map +0 -1
- package/core/protractor/groups/radio-group.d.ts +0 -17
- package/core/protractor/groups/radio-group.d.ts.map +0 -1
- package/core/protractor/groups/radio-group.js +0 -80
- package/core/protractor/groups/radio-group.js.map +0 -1
- package/core/protractor/index.d.ts +0 -9
- package/core/protractor/index.d.ts.map +0 -1
- package/core/protractor/index.js +0 -11
- package/core/protractor/index.js.map +0 -1
- package/core/protractor/page-fixture.d.ts +0 -13
- package/core/protractor/page-fixture.d.ts.map +0 -1
- package/core/protractor/page-fixture.js +0 -23
- package/core/protractor/page-fixture.js.map +0 -1
- package/core/protractor/utils.d.ts +0 -8
- package/core/protractor/utils.d.ts.map +0 -1
- package/core/protractor/utils.js +0 -12
- package/core/protractor/utils.js.map +0 -1
- package/tools/protractor/fetch-manager/_fetch-manager.d.ts +0 -1
- package/tools/protractor/fetch-manager/_fetch-manager.d.ts.map +0 -1
- package/tools/protractor/fetch-manager/_fetch-manager.js +0 -127
- package/tools/protractor/fetch-manager/_fetch-manager.js.map +0 -1
- package/tools/protractor/fetch-manager/index.d.ts +0 -2
- package/tools/protractor/fetch-manager/index.d.ts.map +0 -1
- package/tools/protractor/fetch-manager/index.js +0 -5
- package/tools/protractor/fetch-manager/index.js.map +0 -1
- package/tools/protractor/fetch-manager/utils.d.ts +0 -25
- package/tools/protractor/fetch-manager/utils.d.ts.map +0 -1
- package/tools/protractor/fetch-manager/utils.js +0 -81
- package/tools/protractor/fetch-manager/utils.js.map +0 -1
- package/tools/protractor/index.d.ts +0 -3
- package/tools/protractor/index.d.ts.map +0 -1
- package/tools/protractor/index.js +0 -6
- package/tools/protractor/index.js.map +0 -1
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts +0 -5
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts.map +0 -1
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js +0 -157
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js.map +0 -1
- package/tools/protractor/post-message-interceptor/core.d.ts +0 -17
- package/tools/protractor/post-message-interceptor/core.d.ts.map +0 -1
- package/tools/protractor/post-message-interceptor/core.js +0 -3
- package/tools/protractor/post-message-interceptor/core.js.map +0 -1
- package/tools/protractor/post-message-interceptor/index.d.ts +0 -3
- package/tools/protractor/post-message-interceptor/index.d.ts.map +0 -1
- package/tools/protractor/post-message-interceptor/index.js +0 -6
- package/tools/protractor/post-message-interceptor/index.js.map +0 -1
- package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts +0 -45
- package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts.map +0 -1
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js +0 -144
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js.map +0 -1
@@ -1,127 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* Note: This file is not part of the running script, it is injected in the browser while running e2e tests.
|
4
|
-
*/
|
5
|
-
(function () {
|
6
|
-
var MAX_WAITING_TIME_FOR_FETCH = 45 * 1000; // 45 seconds
|
7
|
-
var fetchManager = /** @class */ (function () {
|
8
|
-
function FetchManager() {
|
9
|
-
this.nbCurrentFetch = 0;
|
10
|
-
}
|
11
|
-
FetchManager.prototype.interceptor = function (ref, nativeFetch) {
|
12
|
-
var args = [];
|
13
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
14
|
-
args[_i - 2] = arguments[_i];
|
15
|
-
}
|
16
|
-
var promise = Promise.resolve(args);
|
17
|
-
promise = promise.then(function () {
|
18
|
-
ref.nbCurrentFetch++;
|
19
|
-
return [args[0], args[1]];
|
20
|
-
}, function (error) {
|
21
|
-
return Promise.reject(new Error(error));
|
22
|
-
});
|
23
|
-
promise = promise.then(function () { return nativeFetch.apply(void 0, args); });
|
24
|
-
promise = promise.then(function (response) {
|
25
|
-
ref.nbCurrentFetch--;
|
26
|
-
return response;
|
27
|
-
}, function (error) {
|
28
|
-
ref.nbCurrentFetch--;
|
29
|
-
return Promise.reject(new Error(error));
|
30
|
-
});
|
31
|
-
return promise;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* Register the fetch events to count the number of pending fetch.
|
35
|
-
*/
|
36
|
-
FetchManager.prototype.registerFetchInterceptor = function () {
|
37
|
-
var _this = this;
|
38
|
-
var nativeFetch = window.fetch;
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias, unicorn/no-this-assignment -- needed for the context
|
40
|
-
var that = this;
|
41
|
-
Object.assign(window, { fetch: function () {
|
42
|
-
var args = [];
|
43
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
44
|
-
args[_i] = arguments[_i];
|
45
|
-
}
|
46
|
-
return _this.interceptor.apply(_this, __spreadArray([that, nativeFetch], args, false));
|
47
|
-
} });
|
48
|
-
};
|
49
|
-
FetchManager.prototype.unregisterFetchInterceptor = function () {
|
50
|
-
Object.assign(window, { fetch: this.windowFetch });
|
51
|
-
};
|
52
|
-
/**
|
53
|
-
* Returns the single instance of FetchManager
|
54
|
-
*/
|
55
|
-
FetchManager.getInstance = function () {
|
56
|
-
return this._instance || (this._instance = new this());
|
57
|
-
};
|
58
|
-
/**
|
59
|
-
* Initialize the fetch manager
|
60
|
-
*/
|
61
|
-
FetchManager.prototype.init = function () {
|
62
|
-
this.nbCurrentFetch = 0;
|
63
|
-
this.registerFetchInterceptor();
|
64
|
-
};
|
65
|
-
/**
|
66
|
-
* Stop the interceptor
|
67
|
-
*/
|
68
|
-
FetchManager.prototype.stop = function () {
|
69
|
-
this.nbCurrentFetch = 0;
|
70
|
-
this.unregisterFetchInterceptor();
|
71
|
-
};
|
72
|
-
/**
|
73
|
-
* Get the number of active fetchs on the page.
|
74
|
-
*/
|
75
|
-
FetchManager.prototype.getPendingFetchs = function () {
|
76
|
-
return this.nbCurrentFetch;
|
77
|
-
};
|
78
|
-
/**
|
79
|
-
* This function waits for all fetchs calls to be resolved and the page to be stable to call the callback.
|
80
|
-
* It permits to easily run synchronous tests with protractor.
|
81
|
-
* This is very usefull in the case of Otter calls to backend because protractor synchronization manager do not care
|
82
|
-
* about fetchs calls. As a consequence, the `waitForAngular` method will not work.
|
83
|
-
* @param callback : Callback called when all the fetchs are finished and the page is stable.
|
84
|
-
* @param timeoutInterval : Interval in milliseconds between two checks of the number of pending fetchs
|
85
|
-
*/
|
86
|
-
FetchManager.prototype.waitForFetchs = function (callback, timeoutInterval) {
|
87
|
-
var _this = this;
|
88
|
-
if (timeoutInterval === void 0) { timeoutInterval = 100; }
|
89
|
-
var interval;
|
90
|
-
var timeout;
|
91
|
-
if (!this.getPendingFetchs()) {
|
92
|
-
callback();
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
var cancelPolling = function () {
|
96
|
-
if (interval) {
|
97
|
-
clearInterval(interval);
|
98
|
-
interval = undefined;
|
99
|
-
}
|
100
|
-
if (timeout) {
|
101
|
-
clearTimeout(timeout);
|
102
|
-
timeout = undefined;
|
103
|
-
}
|
104
|
-
// Handle polling result
|
105
|
-
if (_this.getPendingFetchs() > 0) {
|
106
|
-
// Error case will just log in console
|
107
|
-
// and allow to continue as o3r elements might be checking fetchManager
|
108
|
-
// concurrently
|
109
|
-
_this.nbCurrentFetch = 0;
|
110
|
-
callback();
|
111
|
-
throw new Error('Fetch timeout. Please check network requests.');
|
112
|
-
}
|
113
|
-
else {
|
114
|
-
callback();
|
115
|
-
}
|
116
|
-
};
|
117
|
-
var polling = function () { return _this.getPendingFetchs() > 0 || cancelPolling(); };
|
118
|
-
interval = setInterval(polling, timeoutInterval);
|
119
|
-
timeout = setTimeout(cancelPolling, MAX_WAITING_TIME_FOR_FETCH);
|
120
|
-
};
|
121
|
-
return FetchManager;
|
122
|
-
}());
|
123
|
-
if (!('fetchManager' in window)) {
|
124
|
-
Object.assign(window, { fetchManager: fetchManager });
|
125
|
-
}
|
126
|
-
})();
|
127
|
-
//# sourceMappingURL=_fetch-manager.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"_fetch-manager.js","sourceRoot":"","sources":["../../../../src/tools/protractor/fetch-manager/_fetch-manager.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,CAAC;IAUC,IAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAE3D,IAAM,YAAY;QAKhB;YAHQ,mBAAc,GAAG,CAAC,CAAC;QAGJ,CAAC;QAEhB,kCAAW,GAAnB,UAAoB,GAAiB,EAAE,WAAgB;YAAE,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,6BAAc;;YACrE,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO,GAAG,OAAO,CAAC,IAAI,CACpB;gBACE,GAAG,CAAC,cAAc,EAAE,CAAC;gBACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC,EACD,UAAC,KAAK;gBACJ,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACL,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC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H,mBAAC;IAAD,CAAC,AAzHoB,GAyHpB,CAAC;IAEF,IAAI,CAAC,CAAC,cAAc,IAAI,MAAM,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,YAAY,cAAA,EAAE,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/fetch-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/protractor/fetch-manager/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB","sourcesContent":["export * from './utils';\n"]}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This function waits for all fetchs calls to be resolved and the page to be stable to resolve the promise.
|
3
|
-
* It permits to easily run synchronous e2e tests on a flow that uses fetchs calls with protractor.
|
4
|
-
* This is very useful in the case of Otter calls to backend because protractor synchronization manager do not care
|
5
|
-
* about fetchs calls.
|
6
|
-
*
|
7
|
-
* This function needs the FetchManager to have been initialized and injected in the browser at the beginning of the
|
8
|
-
* flow with `initFetchManager()`
|
9
|
-
*
|
10
|
-
* You can ignore the waiting of fetchs by setting `browser.ignoreSynchronization` to `true`
|
11
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
12
|
-
*/
|
13
|
-
export declare function waitForOtterStable(): Promise<void>;
|
14
|
-
/**
|
15
|
-
* This function initiliaze the FetchManager. Set `window.fetch` variable with a custom behaviour in order to count the
|
16
|
-
* fetch calls.
|
17
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
18
|
-
*/
|
19
|
-
export declare function initFetchManager(): Promise<void>;
|
20
|
-
/**
|
21
|
-
* This function stops the FetchManager. Reset `window.fetch` variable with its native behaviour.
|
22
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
23
|
-
*/
|
24
|
-
export declare function stopFetchManager(): Promise<void>;
|
25
|
-
//# sourceMappingURL=utils.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/fetch-manager/utils.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,kBAOvC;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,kBAQrC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,kBAErC"}
|
@@ -1,81 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.waitForOtterStable = waitForOtterStable;
|
4
|
-
exports.initFetchManager = initFetchManager;
|
5
|
-
exports.stopFetchManager = stopFetchManager;
|
6
|
-
var tslib_1 = require("tslib");
|
7
|
-
var fs = require("node:fs");
|
8
|
-
var path = require("node:path");
|
9
|
-
var protractor_1 = require("protractor");
|
10
|
-
/**
|
11
|
-
* This function waits for all fetchs calls to be resolved and the page to be stable to resolve the promise.
|
12
|
-
* It permits to easily run synchronous e2e tests on a flow that uses fetchs calls with protractor.
|
13
|
-
* This is very useful in the case of Otter calls to backend because protractor synchronization manager do not care
|
14
|
-
* about fetchs calls.
|
15
|
-
*
|
16
|
-
* This function needs the FetchManager to have been initialized and injected in the browser at the beginning of the
|
17
|
-
* flow with `initFetchManager()`
|
18
|
-
*
|
19
|
-
* You can ignore the waiting of fetchs by setting `browser.ignoreSynchronization` to `true`
|
20
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
21
|
-
*/
|
22
|
-
function waitForOtterStable() {
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
24
|
-
return tslib_1.__generator(this, function (_a) {
|
25
|
-
switch (_a.label) {
|
26
|
-
case 0: return [4 /*yield*/, protractor_1.browser.waitForAngular()];
|
27
|
-
case 1:
|
28
|
-
_a.sent();
|
29
|
-
if (!!protractor_1.browser.ignoreSynchronization) return [3 /*break*/, 4];
|
30
|
-
return [4 /*yield*/, protractor_1.browser.executeAsyncScript('window.fetchManager.getInstance().waitForFetchs(arguments[arguments.length - 1]);')];
|
31
|
-
case 2:
|
32
|
-
_a.sent();
|
33
|
-
return [4 /*yield*/, protractor_1.browser.waitForAngular()];
|
34
|
-
case 3:
|
35
|
-
_a.sent();
|
36
|
-
_a.label = 4;
|
37
|
-
case 4: return [2 /*return*/];
|
38
|
-
}
|
39
|
-
});
|
40
|
-
});
|
41
|
-
}
|
42
|
-
/**
|
43
|
-
* This function initiliaze the FetchManager. Set `window.fetch` variable with a custom behaviour in order to count the
|
44
|
-
* fetch calls.
|
45
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
46
|
-
*/
|
47
|
-
function initFetchManager() {
|
48
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
49
|
-
var fetchManager;
|
50
|
-
return tslib_1.__generator(this, function (_a) {
|
51
|
-
switch (_a.label) {
|
52
|
-
case 0:
|
53
|
-
fetchManager = fs.readFileSync(path.resolve(process.cwd(), 'node_modules', '@o3r', 'testing', 'tools', 'protractor', 'fetch-manager', '_fetch-manager.js'), { encoding: 'utf8' });
|
54
|
-
return [4 /*yield*/, protractor_1.browser.executeScript(fetchManager)];
|
55
|
-
case 1:
|
56
|
-
_a.sent();
|
57
|
-
return [4 /*yield*/, protractor_1.browser.executeScript('window.fetchManager.getInstance().init();')];
|
58
|
-
case 2:
|
59
|
-
_a.sent();
|
60
|
-
return [2 /*return*/];
|
61
|
-
}
|
62
|
-
});
|
63
|
-
});
|
64
|
-
}
|
65
|
-
/**
|
66
|
-
* This function stops the FetchManager. Reset `window.fetch` variable with its native behaviour.
|
67
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
68
|
-
*/
|
69
|
-
function stopFetchManager() {
|
70
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
71
|
-
return tslib_1.__generator(this, function (_a) {
|
72
|
-
switch (_a.label) {
|
73
|
-
case 0: return [4 /*yield*/, protractor_1.browser.executeScript('window.fetchManager.getInstance().stop();')];
|
74
|
-
case 1:
|
75
|
-
_a.sent();
|
76
|
-
return [2 /*return*/];
|
77
|
-
}
|
78
|
-
});
|
79
|
-
});
|
80
|
-
}
|
81
|
-
//# sourceMappingURL=utils.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/tools/protractor/fetch-manager/utils.ts"],"names":[],"mappings":";;AAkBA,gDAOC;AAOD,4CAQC;AAMD,4CAEC;;AAhDD,4BAA8B;AAC9B,gCAAkC;AAClC,yCAEoB;AAEpB;;;;;;;;;;;GAWG;AACH,SAAsB,kBAAkB;;;;wBACtC,qBAAM,oBAAO,CAAC,cAAc,EAAE,EAAA;;oBAA9B,SAA8B,CAAC;yBAC3B,CAAC,oBAAO,CAAC,qBAAqB,EAA9B,wBAA8B;oBAChC,qBAAM,oBAAO,CAAC,kBAAkB,CAC9B,mFAAmF,CAAC,EAAA;;oBADtF,SACsF,CAAC;oBACvF,qBAAM,oBAAO,CAAC,cAAc,EAAE,EAAA;;oBAA9B,SAA8B,CAAC;;;;;;CAElC;AAED;;;;GAIG;AACH,SAAsB,gBAAgB;;;;;;oBAC9B,YAAY,GAAG,EAAE,CAAC,YAAY,CAClC,IAAI,CAAC,OAAO,CACV,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EACxF,mBAAmB,CAAC,EACtB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;oBACxB,qBAAM,oBAAO,CAAC,aAAa,CAAC,YAAY,CAAC,EAAA;;oBAAzC,SAAyC,CAAC;oBAC1C,qBAAM,oBAAO,CAAC,aAAa,CAAC,2CAA2C,CAAC,EAAA;;oBAAxE,SAAwE,CAAC;;;;;CAC1E;AAED;;;GAGG;AACH,SAAsB,gBAAgB;;;;wBACpC,qBAAM,oBAAO,CAAC,aAAa,CAAC,2CAA2C,CAAC,EAAA;;oBAAxE,SAAwE,CAAC;;;;;CAC1E","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport {\n browser,\n} from 'protractor';\n\n/**\n * This function waits for all fetchs calls to be resolved and the page to be stable to resolve the promise.\n * It permits to easily run synchronous e2e tests on a flow that uses fetchs calls with protractor.\n * This is very useful in the case of Otter calls to backend because protractor synchronization manager do not care\n * about fetchs calls.\n *\n * This function needs the FetchManager to have been initialized and injected in the browser at the beginning of the\n * flow with `initFetchManager()`\n *\n * You can ignore the waiting of fetchs by setting `browser.ignoreSynchronization` to `true`\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport async function waitForOtterStable() {\n await browser.waitForAngular();\n if (!browser.ignoreSynchronization) {\n await browser.executeAsyncScript(\n 'window.fetchManager.getInstance().waitForFetchs(arguments[arguments.length - 1]);');\n await browser.waitForAngular();\n }\n}\n\n/**\n * This function initiliaze the FetchManager. Set `window.fetch` variable with a custom behaviour in order to count the\n * fetch calls.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport async function initFetchManager() {\n const fetchManager = fs.readFileSync(\n path.resolve(\n process.cwd(), 'node_modules', '@o3r', 'testing', 'tools', 'protractor', 'fetch-manager',\n '_fetch-manager.js'),\n { encoding: 'utf8' });\n await browser.executeScript(fetchManager);\n await browser.executeScript('window.fetchManager.getInstance().init();');\n}\n\n/**\n * This function stops the FetchManager. Reset `window.fetch` variable with its native behaviour.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport async function stopFetchManager() {\n await browser.executeScript('window.fetchManager.getInstance().stop();');\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/protractor/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./fetch-manager"), exports);
|
5
|
-
tslib_1.__exportStar(require("./post-message-interceptor"), exports);
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/protractor/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,qEAA2C","sourcesContent":["export * from './fetch-manager';\nexport * from './post-message-interceptor';\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"_post-message-interceptor.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/_post-message-interceptor.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
@@ -1,157 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* Note: This file is not part of the running script, it is injected in the browser while running e2e tests.
|
4
|
-
*/
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
// TODO: Move to PollyJS when the winter comes
|
7
|
-
(function () {
|
8
|
-
/**
|
9
|
-
* PostMessageInterceptor permits to intercept calls to postMessage.
|
10
|
-
*/
|
11
|
-
var postMessageInterceptor = /** @class */ (function () {
|
12
|
-
function PostMessageInterceptor() {
|
13
|
-
this.lastCalls = [];
|
14
|
-
this.listening = false;
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* Logs a message in the console
|
18
|
-
* @param message
|
19
|
-
* @param {...any} args
|
20
|
-
*/
|
21
|
-
PostMessageInterceptor.prototype.log = function (message) {
|
22
|
-
var args = [];
|
23
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
24
|
-
args[_i - 1] = arguments[_i];
|
25
|
-
}
|
26
|
-
// eslint-disable-next-line no-console -- this is the purpose of this method
|
27
|
-
console.log.apply(console, __spreadArray(["#postMessageInterceptor: ".concat(message)], args, false));
|
28
|
-
};
|
29
|
-
/**
|
30
|
-
* Intercepts the native postMessage call
|
31
|
-
* @param ref Singleton instance of the interceptor
|
32
|
-
* @param nativeMethod native postMessage method
|
33
|
-
* @param args all the args passed to the postMessage
|
34
|
-
*/
|
35
|
-
PostMessageInterceptor.prototype.interceptor = function (ref, nativeMethod) {
|
36
|
-
var args = [];
|
37
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
38
|
-
args[_i - 2] = arguments[_i];
|
39
|
-
}
|
40
|
-
this.log('Intercepted', args);
|
41
|
-
var postCall = {
|
42
|
-
data: args[0],
|
43
|
-
targetOrigin: args[1],
|
44
|
-
timestamp: new Date()
|
45
|
-
};
|
46
|
-
if (ref.listening) {
|
47
|
-
if (ref.conditionFn && !ref.conditionFn(postCall)) {
|
48
|
-
this.log('Intercepted message does not pass the condition');
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
ref.lastCalls.push(postCall);
|
52
|
-
this.log('Last call count', ref.lastCalls.length);
|
53
|
-
}
|
54
|
-
else {
|
55
|
-
this.log('Not listening');
|
56
|
-
}
|
57
|
-
nativeMethod.apply(void 0, args);
|
58
|
-
};
|
59
|
-
/**
|
60
|
-
* Register the interceptor in the window object
|
61
|
-
*/
|
62
|
-
PostMessageInterceptor.prototype.registerFetchInterceptor = function () {
|
63
|
-
var _this = this;
|
64
|
-
var nativeMethod = window.postMessage;
|
65
|
-
this.nativeMethod = nativeMethod;
|
66
|
-
Object.assign(window, { postMessage: function () {
|
67
|
-
var args = [];
|
68
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
69
|
-
args[_i] = arguments[_i];
|
70
|
-
}
|
71
|
-
return _this.interceptor.apply(_this, __spreadArray([_this, nativeMethod], args, false));
|
72
|
-
} });
|
73
|
-
};
|
74
|
-
/**
|
75
|
-
* Unregister the interceptor from the window object
|
76
|
-
*/
|
77
|
-
PostMessageInterceptor.prototype.unregisterFetchInterceptor = function () {
|
78
|
-
Object.assign(window, { postMessage: this.nativeMethod });
|
79
|
-
};
|
80
|
-
/**
|
81
|
-
* Returns the singleton instance of the interceptor
|
82
|
-
*/
|
83
|
-
PostMessageInterceptor.getInstance = function () {
|
84
|
-
return this._instance || (this._instance = new this());
|
85
|
-
};
|
86
|
-
/**
|
87
|
-
* Initialize the interceptor
|
88
|
-
*/
|
89
|
-
PostMessageInterceptor.prototype.init = function () {
|
90
|
-
this.reset();
|
91
|
-
this.log('Init');
|
92
|
-
this.registerFetchInterceptor();
|
93
|
-
};
|
94
|
-
/**
|
95
|
-
* Stops the interceptor
|
96
|
-
*/
|
97
|
-
PostMessageInterceptor.prototype.stop = function () {
|
98
|
-
this.reset();
|
99
|
-
this.log('Stop');
|
100
|
-
this.unregisterFetchInterceptor();
|
101
|
-
};
|
102
|
-
/**
|
103
|
-
* Resets the stack of lastCalls
|
104
|
-
*/
|
105
|
-
PostMessageInterceptor.prototype.reset = function () {
|
106
|
-
this.lastCalls = [];
|
107
|
-
};
|
108
|
-
/**
|
109
|
-
* Starts listening and saving postMessages
|
110
|
-
* @param conditionFnString The function string to be used as condition checker
|
111
|
-
*/
|
112
|
-
PostMessageInterceptor.prototype.listen = function (conditionFnString) {
|
113
|
-
this.listening = false;
|
114
|
-
this.reset();
|
115
|
-
if (conditionFnString) {
|
116
|
-
// eslint-disable-next-line no-eval -- done on purpose
|
117
|
-
this.conditionFn = eval(conditionFnString);
|
118
|
-
}
|
119
|
-
this.listening = true;
|
120
|
-
};
|
121
|
-
/**
|
122
|
-
* Stops listening
|
123
|
-
* NOTE: It resets the interceptor and clears the conditionFn (if any)
|
124
|
-
*/
|
125
|
-
PostMessageInterceptor.prototype.stopListening = function () {
|
126
|
-
this.listening = false;
|
127
|
-
this.reset();
|
128
|
-
this.conditionFn = undefined;
|
129
|
-
this.listening = true;
|
130
|
-
};
|
131
|
-
/**
|
132
|
-
* Get the messages stack
|
133
|
-
* @param timeoutInterval the interval, in ms, between each check
|
134
|
-
* @param retries number of tentatives if fail
|
135
|
-
* @param callback
|
136
|
-
*/
|
137
|
-
PostMessageInterceptor.prototype.getMessages = function (timeoutInterval, retries, callback) {
|
138
|
-
var _this = this;
|
139
|
-
var activeMessageWatch = function (remainingRetries) {
|
140
|
-
if (remainingRetries === 0 || _this.lastCalls.length > 0) {
|
141
|
-
var copyCalls = _this.lastCalls.slice();
|
142
|
-
_this.reset();
|
143
|
-
callback(copyCalls);
|
144
|
-
return;
|
145
|
-
}
|
146
|
-
else if (remainingRetries > 0) {
|
147
|
-
remainingRetries--;
|
148
|
-
}
|
149
|
-
setTimeout(function () { return activeMessageWatch(remainingRetries); }, timeoutInterval);
|
150
|
-
};
|
151
|
-
activeMessageWatch(retries);
|
152
|
-
};
|
153
|
-
return PostMessageInterceptor;
|
154
|
-
}());
|
155
|
-
Object.assign(window, { postMessageInterceptor: postMessageInterceptor });
|
156
|
-
})();
|
157
|
-
//# sourceMappingURL=_post-message-interceptor.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"_post-message-interceptor.js","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/_post-message-interceptor.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAOH,8CAA8C;AAC9C,CAAC;IACC;;OAEG;IACH,IAAM,sBAAsB;QAO1B;YACE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC;QAED;;;;WAIG;QACK,oCAAG,GAAX,UAAY,OAAe;YAAE,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,6BAAc;;YACzC,4EAA4E;YAC5E,OAAO,CAAC,GAAG,OAAX,OAAO,iBAAK,mCAA4B,OAAO,CAAE,GAAK,IAAI,UAAE;QAC9D,CAAC;QAED;;;;;WAKG;QACK,4CAAW,GAAnB,UAAoB,GAA2B,EAAE,YAAiB;YAAE,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,6BAAc;;YAChF,IAAI,CAAC,G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AS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACxD,IAAM,SAAS,GAAG,KAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;oBACzC,KAAI,CAAC,KAAK,EAAE,CAAC;oBACb,QAAQ,CAAC,SAAS,CAAC,CAAC;oBACpB,OAAO;gBACT,CAAC;qBAAM,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;oBAChC,gBAAgB,EAAE,CAAC;gBACrB,CAAC;gBAED,UAAU,CAAC,cAAM,OAAA,kBAAkB,CAAC,gBAAgB,CAAC,EAApC,CAAoC,EAAE,eAAe,CAAC,CAAC;YAC1E,CAAC,CAAC;YACF,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;QACH,6BAAC;IAAD,CAAC,AAhJ8B,GAgJ9B,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,sBAAsB,wBAAA,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC,EAAE,CAAC"}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A call to postMessage
|
3
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
4
|
-
*/
|
5
|
-
export interface PostMessageCall {
|
6
|
-
/** Data passed in the message */
|
7
|
-
data: any;
|
8
|
-
/** Target origin passed in the message */
|
9
|
-
targetOrigin: string;
|
10
|
-
/** Timestamp of the message */
|
11
|
-
timestamp: Date;
|
12
|
-
}
|
13
|
-
/**
|
14
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
15
|
-
*/
|
16
|
-
export type ConditionFn = (postCall: PostMessageCall) => boolean;
|
17
|
-
//# sourceMappingURL=core.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,eAAe,KAAK,OAAO,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/core.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A call to postMessage\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface PostMessageCall {\n /** Data passed in the message */\n data: any;\n /** Target origin passed in the message */\n targetOrigin: string;\n /** Timestamp of the message */\n timestamp: Date;\n}\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type ConditionFn = (postCall: PostMessageCall) => boolean;\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,4BAA4B,CAAC"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./core"), exports);
|
5
|
-
tslib_1.__exportStar(require("./post-message-interceptor"), exports);
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,qEAA2C","sourcesContent":["export * from './core';\nexport * from './post-message-interceptor';\n"]}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { ConditionFn, PostMessageCall } from './core';
|
2
|
-
/**
|
3
|
-
* Controls the postMessage interceptor
|
4
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
5
|
-
*/
|
6
|
-
export declare class PostMessageInterceptor {
|
7
|
-
private readonly GET_INSTANCE;
|
8
|
-
/**
|
9
|
-
* Executes a script in the app
|
10
|
-
* @param methodName
|
11
|
-
* @param {...any} args
|
12
|
-
*/
|
13
|
-
private execInstanceMethod;
|
14
|
-
/**
|
15
|
-
* Executes an async script in the app
|
16
|
-
* @param methodName
|
17
|
-
* @param {...any} args
|
18
|
-
*/
|
19
|
-
private execInstanceAsyncMethod;
|
20
|
-
/**
|
21
|
-
* Initializes the PostMessageInterceptor in the app
|
22
|
-
* NOTE: It does not start listening right away. You need to call listen()
|
23
|
-
*/
|
24
|
-
initialize(): Promise<void>;
|
25
|
-
/**
|
26
|
-
* Stops the PostMessageInterceptor.
|
27
|
-
*/
|
28
|
-
stop(): Promise<void>;
|
29
|
-
/**
|
30
|
-
* Listens for post messages
|
31
|
-
* @param conditionFn an optional boolean function that will evaluate if the message should be saved or not in the stack
|
32
|
-
*/
|
33
|
-
listen(conditionFn?: ConditionFn): Promise<void>;
|
34
|
-
/**
|
35
|
-
* Stops listening for post messages, resets the stack and clears the condition
|
36
|
-
*/
|
37
|
-
stopListening(): Promise<void>;
|
38
|
-
/**
|
39
|
-
* Get all the post messages
|
40
|
-
* @param timeoutInterval Interval in milliseconds between two checks
|
41
|
-
* @param retries How many retries to be executed (-1 for infinite retries)
|
42
|
-
*/
|
43
|
-
getMessages(timeoutInterval?: number, retries?: number): Promise<PostMessageCall[]>;
|
44
|
-
}
|
45
|
-
//# sourceMappingURL=post-message-interceptor.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"post-message-interceptor.d.ts","sourceRoot":"","sources":["../../../../src/tools/protractor/post-message-interceptor/post-message-interceptor.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,WAAW,EACX,eAAe,EAChB,MAAM,QAAQ,CAAC;AAEhB;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiD;IAE9E;;;;OAIG;YACW,kBAAkB;IAIhC;;;;OAIG;YACW,uBAAuB;IAIrC;;;OAGG;IACU,UAAU;IAWvB;;OAEG;IACU,IAAI;IAIjB;;;OAGG;IACU,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW;IAI7C;;OAEG;IACU,aAAa;IAI1B;;;;OAIG;IACU,WAAW,CAAC,eAAe,SAAM,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAG1F"}
|