@o3r/testing 13.0.0-next.0 → 13.0.0-next.2

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.
Files changed (101) hide show
  1. package/package.json +13 -30
  2. package/tools/index.d.ts +0 -1
  3. package/tools/index.d.ts.map +1 -1
  4. package/tools/index.js +0 -1
  5. package/tools/index.js.map +1 -1
  6. package/tools/path-replacement/path-replacement.d.ts +2 -2
  7. package/tools/path-replacement/path-replacement.d.ts.map +1 -1
  8. package/tools/path-replacement/path-replacement.js +2 -1
  9. package/tools/path-replacement/path-replacement.js.map +1 -1
  10. package/core/protractor/angular-materials/autocomplete-material.d.ts +0 -13
  11. package/core/protractor/angular-materials/autocomplete-material.d.ts.map +0 -1
  12. package/core/protractor/angular-materials/autocomplete-material.js +0 -37
  13. package/core/protractor/angular-materials/autocomplete-material.js.map +0 -1
  14. package/core/protractor/angular-materials/index.d.ts +0 -3
  15. package/core/protractor/angular-materials/index.d.ts.map +0 -1
  16. package/core/protractor/angular-materials/index.js +0 -6
  17. package/core/protractor/angular-materials/index.js.map +0 -1
  18. package/core/protractor/angular-materials/select-material.d.ts +0 -19
  19. package/core/protractor/angular-materials/select-material.d.ts.map +0 -1
  20. package/core/protractor/angular-materials/select-material.js +0 -113
  21. package/core/protractor/angular-materials/select-material.js.map +0 -1
  22. package/core/protractor/component-fixture.d.ts +0 -126
  23. package/core/protractor/component-fixture.d.ts.map +0 -1
  24. package/core/protractor/component-fixture.js +0 -274
  25. package/core/protractor/component-fixture.js.map +0 -1
  26. package/core/protractor/element.d.ts +0 -38
  27. package/core/protractor/element.d.ts.map +0 -1
  28. package/core/protractor/element.js +0 -145
  29. package/core/protractor/element.js.map +0 -1
  30. package/core/protractor/elements/checkbox-element.d.ts +0 -17
  31. package/core/protractor/elements/checkbox-element.d.ts.map +0 -1
  32. package/core/protractor/elements/checkbox-element.js +0 -54
  33. package/core/protractor/elements/checkbox-element.js.map +0 -1
  34. package/core/protractor/elements/index.d.ts +0 -4
  35. package/core/protractor/elements/index.d.ts.map +0 -1
  36. package/core/protractor/elements/index.js +0 -7
  37. package/core/protractor/elements/index.js.map +0 -1
  38. package/core/protractor/elements/radio-element.d.ts +0 -17
  39. package/core/protractor/elements/radio-element.d.ts.map +0 -1
  40. package/core/protractor/elements/radio-element.js +0 -56
  41. package/core/protractor/elements/radio-element.js.map +0 -1
  42. package/core/protractor/elements/select-element.d.ts +0 -15
  43. package/core/protractor/elements/select-element.d.ts.map +0 -1
  44. package/core/protractor/elements/select-element.js +0 -49
  45. package/core/protractor/elements/select-element.js.map +0 -1
  46. package/core/protractor/group.d.ts +0 -21
  47. package/core/protractor/group.d.ts.map +0 -1
  48. package/core/protractor/group.js +0 -27
  49. package/core/protractor/group.js.map +0 -1
  50. package/core/protractor/groups/index.d.ts +0 -2
  51. package/core/protractor/groups/index.d.ts.map +0 -1
  52. package/core/protractor/groups/index.js +0 -5
  53. package/core/protractor/groups/index.js.map +0 -1
  54. package/core/protractor/groups/radio-group.d.ts +0 -17
  55. package/core/protractor/groups/radio-group.d.ts.map +0 -1
  56. package/core/protractor/groups/radio-group.js +0 -80
  57. package/core/protractor/groups/radio-group.js.map +0 -1
  58. package/core/protractor/index.d.ts +0 -9
  59. package/core/protractor/index.d.ts.map +0 -1
  60. package/core/protractor/index.js +0 -11
  61. package/core/protractor/index.js.map +0 -1
  62. package/core/protractor/page-fixture.d.ts +0 -13
  63. package/core/protractor/page-fixture.d.ts.map +0 -1
  64. package/core/protractor/page-fixture.js +0 -23
  65. package/core/protractor/page-fixture.js.map +0 -1
  66. package/core/protractor/utils.d.ts +0 -8
  67. package/core/protractor/utils.d.ts.map +0 -1
  68. package/core/protractor/utils.js +0 -12
  69. package/core/protractor/utils.js.map +0 -1
  70. package/tools/protractor/fetch-manager/_fetch-manager.d.ts +0 -1
  71. package/tools/protractor/fetch-manager/_fetch-manager.d.ts.map +0 -1
  72. package/tools/protractor/fetch-manager/_fetch-manager.js +0 -127
  73. package/tools/protractor/fetch-manager/_fetch-manager.js.map +0 -1
  74. package/tools/protractor/fetch-manager/index.d.ts +0 -2
  75. package/tools/protractor/fetch-manager/index.d.ts.map +0 -1
  76. package/tools/protractor/fetch-manager/index.js +0 -5
  77. package/tools/protractor/fetch-manager/index.js.map +0 -1
  78. package/tools/protractor/fetch-manager/utils.d.ts +0 -25
  79. package/tools/protractor/fetch-manager/utils.d.ts.map +0 -1
  80. package/tools/protractor/fetch-manager/utils.js +0 -81
  81. package/tools/protractor/fetch-manager/utils.js.map +0 -1
  82. package/tools/protractor/index.d.ts +0 -3
  83. package/tools/protractor/index.d.ts.map +0 -1
  84. package/tools/protractor/index.js +0 -6
  85. package/tools/protractor/index.js.map +0 -1
  86. package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts +0 -5
  87. package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts.map +0 -1
  88. package/tools/protractor/post-message-interceptor/_post-message-interceptor.js +0 -157
  89. package/tools/protractor/post-message-interceptor/_post-message-interceptor.js.map +0 -1
  90. package/tools/protractor/post-message-interceptor/core.d.ts +0 -17
  91. package/tools/protractor/post-message-interceptor/core.d.ts.map +0 -1
  92. package/tools/protractor/post-message-interceptor/core.js +0 -3
  93. package/tools/protractor/post-message-interceptor/core.js.map +0 -1
  94. package/tools/protractor/post-message-interceptor/index.d.ts +0 -3
  95. package/tools/protractor/post-message-interceptor/index.d.ts.map +0 -1
  96. package/tools/protractor/post-message-interceptor/index.js +0 -6
  97. package/tools/protractor/post-message-interceptor/index.js.map +0 -1
  98. package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts +0 -45
  99. package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts.map +0 -1
  100. package/tools/protractor/post-message-interceptor/post-message-interceptor.js +0 -144
  101. package/tools/protractor/post-message-interceptor/post-message-interceptor.js.map +0 -1
@@ -1,274 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.O3rComponentFixture = void 0;
4
- var tslib_1 = require("tslib");
5
- var protractor_1 = require("protractor");
6
- var index_1 = require("../../errors/index");
7
- var helpers_1 = require("../helpers");
8
- var element_1 = require("./element");
9
- var utils_1 = require("./utils");
10
- /**
11
- * Implementation of the fixture dedicated to protractor, hence using the webdriver to interact with the dom.
12
- * @deprecated Will be removed in v13, please use Playwright instead
13
- */
14
- var O3rComponentFixture = /** @class */ (function () {
15
- /**
16
- * Root element of this fixture. Optional in a Protractor.
17
- * All further queries will be applied to the element tree if any, otherwise they will be applied to the whole DOM.
18
- * @param rootElement
19
- */
20
- function O3rComponentFixture(rootElement) {
21
- this.rootElement = rootElement;
22
- }
23
- /**
24
- * Throws an exception if the element is undefined.
25
- * Otherwise returns the element.
26
- * @param elemnt ElementProfile to test
27
- * @param _timeout specific timeout that will throw when reach
28
- */
29
- O3rComponentFixture.prototype.throwOnUndefinedElement = function (elemnt, _timeout) {
30
- if (!elemnt) {
31
- throw new Error('Element not found in ' + this.constructor.name);
32
- }
33
- return Promise.resolve(elemnt);
34
- };
35
- /**
36
- * Throws an exception if the element is undefined.
37
- * Otherwise returns the element.
38
- * @param elemnt ElementProfile to test
39
- * @param timeout specific timeout that will throw when reach
40
- */
41
- O3rComponentFixture.prototype.throwOnUndefined = function (elemnt, timeout) {
42
- return tslib_1.__awaiter(this, void 0, void 0, function () {
43
- var _this = this;
44
- return tslib_1.__generator(this, function (_a) {
45
- return [2 /*return*/, (0, helpers_1.withTimeout)(elemnt, timeout)
46
- .then(function (el) {
47
- if (!el) {
48
- throw new Error('Element not found in ' + _this.constructor.name);
49
- }
50
- return el;
51
- })];
52
- });
53
- });
54
- };
55
- /**
56
- * Get the element associated to the selector if present
57
- * @param selector Selector to access the element
58
- * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
59
- * @param options Options supported
60
- * @param options.index index Select the element associated to the index
61
- * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
62
- * @param options.timeout Duration to wait for the element to be present before it throws
63
- */
64
- O3rComponentFixture.prototype.queryWithOptions = function (selector_1, elementConstructor_1) {
65
- return tslib_1.__awaiter(this, arguments, void 0, function (selector, elementConstructor, options) {
66
- var queryElement;
67
- if (options === void 0) { options = {}; }
68
- return tslib_1.__generator(this, function (_a) {
69
- switch (_a.label) {
70
- case 0: return [4 /*yield*/, (options.index === undefined
71
- ? this.query(selector, elementConstructor)
72
- : this.queryNth(selector, options.index, elementConstructor))];
73
- case 1:
74
- queryElement = _a.sent();
75
- if (options.shouldThrowIfNotPresent) {
76
- return [2 /*return*/, this.throwOnUndefinedElement(queryElement, options.timeout)];
77
- }
78
- return [2 /*return*/, queryElement];
79
- }
80
- });
81
- });
82
- };
83
- /**
84
- * Get text from the element associated to the given selector, or undefined if the element is not found or not visible
85
- * @param selector Selector to access the element
86
- * @param options Options supported
87
- * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
88
- * @param options.index index Select the element associated to the index
89
- * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
90
- * @param options.timeout Duration to wait for the element to be present before it throws
91
- */
92
- O3rComponentFixture.prototype.getText = function (selector_1) {
93
- return tslib_1.__awaiter(this, arguments, void 0, function (selector, options) {
94
- var getTextElement, _a;
95
- if (options === void 0) { options = {}; }
96
- return tslib_1.__generator(this, function (_b) {
97
- switch (_b.label) {
98
- case 0: return [4 /*yield*/, this.queryWithOptions(selector, options.elementConstructor, options)];
99
- case 1:
100
- getTextElement = _b.sent();
101
- _a = !getTextElement;
102
- if (_a) return [3 /*break*/, 3];
103
- return [4 /*yield*/, getTextElement.isVisible()];
104
- case 2:
105
- _a = !(_b.sent());
106
- _b.label = 3;
107
- case 3:
108
- if (_a) {
109
- return [2 /*return*/];
110
- }
111
- return [4 /*yield*/, getTextElement.getText()];
112
- case 4: return [2 /*return*/, _b.sent()];
113
- }
114
- });
115
- });
116
- };
117
- /**
118
- * Check if the element associated to the given selector is visible
119
- * @param selector Selector to access the element
120
- * @param options Options supported
121
- * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
122
- * @param options.index index Select the element associated to the index
123
- * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
124
- * @param options.timeout Duration to wait for the element to be present before it throws
125
- */
126
- O3rComponentFixture.prototype.isVisible = function (selector_1) {
127
- return tslib_1.__awaiter(this, arguments, void 0, function (selector, options) {
128
- var isVisibleElement, _a;
129
- if (options === void 0) { options = {}; }
130
- return tslib_1.__generator(this, function (_b) {
131
- switch (_b.label) {
132
- case 0: return [4 /*yield*/, this.queryWithOptions(selector, options.elementConstructor, options)];
133
- case 1:
134
- isVisibleElement = _b.sent();
135
- _a = !!isVisibleElement;
136
- if (!_a) return [3 /*break*/, 3];
137
- return [4 /*yield*/, isVisibleElement.isVisible()];
138
- case 2:
139
- _a = (_b.sent());
140
- _b.label = 3;
141
- case 3: return [2 /*return*/, _a];
142
- }
143
- });
144
- });
145
- };
146
- /**
147
- * Click on the element associated to the given selector if it exists and is visible
148
- * @param selector Selector to access the element
149
- * @param options Options supported
150
- * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
151
- * @param options.index index Select the element associated to the index
152
- * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
153
- * @param options.timeout Duration to wait for the element to be present before it throws
154
- */
155
- O3rComponentFixture.prototype.click = function (selector_1) {
156
- return tslib_1.__awaiter(this, arguments, void 0, function (selector, options) {
157
- var clickElement, _a;
158
- if (options === void 0) { options = {}; }
159
- return tslib_1.__generator(this, function (_b) {
160
- switch (_b.label) {
161
- case 0: return [4 /*yield*/, this.queryWithOptions(selector, options.elementConstructor, options)];
162
- case 1:
163
- clickElement = _b.sent();
164
- _a = !!clickElement;
165
- if (!_a) return [3 /*break*/, 3];
166
- return [4 /*yield*/, clickElement.isVisible()];
167
- case 2:
168
- _a = (_b.sent());
169
- _b.label = 3;
170
- case 3:
171
- if (!_a) return [3 /*break*/, 5];
172
- return [4 /*yield*/, clickElement.click()];
173
- case 4:
174
- _b.sent();
175
- _b.label = 5;
176
- case 5: return [2 /*return*/];
177
- }
178
- });
179
- });
180
- };
181
- O3rComponentFixture.prototype.query = function (selector, returnType) {
182
- return tslib_1.__awaiter(this, void 0, void 0, function () {
183
- var sourceElement, cssSelector, isElPresent, queriedElement;
184
- return tslib_1.__generator(this, function (_a) {
185
- switch (_a.label) {
186
- case 0:
187
- sourceElement = this.rootElement && this.rootElement.sourceElement;
188
- cssSelector = protractor_1.By.css(selector);
189
- return [4 /*yield*/, (sourceElement ? sourceElement.isElementPresent(cssSelector) : protractor_1.browser.isElementPresent(cssSelector))];
190
- case 1:
191
- isElPresent = _a.sent();
192
- if (!isElPresent) {
193
- // eslint-disable-next-line no-console -- no other logger available
194
- console.warn("No component matching ".concat(selector, " found"));
195
- return [2 /*return*/];
196
- }
197
- queriedElement = sourceElement ? sourceElement.element(cssSelector) : (0, protractor_1.element)(cssSelector);
198
- return [2 /*return*/, returnType ? new returnType(queriedElement) : new element_1.O3rElement(queriedElement)];
199
- }
200
- });
201
- });
202
- };
203
- O3rComponentFixture.prototype.queryNth = function (selector, index, returnType) {
204
- return tslib_1.__awaiter(this, void 0, void 0, function () {
205
- var sourceElement, item;
206
- return tslib_1.__generator(this, function (_a) {
207
- switch (_a.label) {
208
- case 0:
209
- sourceElement = this.rootElement && this.rootElement.sourceElement;
210
- item = (sourceElement || protractor_1.element).all(protractor_1.By.css(selector)).get(index);
211
- return [4 /*yield*/, item.isPresent()];
212
- case 1:
213
- if (!(_a.sent())) {
214
- // eslint-disable-next-line no-console -- no other logger available
215
- console.warn("No component matching ".concat(selector, ":nth(").concat(index, ") found"));
216
- return [2 /*return*/];
217
- }
218
- return [2 /*return*/, new (returnType || element_1.O3rElement)(item)];
219
- }
220
- });
221
- });
222
- };
223
- O3rComponentFixture.prototype.queryAll = function (selector, returnType, groupType, _timeout) {
224
- return tslib_1.__awaiter(this, void 0, void 0, function () {
225
- var pElements, elements, group, isValid;
226
- return tslib_1.__generator(this, function (_a) {
227
- switch (_a.label) {
228
- case 0:
229
- pElements = (this.rootElement ? this.rootElement.sourceElement.all(protractor_1.By.css(selector)) : protractor_1.element.all(protractor_1.By.css(selector)))
230
- .filter(function (item) { return typeof item !== 'undefined'; })
231
- .then(function (elf) { return elf.map(function (item) { return (returnType ? new returnType(item) : new element_1.O3rElement(item)); }); });
232
- return [4 /*yield*/, (0, utils_1.convertPromise)(pElements)];
233
- case 1:
234
- elements = _a.sent();
235
- if (!groupType) return [3 /*break*/, 3];
236
- group = new groupType(elements);
237
- return [4 /*yield*/, group.isValidGroup()];
238
- case 2:
239
- isValid = _a.sent();
240
- if (!isValid) {
241
- throw new index_1.FixtureUsageError('invalid group of items');
242
- }
243
- return [2 /*return*/, Promise.resolve(group)];
244
- case 3: return [2 /*return*/, elements];
245
- }
246
- });
247
- });
248
- };
249
- /** @inheritdoc */
250
- O3rComponentFixture.prototype.getElement = function () {
251
- return this.rootElement;
252
- };
253
- /** @inheritdoc */
254
- O3rComponentFixture.prototype.getSubComponents = function () {
255
- return Promise.resolve({ block: [this] });
256
- };
257
- /** @inheritDoc */
258
- O3rComponentFixture.prototype.queryNotPresent = function (selector, _timeout) {
259
- return tslib_1.__awaiter(this, void 0, void 0, function () {
260
- var sourceElement;
261
- return tslib_1.__generator(this, function (_a) {
262
- switch (_a.label) {
263
- case 0:
264
- sourceElement = this.rootElement && this.rootElement.sourceElement;
265
- return [4 /*yield*/, (sourceElement || protractor_1.browser).isElementPresent(protractor_1.By.css(selector))];
266
- case 1: return [2 /*return*/, !(_a.sent())];
267
- }
268
- });
269
- });
270
- };
271
- return O3rComponentFixture;
272
- }());
273
- exports.O3rComponentFixture = O3rComponentFixture;
274
- //# sourceMappingURL=component-fixture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/protractor/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAKoB;AACpB,4CAE4B;AAM5B,sCAEoB;AACpB,qCAImB;AAKnB,iCAEiB;AAiBjB;;;GA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wBAAwB,CAAC,CAAC;wBACxD,CAAC;wBACD,sBAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC;4BAGhC,sBAAO,QAAQ,EAAC;;;;KACjB;IAED,kBAAkB;IACX,wCAAU,GAAjB;QACE,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,kBAAkB;IACX,8CAAgB,GAAvB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,kBAAkB;IACL,6CAAe,GAA5B,UAA6B,QAAgB,EAAE,QAAiB;;;;;;wBACxD,aAAa,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;wBAChE,qBAAM,CAAC,aAAa,IAAI,oBAAO,CAAC,CAAC,gBAAgB,CAAC,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAA;4BAA5E,sBAAO,CAAC,CAAC,SAAmE,CAAC,EAAC;;;;KAC/E;IACH,0BAAC;AAAD,CAAC,AAhND,IAgNC;AAhNY,kDAAmB","sourcesContent":["import {\n browser,\n By,\n element,\n ElementFinder,\n} from 'protractor';\nimport {\n FixtureUsageError,\n} from '../../errors/index';\nimport type {\n ComponentFixtureProfile as ComponentFixtureProfileCore,\n Constructable as ConstructableCore,\n FixtureWithCustom as FixtureWithCustomCore,\n} from '../component-fixture';\nimport {\n withTimeout,\n} from '../helpers';\nimport {\n ElementProfile,\n O3rElement,\n O3rElementConstructor,\n} from './element';\nimport {\n O3rGroup,\n O3rGroupConstructor,\n} from './group';\nimport {\n convertPromise,\n} from './utils';\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface ComponentFixtureProfile<V extends ElementProfile = ElementProfile> extends ComponentFixtureProfileCore<V> {}\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface FixtureWithCustom extends FixtureWithCustomCore {}\n\n/**\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport interface Constructable<T extends ComponentFixtureProfile, U extends FixtureWithCustom = FixtureWithCustom> extends ConstructableCore<T, U> {}\n\n/**\n * Implementation of the fixture dedicated to protractor, hence using the webdriver to interact with the dom.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected rootElement?: V;\n\n /**\n * Root element of this fixture. Optional in a Protractor.\n * All further queries will be applied to the element tree if any, otherwise they will be applied to the whole DOM.\n * @param rootElement\n */\n constructor(rootElement?: V) {\n this.rootElement = rootElement;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(elemnt?: T, _timeout?: number): Promise<T> {\n if (!elemnt) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(elemnt);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param elemnt ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(elemnt: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(elemnt, timeout)\n .then((el) => {\n if (!el) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return el;\n });\n }\n\n /**\n * Get the element associated to the selector if present\n * @param selector Selector to access the element\n * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options Options supported\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async queryWithOptions(\n selector: string,\n elementConstructor?: O3rElementConstructor<O3rElement>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<O3rElement | undefined> {\n const queryElement: O3rElement | undefined = await (\n options.index === undefined\n ? this.query(selector, elementConstructor as any)\n : this.queryNth(selector, options.index, elementConstructor as any)\n );\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(queryElement, options.timeout);\n }\n return queryElement;\n }\n\n /**\n * Get text from the element associated to the given selector, or undefined if the element is not found or not visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async getText<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const getTextElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!getTextElement || !await getTextElement.isVisible()) {\n return;\n }\n return await getTextElement.getText();\n }\n\n /**\n * Check if the element associated to the given selector is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async isVisible<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<boolean> {\n const isVisibleElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n return !!isVisibleElement && await isVisibleElement.isVisible();\n }\n\n /**\n * Click on the element associated to the given selector if it exists and is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async click<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<void> {\n const clickElement = await this.queryWithOptions(selector, options.elementConstructor, options);\n if (!!clickElement && await clickElement.isVisible()) {\n await clickElement.click();\n }\n }\n\n /** @inheritdoc */\n public async query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const cssSelector = By.css(selector);\n const isElPresent = await (sourceElement ? sourceElement.isElementPresent(cssSelector) : browser.isElementPresent(cssSelector));\n if (!isElPresent) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector} found`);\n return;\n }\n const queriedElement = sourceElement ? sourceElement.element(cssSelector) : element(cssSelector);\n return returnType ? new returnType(queriedElement) : new O3rElement(queriedElement);\n }\n\n /** @inheritdoc */\n public async queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public async queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n const item = (sourceElement || element).all(By.css(selector)).get(index);\n if (!(await item.isPresent())) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`No component matching ${selector}:nth(${index}) found`);\n return;\n }\n return new (returnType || O3rElement)(item);\n }\n\n /** @inheritdoc */\n public async queryAll(_selector: string, _returnType?: undefined, groupType?: undefined, timeout?: number): Promise<O3rElement[]>;\n public async queryAll<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>, groupType?: undefined, timeout?: number): Promise<T[]>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(selector: string, returnType: O3rElementConstructor<T>, groupType: O3rGroupConstructor<K, T>, timeout?: number): Promise<K>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(\n selector: string,\n returnType: O3rElementConstructor<T> | undefined,\n groupType: O3rGroupConstructor<K, T> | undefined,\n _timeout?: number\n ): Promise<(T | O3rElement)[] | K> {\n const pElements = (this.rootElement ? this.rootElement.sourceElement.all(By.css(selector)) : element.all(By.css(selector)))\n .filter((item) => typeof item !== 'undefined')\n .then((elf: ElementFinder[]) => elf.map((item) => (returnType ? new returnType(item) : new O3rElement(item))));\n const elements = await convertPromise(pElements);\n\n if (groupType) {\n const group = new groupType(elements as T[]);\n const isValid = await group.isValidGroup();\n\n if (!isValid) {\n throw new FixtureUsageError('invalid group of items');\n }\n return Promise.resolve(group);\n }\n\n return elements;\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.rootElement;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({ block: [this] });\n }\n\n /** @inheritDoc */\n public async queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n const sourceElement = this.rootElement && this.rootElement.sourceElement;\n return !(await (sourceElement || browser).isElementPresent(By.css(selector)));\n }\n}\n"]}
@@ -1,38 +0,0 @@
1
- import { ElementFinder } from 'protractor';
2
- import { ElementProfile } from '../element';
3
- export { ElementProfile } from '../element';
4
- /**
5
- * Implementation dedicated to protractor.
6
- * @deprecated Will be removed in v13, please use Playwright instead
7
- */
8
- export declare class O3rElement implements ElementProfile {
9
- /** Protractor ElementProfile */
10
- sourceElement: ElementFinder;
11
- constructor(sourceElement: ElementFinder | O3rElement);
12
- /** @inheritdoc */
13
- getText(): Promise<string>;
14
- /** @inheritdoc */
15
- getPlainText(): Promise<string | undefined>;
16
- /** @inheritdoc */
17
- getInnerHTML(): Promise<string | undefined>;
18
- /** @inheritdoc */
19
- mouseOver(): Promise<void>;
20
- /** @inheritdoc */
21
- getValue(): Promise<string | undefined>;
22
- /** @inheritdoc */
23
- setValue(input: string): Promise<void>;
24
- /** @inheritdoc */
25
- clearValue(): Promise<void>;
26
- /** @inheritdoc */
27
- click(): Promise<void>;
28
- /** @inheritdoc */
29
- isVisible(): Promise<boolean>;
30
- /** @inheritdoc */
31
- getAttribute(attributeName: string): Promise<string | undefined>;
32
- }
33
- /**
34
- * Constructor of a O3rElement
35
- * @deprecated Will be removed in v13, please use Playwright instead
36
- */
37
- export type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: ElementFinder | O3rElement) => T;
38
- //# sourceMappingURL=element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACd,MAAM,YAAY,CAAC;AAOpB,OAAO,EACL,cAAc,EACf,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;GAGG;AACH,qBAAa,UAAW,YAAW,cAAc;IAC/C,gCAAgC;IACzB,aAAa,EAAE,aAAa,CAAC;gBAExB,aAAa,EAAE,aAAa,GAAG,UAAU;IAIrD,kBAAkB;IACX,OAAO;IAId,kBAAkB;IACL,YAAY;IAKzB,kBAAkB;IACX,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIlD,kBAAkB;IACX,SAAS;IAShB,kBAAkB;IACL,QAAQ;IAKrB,kBAAkB;IACL,QAAQ,CAAC,KAAK,EAAE,MAAM;IAQnC,kBAAkB;IACL,UAAU;IASvB,kBAAkB;IACL,KAAK;IAKlB,kBAAkB;IACL,SAAS;IAItB,kBAAkB;IACL,YAAY,CAAC,aAAa,EAAE,MAAM;CAIhD;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,cAAc,IAAI,KAAK,aAAa,EAAE,aAAa,GAAG,UAAU,KAAK,CAAC,CAAC"}
@@ -1,145 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.O3rElement = void 0;
4
- var tslib_1 = require("tslib");
5
- var protractor_1 = require("protractor");
6
- var ptor_1 = require("protractor/built/ptor");
7
- var protractor_2 = require("../../tools/protractor");
8
- var utils_1 = require("./utils");
9
- /**
10
- * Implementation dedicated to protractor.
11
- * @deprecated Will be removed in v13, please use Playwright instead
12
- */
13
- var O3rElement = /** @class */ (function () {
14
- function O3rElement(sourceElement) {
15
- this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;
16
- }
17
- /** @inheritdoc */
18
- O3rElement.prototype.getText = function () {
19
- return (0, utils_1.convertPromise)(this.sourceElement.getText());
20
- };
21
- /** @inheritdoc */
22
- O3rElement.prototype.getPlainText = function () {
23
- return tslib_1.__awaiter(this, void 0, void 0, function () {
24
- var innerText;
25
- return tslib_1.__generator(this, function (_a) {
26
- switch (_a.label) {
27
- case 0: return [4 /*yield*/, this.getText()];
28
- case 1:
29
- innerText = _a.sent();
30
- return [2 /*return*/, Promise.resolve(innerText ? innerText.replace(/\r\n|\r|\n/g, ' ').replace(/\s\s+/g, ' ').trim() : undefined)];
31
- }
32
- });
33
- });
34
- };
35
- /** @inheritdoc */
36
- O3rElement.prototype.getInnerHTML = function () {
37
- return (0, utils_1.convertPromise)(this.sourceElement.getInnerHtml());
38
- };
39
- /** @inheritdoc */
40
- O3rElement.prototype.mouseOver = function () {
41
- return (0, utils_1.convertPromise)(protractor_1.browser
42
- .actions()
43
- .mouseMove(this.sourceElement)
44
- .perform());
45
- };
46
- /** @inheritdoc */
47
- O3rElement.prototype.getValue = function () {
48
- return tslib_1.__awaiter(this, void 0, void 0, function () {
49
- var value;
50
- return tslib_1.__generator(this, function (_a) {
51
- switch (_a.label) {
52
- case 0: return [4 /*yield*/, this.sourceElement.getAttribute('value')];
53
- case 1:
54
- value = _a.sent();
55
- return [2 /*return*/, value === null ? undefined : value];
56
- }
57
- });
58
- });
59
- };
60
- /** @inheritdoc */
61
- O3rElement.prototype.setValue = function (input) {
62
- return tslib_1.__awaiter(this, void 0, void 0, function () {
63
- return tslib_1.__generator(this, function (_a) {
64
- switch (_a.label) {
65
- case 0:
66
- // Clears the value in the field
67
- return [4 /*yield*/, this.clearValue()];
68
- case 1:
69
- // Clears the value in the field
70
- _a.sent();
71
- return [4 /*yield*/, this.sourceElement.sendKeys(input)];
72
- case 2:
73
- _a.sent();
74
- return [4 /*yield*/, this.sourceElement.sendKeys(ptor_1.protractor.Key.TAB)];
75
- case 3:
76
- _a.sent();
77
- return [2 /*return*/, (0, protractor_2.waitForOtterStable)()];
78
- }
79
- });
80
- });
81
- };
82
- /** @inheritdoc */
83
- O3rElement.prototype.clearValue = function () {
84
- return tslib_1.__awaiter(this, void 0, void 0, function () {
85
- var currentValue;
86
- var _a;
87
- return tslib_1.__generator(this, function (_b) {
88
- switch (_b.label) {
89
- case 0: return [4 /*yield*/, this.getValue()];
90
- case 1:
91
- currentValue = _b.sent();
92
- if (!(currentValue !== undefined)) return [3 /*break*/, 3];
93
- // eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
94
- return [4 /*yield*/, (_a = this.sourceElement).sendKeys.apply(_a, (new Array(currentValue.length + 1).fill(ptor_1.protractor.Key.BACK_SPACE)))];
95
- case 2:
96
- // eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
97
- _b.sent();
98
- _b.label = 3;
99
- case 3: return [2 /*return*/];
100
- }
101
- });
102
- });
103
- };
104
- /** @inheritdoc */
105
- O3rElement.prototype.click = function () {
106
- return tslib_1.__awaiter(this, void 0, void 0, function () {
107
- return tslib_1.__generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0: return [4 /*yield*/, this.sourceElement.click()];
110
- case 1:
111
- _a.sent();
112
- return [2 /*return*/, (0, protractor_2.waitForOtterStable)()];
113
- }
114
- });
115
- });
116
- };
117
- /** @inheritdoc */
118
- O3rElement.prototype.isVisible = function () {
119
- return tslib_1.__awaiter(this, void 0, void 0, function () {
120
- return tslib_1.__generator(this, function (_a) {
121
- switch (_a.label) {
122
- case 0: return [4 /*yield*/, this.sourceElement.isDisplayed()];
123
- case 1: return [2 /*return*/, _a.sent()];
124
- }
125
- });
126
- });
127
- };
128
- /** @inheritdoc */
129
- O3rElement.prototype.getAttribute = function (attributeName) {
130
- return tslib_1.__awaiter(this, void 0, void 0, function () {
131
- var attribute;
132
- return tslib_1.__generator(this, function (_a) {
133
- switch (_a.label) {
134
- case 0: return [4 /*yield*/, this.sourceElement.getAttribute(attributeName)];
135
- case 1:
136
- attribute = _a.sent();
137
- return [2 /*return*/, attribute === null ? undefined : attribute];
138
- }
139
- });
140
- });
141
- };
142
- return O3rElement;
143
- }());
144
- exports.O3rElement = O3rElement;
145
- //# sourceMappingURL=element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":";;;;AAAA,yCAGoB;AACpB,8CAE+B;AAC/B,qDAEgC;AAIhC,iCAEiB;AAIjB;;;GAGG;AACH;IAIE,oBAAY,aAAyC;QACnD,IAAI,CAAC,aAAa,GAAG,aAAa,YAAY,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;IACzG,CAAC;IAED,kBAAkB;IACX,4BAAO,GAAd;QACE,OAAO,IAAA,sBAAc,EAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,kBAAkB;IACL,iCAAY,GAAzB;;;;;4BACoB,qBAAM,IAAI,CAAC,OAAO,EAAE,EAAA;;wBAAhC,SAAS,GAAG,SAAoB;wBACtC,sBAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,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AAI,CAAC,aAAa,CAAA,CAAC,QAAQ,WAAI,CAAC,IAAI,KAAK,CAAS,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,GAAC;;wBAD5G,6FAA6F;wBAC7F,SAA4G,CAAC;;;;;;KAEhH;IAED,kBAAkB;IACL,0BAAK,GAAlB;;;;4BACE,qBAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,EAAA;;wBAAhC,SAAgC,CAAC;wBACjC,sBAAO,IAAA,+BAAkB,GAAE,EAAC;;;;KAC7B;IAED,kBAAkB;IACL,8BAAS,GAAtB;;;;4BACS,qBAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,EAAA;4BAA7C,sBAAO,SAAsC,EAAC;;;;KAC/C;IAED,kBAAkB;IACL,iCAAY,GAAzB,UAA0B,aAAqB;;;;;4BAC3B,qBAAM,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,aAAa,CAAC,EAAA;;wBAAhE,SAAS,GAAG,SAAoD;wBACtE,sBAAO,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAC;;;;KACnD;IACH,iBAAC;AAAD,CAAC,AA3ED,IA2EC;AA3EY,gCAAU","sourcesContent":["import {\n browser,\n ElementFinder,\n} from 'protractor';\nimport {\n protractor as ptor,\n} from 'protractor/built/ptor';\nimport {\n waitForOtterStable,\n} from '../../tools/protractor';\nimport {\n ElementProfile,\n} from '../element';\nimport {\n convertPromise,\n} from './utils';\n\nexport { ElementProfile } from '../element';\n\n/**\n * Implementation dedicated to protractor.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rElement implements ElementProfile {\n /** Protractor ElementProfile */\n public sourceElement: ElementFinder;\n\n constructor(sourceElement: ElementFinder | O3rElement) {\n this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;\n }\n\n /** @inheritdoc */\n public getText() {\n return convertPromise(this.sourceElement.getText());\n }\n\n /** @inheritdoc */\n public async getPlainText() {\n const innerText = await this.getText();\n return Promise.resolve(innerText ? innerText.replace(/\\r\\n|\\r|\\n/g, ' ').replace(/\\s\\s+/g, ' ').trim() : undefined);\n }\n\n /** @inheritdoc */\n public getInnerHTML(): Promise<string | undefined> {\n return convertPromise(this.sourceElement.getInnerHtml());\n }\n\n /** @inheritdoc */\n public mouseOver() {\n return convertPromise(\n browser\n .actions()\n .mouseMove(this.sourceElement)\n .perform()\n );\n }\n\n /** @inheritdoc */\n public async getValue() {\n const value = await this.sourceElement.getAttribute('value');\n return value === null ? undefined : value;\n }\n\n /** @inheritdoc */\n public async setValue(input: string) {\n // Clears the value in the field\n await this.clearValue();\n await this.sourceElement.sendKeys(input);\n await this.sourceElement.sendKeys(ptor.Key.TAB);\n return waitForOtterStable();\n }\n\n /** @inheritdoc */\n public async clearValue() {\n const currentValue = await this.getValue();\n\n if (currentValue !== undefined) {\n // eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose\n await this.sourceElement.sendKeys(...(new Array<string>(currentValue.length + 1).fill(ptor.Key.BACK_SPACE)));\n }\n }\n\n /** @inheritdoc */\n public async click() {\n await this.sourceElement.click();\n return waitForOtterStable();\n }\n\n /** @inheritdoc */\n public async isVisible() {\n return await this.sourceElement.isDisplayed();\n }\n\n /** @inheritdoc */\n public async getAttribute(attributeName: string) {\n const attribute = await this.sourceElement.getAttribute(attributeName);\n return attribute === null ? undefined : attribute;\n }\n}\n\n/**\n * Constructor of a O3rElement\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: ElementFinder | O3rElement) => T;\n"]}
@@ -1,17 +0,0 @@
1
- import { ElementFinder } from 'protractor';
2
- import { CheckboxElementProfile } from '../../elements';
3
- import { O3rElement } from '../element';
4
- /**
5
- * Implementation dedicated to karma / TestBed.
6
- * @deprecated Will be removed in v13, please use Playwright instead
7
- */
8
- export declare class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {
9
- constructor(sourceElement: ElementFinder);
10
- /** @inheritDoc */
11
- check(value?: boolean, associatedLabel?: O3rElement): Promise<void>;
12
- /** @inheritDoc */
13
- uncheck(): Promise<void>;
14
- /** @inheritDoc */
15
- isChecked(): Promise<boolean>;
16
- }
17
- //# sourceMappingURL=checkbox-element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox-element.d.ts","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAW,YAAW,sBAAsB;gBACtE,aAAa,EAAE,aAAa;IAIxC,kBAAkB;IACL,KAAK,CAAC,KAAK,UAAO,EAAE,eAAe,CAAC,EAAE,UAAU;IAS7D,kBAAkB;IACX,OAAO;IAId,kBAAkB;IACL,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CAI3C"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.O3rCheckboxElement = void 0;
4
- var tslib_1 = require("tslib");
5
- var element_1 = require("../element");
6
- /**
7
- * Implementation dedicated to karma / TestBed.
8
- * @deprecated Will be removed in v13, please use Playwright instead
9
- */
10
- var O3rCheckboxElement = /** @class */ (function (_super) {
11
- tslib_1.__extends(O3rCheckboxElement, _super);
12
- function O3rCheckboxElement(sourceElement) {
13
- return _super.call(this, sourceElement) || this;
14
- }
15
- /** @inheritDoc */
16
- O3rCheckboxElement.prototype.check = function () {
17
- return tslib_1.__awaiter(this, arguments, void 0, function (value, associatedLabel) {
18
- var currentValue;
19
- if (value === void 0) { value = true; }
20
- return tslib_1.__generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4 /*yield*/, this.isChecked()];
23
- case 1:
24
- currentValue = _a.sent();
25
- if (currentValue === value) {
26
- return [2 /*return*/, Promise.resolve()];
27
- }
28
- return [2 /*return*/, associatedLabel ? associatedLabel.click() : this.click()];
29
- }
30
- });
31
- });
32
- };
33
- /** @inheritDoc */
34
- O3rCheckboxElement.prototype.uncheck = function () {
35
- return this.check(false);
36
- };
37
- /** @inheritDoc */
38
- O3rCheckboxElement.prototype.isChecked = function () {
39
- return tslib_1.__awaiter(this, void 0, void 0, function () {
40
- var value;
41
- return tslib_1.__generator(this, function (_a) {
42
- switch (_a.label) {
43
- case 0: return [4 /*yield*/, this.sourceElement.isSelected()];
44
- case 1:
45
- value = _a.sent();
46
- return [2 /*return*/, value];
47
- }
48
- });
49
- });
50
- };
51
- return O3rCheckboxElement;
52
- }(element_1.O3rElement));
53
- exports.O3rCheckboxElement = O3rCheckboxElement;
54
- //# sourceMappingURL=checkbox-element.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAMA,sCAEoB;AAEpB;;;GAGG;AACH;IAAwC,8CAAU;IAChD,4BAAY,aAA4B;QACtC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,kCAAK,GAAlB;oEAAmB,KAAY,EAAE,eAA4B;;YAA1C,sBAAA,EAAA,YAAY;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;4BAC3B,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC3B,CAAC;wBAED,sBAAO,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACjE;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,sCAAS,GAAtB;;;;;4BACgB,qBAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,EAAA;;wBAA7C,KAAK,GAAG,SAAqC;wBACnD,sBAAO,KAAK,EAAC;;;;KACd;IACH,yBAAC;AAAD,CAAC,AAzBD,CAAwC,oBAAU,GAyBjD;AAzBY,gDAAkB","sourcesContent":["import {\n ElementFinder,\n} from 'protractor';\nimport {\n CheckboxElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true, associatedLabel?: O3rElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n return Promise.resolve();\n }\n\n return associatedLabel ? associatedLabel.click() : this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const value = await this.sourceElement.isSelected();\n return value;\n }\n}\n"]}
@@ -1,4 +0,0 @@
1
- export * from './checkbox-element';
2
- export * from './radio-element';
3
- export * from './select-element';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/protractor/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./checkbox-element"), exports);
5
- tslib_1.__exportStar(require("./radio-element"), exports);
6
- tslib_1.__exportStar(require("./select-element"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,0DAAgC;AAChC,2DAAiC","sourcesContent":["export * from './checkbox-element';\nexport * from './radio-element';\nexport * from './select-element';\n"]}
@@ -1,17 +0,0 @@
1
- import { ElementFinder } from 'protractor';
2
- import { RadioElementProfile } from '../../elements';
3
- import { O3rElement } from '../element';
4
- /**
5
- * Implementation dedicated to karma / TestBed.
6
- * @deprecated Will be removed in v13, please use Playwright instead
7
- */
8
- export declare class O3rRadioElement extends O3rElement implements RadioElementProfile {
9
- constructor(sourceElement: ElementFinder);
10
- /** @inheritDoc */
11
- check(value?: boolean): Promise<void>;
12
- /** @inheritDoc */
13
- uncheck(): Promise<void>;
14
- /** @inheritDoc */
15
- isChecked(): Promise<boolean>;
16
- }
17
- //# sourceMappingURL=radio-element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio-element.d.ts","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,UAAW,YAAW,mBAAmB;gBAChE,aAAa,EAAE,aAAa;IAIxC,kBAAkB;IACL,KAAK,CAAC,KAAK,UAAO;IAW/B,kBAAkB;IACX,OAAO;IAId,kBAAkB;IACL,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CAI3C"}