@o3r/testing 13.0.0-next.1 → 13.0.0-next.16
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,144 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.PostMessageInterceptor = void 0;
|
4
|
-
var tslib_1 = require("tslib");
|
5
|
-
var fs = require("node:fs");
|
6
|
-
var path = require("node:path");
|
7
|
-
var protractor_1 = require("protractor");
|
8
|
-
/**
|
9
|
-
* Controls the postMessage interceptor
|
10
|
-
* @deprecated Will be removed in v13, please use Playwright instead
|
11
|
-
*/
|
12
|
-
var PostMessageInterceptor = /** @class */ (function () {
|
13
|
-
function PostMessageInterceptor() {
|
14
|
-
this.GET_INSTANCE = 'window.postMessageInterceptor.getInstance()';
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* Executes a script in the app
|
18
|
-
* @param methodName
|
19
|
-
* @param {...any} args
|
20
|
-
*/
|
21
|
-
PostMessageInterceptor.prototype.execInstanceMethod = function (methodName) {
|
22
|
-
var args = [];
|
23
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
24
|
-
args[_i - 1] = arguments[_i];
|
25
|
-
}
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
27
|
-
return tslib_1.__generator(this, function (_a) {
|
28
|
-
switch (_a.label) {
|
29
|
-
case 0: return [4 /*yield*/, protractor_1.browser.executeScript.apply(protractor_1.browser, tslib_1.__spreadArray(["".concat(this.GET_INSTANCE, ".").concat(methodName, "(...arguments);")], args, false))];
|
30
|
-
case 1: return [2 /*return*/, _a.sent()];
|
31
|
-
}
|
32
|
-
});
|
33
|
-
});
|
34
|
-
};
|
35
|
-
/**
|
36
|
-
* Executes an async script in the app
|
37
|
-
* @param methodName
|
38
|
-
* @param {...any} args
|
39
|
-
*/
|
40
|
-
PostMessageInterceptor.prototype.execInstanceAsyncMethod = function (methodName) {
|
41
|
-
var args = [];
|
42
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
43
|
-
args[_i - 1] = arguments[_i];
|
44
|
-
}
|
45
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
46
|
-
return tslib_1.__generator(this, function (_a) {
|
47
|
-
switch (_a.label) {
|
48
|
-
case 0: return [4 /*yield*/, protractor_1.browser.executeAsyncScript.apply(protractor_1.browser, tslib_1.__spreadArray(["".concat(this.GET_INSTANCE, ".").concat(methodName, "(...arguments);")], args, false))];
|
49
|
-
case 1: return [2 /*return*/, _a.sent()];
|
50
|
-
}
|
51
|
-
});
|
52
|
-
});
|
53
|
-
};
|
54
|
-
/**
|
55
|
-
* Initializes the PostMessageInterceptor in the app
|
56
|
-
* NOTE: It does not start listening right away. You need to call listen()
|
57
|
-
*/
|
58
|
-
PostMessageInterceptor.prototype.initialize = function () {
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
60
|
-
var fetchManager;
|
61
|
-
return tslib_1.__generator(this, function (_a) {
|
62
|
-
switch (_a.label) {
|
63
|
-
case 0:
|
64
|
-
fetchManager = fs.readFileSync(path.resolve(process.cwd(), 'node_modules', '@o3r', 'testing', 'tools', 'protractor', 'post-message-interceptor', '_post-message-interceptor.js'), {
|
65
|
-
encoding: 'utf8'
|
66
|
-
});
|
67
|
-
return [4 /*yield*/, protractor_1.browser.executeScript(fetchManager)];
|
68
|
-
case 1:
|
69
|
-
_a.sent();
|
70
|
-
return [4 /*yield*/, this.execInstanceMethod('init')];
|
71
|
-
case 2:
|
72
|
-
_a.sent();
|
73
|
-
return [2 /*return*/];
|
74
|
-
}
|
75
|
-
});
|
76
|
-
});
|
77
|
-
};
|
78
|
-
/**
|
79
|
-
* Stops the PostMessageInterceptor.
|
80
|
-
*/
|
81
|
-
PostMessageInterceptor.prototype.stop = function () {
|
82
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
83
|
-
return tslib_1.__generator(this, function (_a) {
|
84
|
-
switch (_a.label) {
|
85
|
-
case 0: return [4 /*yield*/, this.execInstanceMethod('stop')];
|
86
|
-
case 1:
|
87
|
-
_a.sent();
|
88
|
-
return [2 /*return*/];
|
89
|
-
}
|
90
|
-
});
|
91
|
-
});
|
92
|
-
};
|
93
|
-
/**
|
94
|
-
* Listens for post messages
|
95
|
-
* @param conditionFn an optional boolean function that will evaluate if the message should be saved or not in the stack
|
96
|
-
*/
|
97
|
-
PostMessageInterceptor.prototype.listen = function (conditionFn) {
|
98
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
99
|
-
return tslib_1.__generator(this, function (_a) {
|
100
|
-
switch (_a.label) {
|
101
|
-
case 0: return [4 /*yield*/, this.execInstanceMethod('listen', conditionFn)];
|
102
|
-
case 1:
|
103
|
-
_a.sent();
|
104
|
-
return [2 /*return*/];
|
105
|
-
}
|
106
|
-
});
|
107
|
-
});
|
108
|
-
};
|
109
|
-
/**
|
110
|
-
* Stops listening for post messages, resets the stack and clears the condition
|
111
|
-
*/
|
112
|
-
PostMessageInterceptor.prototype.stopListening = function () {
|
113
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
114
|
-
return tslib_1.__generator(this, function (_a) {
|
115
|
-
switch (_a.label) {
|
116
|
-
case 0: return [4 /*yield*/, this.execInstanceMethod('stopListening')];
|
117
|
-
case 1:
|
118
|
-
_a.sent();
|
119
|
-
return [2 /*return*/];
|
120
|
-
}
|
121
|
-
});
|
122
|
-
});
|
123
|
-
};
|
124
|
-
/**
|
125
|
-
* Get all the post messages
|
126
|
-
* @param timeoutInterval Interval in milliseconds between two checks
|
127
|
-
* @param retries How many retries to be executed (-1 for infinite retries)
|
128
|
-
*/
|
129
|
-
PostMessageInterceptor.prototype.getMessages = function () {
|
130
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (timeoutInterval, retries) {
|
131
|
-
if (timeoutInterval === void 0) { timeoutInterval = 100; }
|
132
|
-
if (retries === void 0) { retries = -1; }
|
133
|
-
return tslib_1.__generator(this, function (_a) {
|
134
|
-
switch (_a.label) {
|
135
|
-
case 0: return [4 /*yield*/, this.execInstanceAsyncMethod('getMessages', timeoutInterval, retries)];
|
136
|
-
case 1: return [2 /*return*/, (_a.sent())];
|
137
|
-
}
|
138
|
-
});
|
139
|
-
});
|
140
|
-
};
|
141
|
-
return PostMessageInterceptor;
|
142
|
-
}());
|
143
|
-
exports.PostMessageInterceptor = PostMessageInterceptor;
|
144
|
-
//# sourceMappingURL=post-message-interceptor.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"post-message-interceptor.js","sourceRoot":"","sources":["../../../../src/tools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kB,CAAC,MAAM,CAAC,EAAA;;wBAArC,SAAqC,CAAC;;;;;KACvC;IAED;;;OAGG;IACU,uCAAM,GAAnB,UAAoB,WAAyB;;;;4BAC3C,qBAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAA;;wBAApD,SAAoD,CAAC;;;;;KACtD;IAED;;OAEG;IACU,8CAAa,GAA1B;;;;4BACE,qBAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,EAAA;;wBAA9C,SAA8C,CAAC;;;;;KAChD;IAED;;;;OAIG;IACU,4CAAW,GAAxB;oEAAyB,eAAqB,EAAE,OAAY;YAAnC,gCAAA,EAAA,qBAAqB;YAAE,wBAAA,EAAA,WAAW,CAAC;;;4BAClD,qBAAM,IAAI,CAAC,uBAAuB,CAAC,aAAa,EAAE,eAAe,EAAE,OAAO,CAAC,EAAA;4BAAnF,sBAAO,CAAC,SAA2E,CAAsB,EAAC;;;;KAC3G;IACH,6BAAC;AAAD,CAAC,AAlED,IAkEC;AAlEY,wDAAsB","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport {\n browser,\n} from 'protractor';\nimport {\n ConditionFn,\n PostMessageCall,\n} from './core';\n\n/**\n * Controls the postMessage interceptor\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class PostMessageInterceptor {\n private readonly GET_INSTANCE = 'window.postMessageInterceptor.getInstance()';\n\n /**\n * Executes a script in the app\n * @param methodName\n * @param {...any} args\n */\n private async execInstanceMethod(methodName: string, ...args: any[]) {\n return await browser.executeScript(`${this.GET_INSTANCE}.${methodName}(...arguments);`, ...args);\n }\n\n /**\n * Executes an async script in the app\n * @param methodName\n * @param {...any} args\n */\n private async execInstanceAsyncMethod(methodName: string, ...args: any[]) {\n return await browser.executeAsyncScript(`${this.GET_INSTANCE}.${methodName}(...arguments);`, ...args);\n }\n\n /**\n * Initializes the PostMessageInterceptor in the app\n * NOTE: It does not start listening right away. You need to call listen()\n */\n public async initialize() {\n const fetchManager = fs.readFileSync(\n path.resolve(process.cwd(), 'node_modules', '@o3r', 'testing', 'tools', 'protractor', 'post-message-interceptor', '_post-message-interceptor.js'),\n {\n encoding: 'utf8'\n }\n );\n await browser.executeScript(fetchManager);\n await this.execInstanceMethod('init');\n }\n\n /**\n * Stops the PostMessageInterceptor.\n */\n public async stop() {\n await this.execInstanceMethod('stop');\n }\n\n /**\n * Listens for post messages\n * @param conditionFn an optional boolean function that will evaluate if the message should be saved or not in the stack\n */\n public async listen(conditionFn?: ConditionFn) {\n await this.execInstanceMethod('listen', conditionFn);\n }\n\n /**\n * Stops listening for post messages, resets the stack and clears the condition\n */\n public async stopListening() {\n await this.execInstanceMethod('stopListening');\n }\n\n /**\n * Get all the post messages\n * @param timeoutInterval Interval in milliseconds between two checks\n * @param retries How many retries to be executed (-1 for infinite retries)\n */\n public async getMessages(timeoutInterval = 100, retries = -1): Promise<PostMessageCall[]> {\n return (await this.execInstanceAsyncMethod('getMessages', timeoutInterval, retries)) as PostMessageCall[];\n }\n}\n"]}
|