@o3r/testing 12.5.0-prerelease.4 → 12.5.0-prerelease.40

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 (156) hide show
  1. package/core/angular/angular-materials/autocomplete-material.js +9 -20
  2. package/core/angular/angular-materials/autocomplete-material.js.map +1 -1
  3. package/core/angular/angular-materials/index.js +1 -1
  4. package/core/angular/angular-materials/select-material.js +42 -91
  5. package/core/angular/angular-materials/select-material.js.map +1 -1
  6. package/core/angular/angular-materials/slider-material.js +8 -11
  7. package/core/angular/angular-materials/slider-material.js.map +1 -1
  8. package/core/angular/component-fixture.js +68 -148
  9. package/core/angular/component-fixture.js.map +1 -1
  10. package/core/angular/element.js +44 -50
  11. package/core/angular/element.js.map +1 -1
  12. package/core/angular/elements/checkbox-element.js +12 -16
  13. package/core/angular/elements/checkbox-element.js.map +1 -1
  14. package/core/angular/elements/index.js +1 -1
  15. package/core/angular/elements/radio-element.js +12 -16
  16. package/core/angular/elements/radio-element.js.map +1 -1
  17. package/core/angular/elements/select-element.js +28 -49
  18. package/core/angular/elements/select-element.js.map +1 -1
  19. package/core/angular/elements/slider-element.js +38 -42
  20. package/core/angular/elements/slider-element.js.map +1 -1
  21. package/core/angular/group.js +9 -14
  22. package/core/angular/group.js.map +1 -1
  23. package/core/angular/groups/index.js +1 -1
  24. package/core/angular/groups/radio-group.js +25 -62
  25. package/core/angular/groups/radio-group.js.map +1 -1
  26. package/core/angular/index.js +1 -1
  27. package/core/angular/page-fixture.js +8 -11
  28. package/core/angular/page-fixture.js.map +1 -1
  29. package/core/angular-materials/autocomplete-material.js +8 -11
  30. package/core/angular-materials/autocomplete-material.js.map +1 -1
  31. package/core/angular-materials/index.js +1 -1
  32. package/core/angular-materials/select-material.js +12 -15
  33. package/core/angular-materials/select-material.js.map +1 -1
  34. package/core/angular-materials/slider-material.js +5 -8
  35. package/core/angular-materials/slider-material.js.map +1 -1
  36. package/core/component-fixture.js +28 -33
  37. package/core/component-fixture.js.map +1 -1
  38. package/core/element.js +24 -26
  39. package/core/element.js.map +1 -1
  40. package/core/elements/checkbox-element.js +12 -16
  41. package/core/elements/checkbox-element.js.map +1 -1
  42. package/core/elements/index.js +1 -1
  43. package/core/elements/radio-element.js +12 -16
  44. package/core/elements/radio-element.js.map +1 -1
  45. package/core/elements/select-element.js +10 -13
  46. package/core/elements/select-element.js.map +1 -1
  47. package/core/elements/slider-element.js +5 -8
  48. package/core/elements/slider-element.js.map +1 -1
  49. package/core/group.js +9 -15
  50. package/core/group.js.map +1 -1
  51. package/core/groups/index.js +1 -1
  52. package/core/groups/radio-group.js +8 -11
  53. package/core/groups/radio-group.js.map +1 -1
  54. package/core/helpers.js +11 -16
  55. package/core/helpers.js.map +1 -1
  56. package/core/index.js +1 -1
  57. package/core/page-fixture.js +8 -11
  58. package/core/page-fixture.js.map +1 -1
  59. package/core/playwright/angular-materials/autocomplete-material.js +26 -56
  60. package/core/playwright/angular-materials/autocomplete-material.js.map +1 -1
  61. package/core/playwright/angular-materials/index.js +1 -1
  62. package/core/playwright/angular-materials/select-material.js +48 -110
  63. package/core/playwright/angular-materials/select-material.js.map +1 -1
  64. package/core/playwright/angular-materials/slider-material.js +7 -10
  65. package/core/playwright/angular-materials/slider-material.js.map +1 -1
  66. package/core/playwright/component-fixture.js +88 -173
  67. package/core/playwright/component-fixture.js.map +1 -1
  68. package/core/playwright/element.js +38 -90
  69. package/core/playwright/element.js.map +1 -1
  70. package/core/playwright/elements/checkbox-element.js +49 -94
  71. package/core/playwright/elements/checkbox-element.js.map +1 -1
  72. package/core/playwright/elements/index.js +1 -1
  73. package/core/playwright/elements/radio-element.js +18 -34
  74. package/core/playwright/elements/radio-element.js.map +1 -1
  75. package/core/playwright/elements/select-element.js +14 -21
  76. package/core/playwright/elements/select-element.js.map +1 -1
  77. package/core/playwright/elements/slider-element.js +78 -157
  78. package/core/playwright/elements/slider-element.js.map +1 -1
  79. package/core/playwright/group.js +9 -14
  80. package/core/playwright/group.js.map +1 -1
  81. package/core/playwright/groups/index.js +1 -1
  82. package/core/playwright/groups/radio-group.js +27 -64
  83. package/core/playwright/groups/radio-group.js.map +1 -1
  84. package/core/playwright/index.js +1 -1
  85. package/core/playwright/page-fixture.js +8 -18
  86. package/core/playwright/page-fixture.js.map +1 -1
  87. package/core/protractor/angular-materials/autocomplete-material.js +12 -26
  88. package/core/protractor/angular-materials/autocomplete-material.js.map +1 -1
  89. package/core/protractor/angular-materials/index.js +1 -1
  90. package/core/protractor/angular-materials/select-material.js +45 -97
  91. package/core/protractor/angular-materials/select-material.js.map +1 -1
  92. package/core/protractor/component-fixture.js +89 -200
  93. package/core/protractor/component-fixture.js.map +1 -1
  94. package/core/protractor/element.js +46 -118
  95. package/core/protractor/element.js.map +1 -1
  96. package/core/protractor/elements/checkbox-element.js +18 -40
  97. package/core/protractor/elements/checkbox-element.js.map +1 -1
  98. package/core/protractor/elements/index.js +1 -1
  99. package/core/protractor/elements/radio-element.js +20 -42
  100. package/core/protractor/elements/radio-element.js.map +1 -1
  101. package/core/protractor/elements/select-element.js +16 -37
  102. package/core/protractor/elements/select-element.js.map +1 -1
  103. package/core/protractor/group.js +9 -14
  104. package/core/protractor/group.js.map +1 -1
  105. package/core/protractor/groups/index.js +1 -1
  106. package/core/protractor/groups/radio-group.js +29 -66
  107. package/core/protractor/groups/radio-group.js.map +1 -1
  108. package/core/protractor/index.js +1 -1
  109. package/core/protractor/page-fixture.js +9 -12
  110. package/core/protractor/page-fixture.js.map +1 -1
  111. package/core/protractor/utils.js +1 -1
  112. package/core/protractor/utils.js.map +1 -1
  113. package/errors/fixture-usage-error.js +5 -10
  114. package/errors/fixture-usage-error.js.map +1 -1
  115. package/errors/index.js +1 -1
  116. package/errors/transpilation-purpose-only.js +5 -10
  117. package/errors/transpilation-purpose-only.js.map +1 -1
  118. package/kassette/index.js +1 -1
  119. package/kassette/update-dates-in-mocks.js +66 -85
  120. package/kassette/update-dates-in-mocks.js.map +1 -1
  121. package/localization/index.js +1 -1
  122. package/localization/localization-mock.js +38 -60
  123. package/localization/localization-mock.js.map +1 -1
  124. package/mocks/index.js +1 -1
  125. package/mocks/mock-component-generator.js +54 -53
  126. package/mocks/mock-component-generator.js.map +1 -1
  127. package/package.json +25 -19
  128. package/public_api.js +1 -1
  129. package/schematics/ng-add/index.d.ts.map +1 -1
  130. package/schematics/ng-add/index.js +34 -27
  131. package/schematics/ng-add/index.js.map +1 -1
  132. package/schematics/ng-add/playwright/index.d.ts.map +1 -1
  133. package/schematics/ng-add/playwright/index.js +18 -15
  134. package/schematics/ng-add/playwright/index.js.map +1 -1
  135. package/store/index.js +1 -1
  136. package/store/testable-select.js +13 -13
  137. package/store/testable-select.js.map +1 -1
  138. package/tools/index.js +1 -1
  139. package/tools/path-replacement/index.js +1 -1
  140. package/tools/path-replacement/path-replacement.js +24 -19
  141. package/tools/path-replacement/path-replacement.js.map +1 -1
  142. package/tools/protractor/fetch-manager/index.js +1 -1
  143. package/tools/protractor/fetch-manager/utils.js +15 -51
  144. package/tools/protractor/fetch-manager/utils.js.map +1 -1
  145. package/tools/protractor/index.js +1 -1
  146. package/tools/protractor/post-message-interceptor/index.js +1 -1
  147. package/tools/protractor/post-message-interceptor/post-message-interceptor.js +30 -103
  148. package/tools/protractor/post-message-interceptor/post-message-interceptor.js.map +1 -1
  149. package/visual-test/index.js +1 -1
  150. package/visual-test/utils.js +18 -7
  151. package/visual-test/utils.js.map +1 -1
  152. package/visual-test/visual-test.js +29 -34
  153. package/visual-test/visual-test.js.map +1 -1
  154. package/visual-testing-reporter/index.d.ts.map +1 -1
  155. package/visual-testing-reporter/index.js +37 -40
  156. package/visual-testing-reporter/index.js.map +1 -1
@@ -1,168 +1,89 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rSliderElement = void 0;
4
- var tslib_1 = require("tslib");
5
- var element_1 = require("../element");
4
+ const element_1 = require("../element");
6
5
  /**
7
6
  * Implementation dedicated to Playwright.
8
7
  */
9
- var O3rSliderElement = /** @class */ (function (_super) {
10
- tslib_1.__extends(O3rSliderElement, _super);
11
- function O3rSliderElement(sourceElement, trackSelector, thumbSelector) {
12
- var _this = _super.call(this, sourceElement) || this;
13
- _this.trackSelector = trackSelector;
14
- _this.thumbSelector = thumbSelector;
15
- return _this;
8
+ class O3rSliderElement extends element_1.O3rElement {
9
+ constructor(sourceElement, trackSelector, thumbSelector) {
10
+ super(sourceElement);
11
+ this.trackSelector = trackSelector;
12
+ this.thumbSelector = thumbSelector;
13
+ }
14
+ async getInputElement() {
15
+ try {
16
+ const subElement = this.sourceElement.element.locator('input[type="range"]');
17
+ if (await subElement.count()) {
18
+ return subElement.first();
19
+ }
20
+ return this.sourceElement.element;
21
+ }
22
+ catch {
23
+ return this.sourceElement.element;
24
+ }
25
+ }
26
+ async getTrackElement() {
27
+ if (!this.trackSelector) {
28
+ return this.sourceElement.element;
29
+ }
30
+ try {
31
+ const subElement = this.sourceElement.element.locator(this.trackSelector);
32
+ if (await subElement.count()) {
33
+ return subElement.first();
34
+ }
35
+ return this.sourceElement.element;
36
+ }
37
+ catch {
38
+ return this.sourceElement.element;
39
+ }
40
+ }
41
+ async getThumbElement() {
42
+ if (!this.thumbSelector) {
43
+ return this.sourceElement.element;
44
+ }
45
+ try {
46
+ const subElement = this.sourceElement.element.locator(this.thumbSelector);
47
+ if (await subElement.count()) {
48
+ return subElement.first();
49
+ }
50
+ return this.sourceElement.element;
51
+ }
52
+ catch {
53
+ return this.sourceElement.element;
54
+ }
16
55
  }
17
- O3rSliderElement.prototype.getInputElement = function () {
18
- return tslib_1.__awaiter(this, void 0, void 0, function () {
19
- var subElement, _a;
20
- return tslib_1.__generator(this, function (_b) {
21
- switch (_b.label) {
22
- case 0:
23
- _b.trys.push([0, 2, , 3]);
24
- subElement = this.sourceElement.element.locator('input[type="range"]');
25
- return [4 /*yield*/, subElement.count()];
26
- case 1:
27
- if (_b.sent()) {
28
- return [2 /*return*/, subElement.first()];
29
- }
30
- return [2 /*return*/, this.sourceElement.element];
31
- case 2:
32
- _a = _b.sent();
33
- return [2 /*return*/, this.sourceElement.element];
34
- case 3: return [2 /*return*/];
35
- }
36
- });
37
- });
38
- };
39
- O3rSliderElement.prototype.getTrackElement = function () {
40
- return tslib_1.__awaiter(this, void 0, void 0, function () {
41
- var subElement, _a;
42
- return tslib_1.__generator(this, function (_b) {
43
- switch (_b.label) {
44
- case 0:
45
- if (!this.trackSelector) {
46
- return [2 /*return*/, this.sourceElement.element];
47
- }
48
- _b.label = 1;
49
- case 1:
50
- _b.trys.push([1, 3, , 4]);
51
- subElement = this.sourceElement.element.locator(this.trackSelector);
52
- return [4 /*yield*/, subElement.count()];
53
- case 2:
54
- if (_b.sent()) {
55
- return [2 /*return*/, subElement.first()];
56
- }
57
- return [2 /*return*/, this.sourceElement.element];
58
- case 3:
59
- _a = _b.sent();
60
- return [2 /*return*/, this.sourceElement.element];
61
- case 4: return [2 /*return*/];
62
- }
63
- });
64
- });
65
- };
66
- O3rSliderElement.prototype.getThumbElement = function () {
67
- return tslib_1.__awaiter(this, void 0, void 0, function () {
68
- var subElement, _a;
69
- return tslib_1.__generator(this, function (_b) {
70
- switch (_b.label) {
71
- case 0:
72
- if (!this.thumbSelector) {
73
- return [2 /*return*/, this.sourceElement.element];
74
- }
75
- _b.label = 1;
76
- case 1:
77
- _b.trys.push([1, 3, , 4]);
78
- subElement = this.sourceElement.element.locator(this.thumbSelector);
79
- return [4 /*yield*/, subElement.count()];
80
- case 2:
81
- if (_b.sent()) {
82
- return [2 /*return*/, subElement.first()];
83
- }
84
- return [2 /*return*/, this.sourceElement.element];
85
- case 3:
86
- _a = _b.sent();
87
- return [2 /*return*/, this.sourceElement.element];
88
- case 4: return [2 /*return*/];
89
- }
90
- });
91
- });
92
- };
93
56
  /** @inheritdoc */
94
- O3rSliderElement.prototype.setValue = function (value) {
95
- return tslib_1.__awaiter(this, void 0, void 0, function () {
96
- var trackElement, trackBoundingBox, thumbElement, inputElement, thumbBoundingBox, startPosition, maxAttribute, max, minAttribute, min, percent;
97
- return tslib_1.__generator(this, function (_a) {
98
- switch (_a.label) {
99
- case 0: return [4 /*yield*/, this.getTrackElement()];
100
- case 1:
101
- trackElement = _a.sent();
102
- return [4 /*yield*/, trackElement.boundingBox()];
103
- case 2:
104
- trackBoundingBox = _a.sent();
105
- return [4 /*yield*/, this.getThumbElement()];
106
- case 3:
107
- thumbElement = _a.sent();
108
- return [4 /*yield*/, this.getInputElement()];
109
- case 4:
110
- inputElement = _a.sent();
111
- return [4 /*yield*/, thumbElement.boundingBox()];
112
- case 5:
113
- thumbBoundingBox = _a.sent();
114
- if (!trackBoundingBox || !thumbBoundingBox) {
115
- return [2 /*return*/];
116
- }
117
- startPosition = {
118
- x: thumbBoundingBox.x + thumbBoundingBox.width / 2,
119
- y: thumbBoundingBox.y + thumbBoundingBox.height / 2
120
- };
121
- return [4 /*yield*/, this.sourceElement.page.mouse.move(startPosition.x, startPosition.y)];
122
- case 6:
123
- _a.sent();
124
- return [4 /*yield*/, this.sourceElement.page.mouse.down()];
125
- case 7:
126
- _a.sent();
127
- return [4 /*yield*/, inputElement.getAttribute('max')];
128
- case 8:
129
- maxAttribute = _a.sent();
130
- max = maxAttribute ? +maxAttribute : 100;
131
- return [4 /*yield*/, inputElement.getAttribute('min')];
132
- case 9:
133
- minAttribute = _a.sent();
134
- min = minAttribute ? +minAttribute : 0;
135
- percent = (Math.max(min, Math.min(+value, max)) - min) / (max - min);
136
- return [4 /*yield*/, this.sourceElement.page.mouse.move(trackBoundingBox.x + Math.round(trackBoundingBox.width * percent), trackBoundingBox.y + trackBoundingBox.height / 2)];
137
- case 10:
138
- _a.sent();
139
- return [4 /*yield*/, this.sourceElement.page.mouse.up()];
140
- case 11:
141
- _a.sent();
142
- return [2 /*return*/];
143
- }
144
- });
145
- });
146
- };
57
+ async setValue(value) {
58
+ const trackElement = await this.getTrackElement();
59
+ const trackBoundingBox = await trackElement.boundingBox();
60
+ const thumbElement = await this.getThumbElement();
61
+ const inputElement = await this.getInputElement();
62
+ const thumbBoundingBox = await thumbElement.boundingBox();
63
+ if (!trackBoundingBox || !thumbBoundingBox) {
64
+ return;
65
+ }
66
+ const startPosition = {
67
+ x: thumbBoundingBox.x + thumbBoundingBox.width / 2,
68
+ y: thumbBoundingBox.y + thumbBoundingBox.height / 2
69
+ };
70
+ await this.sourceElement.page.mouse.move(startPosition.x, startPosition.y);
71
+ await this.sourceElement.page.mouse.down();
72
+ const maxAttribute = await inputElement.getAttribute('max');
73
+ const max = maxAttribute ? +maxAttribute : 100;
74
+ const minAttribute = await inputElement.getAttribute('min');
75
+ const min = minAttribute ? +minAttribute : 0;
76
+ const percent = (Math.max(min, Math.min(+value, max)) - min) / (max - min);
77
+ await this.sourceElement.page.mouse.move(trackBoundingBox.x + Math.round(trackBoundingBox.width * percent), trackBoundingBox.y + trackBoundingBox.height / 2);
78
+ await this.sourceElement.page.mouse.up();
79
+ }
147
80
  /** @inheritdoc */
148
- O3rSliderElement.prototype.getValue = function () {
149
- return tslib_1.__awaiter(this, void 0, void 0, function () {
150
- var _a;
151
- var _b;
152
- return tslib_1.__generator(this, function (_c) {
153
- switch (_c.label) {
154
- case 0:
155
- _a = element_1.O3rElement.bind;
156
- _b = {};
157
- return [4 /*yield*/, this.getInputElement()];
158
- case 1: return [2 /*return*/, (new (_a.apply(element_1.O3rElement, [void 0, (_b.element = _c.sent(),
159
- _b.page = this.sourceElement.page,
160
- _b)]))()).getValue()];
161
- }
162
- });
163
- });
164
- };
165
- return O3rSliderElement;
166
- }(element_1.O3rElement));
81
+ async getValue() {
82
+ return (new element_1.O3rElement({
83
+ element: await this.getInputElement(),
84
+ page: this.sourceElement.page
85
+ })).getValue();
86
+ }
87
+ }
167
88
  exports.O3rSliderElement = O3rSliderElement;
168
89
  //# sourceMappingURL=slider-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/slider-element.ts"],"names":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uBAAC;AAAD,CAAC,AAvFD,CAAsC,oBAAU,GAuF/C;AAvFY,4CAAgB","sourcesContent":["import type {\n SliderElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n type PlaywrightSourceElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rSliderElement extends O3rElement implements SliderElementProfile {\n constructor(\n sourceElement: PlaywrightSourceElement | O3rElement,\n private readonly trackSelector?: string,\n private readonly thumbSelector?: string\n ) {\n super(sourceElement);\n }\n\n private async getInputElement() {\n try {\n const subElement = this.sourceElement.element.locator('input[type=\"range\"]');\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getTrackElement() {\n if (!this.trackSelector) {\n return this.sourceElement.element;\n }\n try {\n const subElement = this.sourceElement.element.locator(this.trackSelector);\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getThumbElement() {\n if (!this.thumbSelector) {\n return this.sourceElement.element;\n }\n try {\n const subElement = this.sourceElement.element.locator(this.thumbSelector);\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n /** @inheritdoc */\n public async setValue(value: string): Promise<void> {\n const trackElement = await this.getTrackElement();\n const trackBoundingBox = await trackElement.boundingBox();\n const thumbElement = await this.getThumbElement();\n const inputElement = await this.getInputElement();\n const thumbBoundingBox = await thumbElement.boundingBox();\n if (!trackBoundingBox || !thumbBoundingBox) {\n return;\n }\n const startPosition = {\n x: thumbBoundingBox.x + thumbBoundingBox.width / 2,\n y: thumbBoundingBox.y + thumbBoundingBox.height / 2\n };\n await this.sourceElement.page.mouse.move(startPosition.x, startPosition.y);\n await this.sourceElement.page.mouse.down();\n\n const maxAttribute = await inputElement.getAttribute('max');\n const max = maxAttribute ? +maxAttribute : 100;\n const minAttribute = await inputElement.getAttribute('min');\n const min = minAttribute ? +minAttribute : 0;\n const percent = (Math.max(min, Math.min(+value, max)) - min) / (max - min);\n await this.sourceElement.page.mouse.move(\n trackBoundingBox.x + Math.round(trackBoundingBox.width * percent),\n trackBoundingBox.y + trackBoundingBox.height / 2\n );\n await this.sourceElement.page.mouse.up();\n }\n\n /** @inheritdoc */\n public async getValue() {\n return (new O3rElement({\n element: await this.getInputElement(),\n page: this.sourceElement.page\n })).getValue();\n }\n}\n"]}
1
+ {"version":3,"file":"slider-element.js","sourceRoot":"","sources":["../../../../src/core/playwright/elements/slider-element.ts"],"names":[],"mappings":";;;AAGA,wCAGoB;AAEpB;;GAEG;AACH,MAAa,gBAAiB,SAAQ,oBAAU;IAC9C,YACE,aAAmD,EAClC,aAAsB,EACtB,aAAsB;QAEvC,KAAK,CAAC,aAAa,CAAC,CAAC;QAHJ,kBAAa,GAAb,aAAa,CAAS;QACtB,kBAAa,GAAb,aAAa,CAAS;IAGzC,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YAC7E,IAAI,MAAM,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC7B,OAAO,UAAU,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;YACD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QACpC,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,eAAe;QAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QACpC,CAAC;QACD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAA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kB;IACX,KAAK,CAAC,QAAQ;QACnB,OAAO,CAAC,IAAI,oBAAU,CAAC;YACrB,OAAO,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE;YACrC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;SAC9B,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACjB,CAAC;CACF;AAvFD,4CAuFC","sourcesContent":["import type {\n SliderElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n type PlaywrightSourceElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rSliderElement extends O3rElement implements SliderElementProfile {\n constructor(\n sourceElement: PlaywrightSourceElement | O3rElement,\n private readonly trackSelector?: string,\n private readonly thumbSelector?: string\n ) {\n super(sourceElement);\n }\n\n private async getInputElement() {\n try {\n const subElement = this.sourceElement.element.locator('input[type=\"range\"]');\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getTrackElement() {\n if (!this.trackSelector) {\n return this.sourceElement.element;\n }\n try {\n const subElement = this.sourceElement.element.locator(this.trackSelector);\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n private async getThumbElement() {\n if (!this.thumbSelector) {\n return this.sourceElement.element;\n }\n try {\n const subElement = this.sourceElement.element.locator(this.thumbSelector);\n if (await subElement.count()) {\n return subElement.first();\n }\n return this.sourceElement.element;\n } catch {\n return this.sourceElement.element;\n }\n }\n\n /** @inheritdoc */\n public async setValue(value: string): Promise<void> {\n const trackElement = await this.getTrackElement();\n const trackBoundingBox = await trackElement.boundingBox();\n const thumbElement = await this.getThumbElement();\n const inputElement = await this.getInputElement();\n const thumbBoundingBox = await thumbElement.boundingBox();\n if (!trackBoundingBox || !thumbBoundingBox) {\n return;\n }\n const startPosition = {\n x: thumbBoundingBox.x + thumbBoundingBox.width / 2,\n y: thumbBoundingBox.y + thumbBoundingBox.height / 2\n };\n await this.sourceElement.page.mouse.move(startPosition.x, startPosition.y);\n await this.sourceElement.page.mouse.down();\n\n const maxAttribute = await inputElement.getAttribute('max');\n const max = maxAttribute ? +maxAttribute : 100;\n const minAttribute = await inputElement.getAttribute('min');\n const min = minAttribute ? +minAttribute : 0;\n const percent = (Math.max(min, Math.min(+value, max)) - min) / (max - min);\n await this.sourceElement.page.mouse.move(\n trackBoundingBox.x + Math.round(trackBoundingBox.width * percent),\n trackBoundingBox.y + trackBoundingBox.height / 2\n );\n await this.sourceElement.page.mouse.up();\n }\n\n /** @inheritdoc */\n public async getValue() {\n return (new O3rElement({\n element: await this.getInputElement(),\n page: this.sourceElement.page\n })).getValue();\n }\n}\n"]}
@@ -4,23 +4,18 @@ exports.O3rGroup = void 0;
4
4
  /**
5
5
  * Implementation dedicated to Playwright.
6
6
  */
7
- var O3rGroup = /** @class */ (function () {
8
- function O3rGroup(sourceElement) {
7
+ class O3rGroup {
8
+ /** @inheritDoc */
9
+ get items() {
10
+ return this.sourceElement;
11
+ }
12
+ constructor(sourceElement) {
9
13
  this.sourceElement = sourceElement;
10
14
  }
11
- Object.defineProperty(O3rGroup.prototype, "items", {
12
- /** @inheritDoc */
13
- get: function () {
14
- return this.sourceElement;
15
- },
16
- enumerable: false,
17
- configurable: true
18
- });
19
15
  /** @inheritDoc */
20
- O3rGroup.prototype.isValidGroup = function () {
16
+ isValidGroup() {
21
17
  return Promise.resolve(true);
22
- };
23
- return O3rGroup;
24
- }());
18
+ }
19
+ }
25
20
  exports.O3rGroup = O3rGroup;
26
21
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/core/playwright/group.ts"],"names":[],"mappings":";;;AAeA;;GAEG;AACH;IAME,kBAAsB,aAAkB;QAAlB,kBAAa,GAAb,aAAa,CAAK;IAAG,CAAC;IAJ5C,sBAAW,2BAAK;QADhB,kBAAkB;aAClB;YACE,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;;;OAAA;IAID,kBAAkB;IACX,+BAAY,GAAnB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IACH,eAAC;AAAD,CAAC,AAZD,IAYC;AAZY,4BAAQ","sourcesContent":["import {\n GroupProfile,\n} from '../group';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\n\nexport { GroupProfile } from '../group';\n\n/**\n * Constructor of a O3rGroup\n */\nexport type O3rGroupConstructor<T extends GroupProfile<V>, V extends ElementProfile> = new (sourceElement: V[]) => T;\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rGroup<T extends O3rElement> implements GroupProfile<T> {\n /** @inheritDoc */\n public get items(): T[] {\n return this.sourceElement;\n }\n\n constructor(protected sourceElement: T[]) {}\n\n /** @inheritDoc */\n public isValidGroup() {\n return Promise.resolve(true);\n }\n}\n"]}
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/core/playwright/group.ts"],"names":[],"mappings":";;;AAeA;;GAEG;AACH,MAAa,QAAQ;IACnB,kBAAkB;IAClB,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,YAAsB,aAAkB;QAAlB,kBAAa,GAAb,aAAa,CAAK;IAAG,CAAC;IAE5C,kBAAkB;IACX,YAAY;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAZD,4BAYC","sourcesContent":["import {\n GroupProfile,\n} from '../group';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\n\nexport { GroupProfile } from '../group';\n\n/**\n * Constructor of a O3rGroup\n */\nexport type O3rGroupConstructor<T extends GroupProfile<V>, V extends ElementProfile> = new (sourceElement: V[]) => T;\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class O3rGroup<T extends O3rElement> implements GroupProfile<T> {\n /** @inheritDoc */\n public get items(): T[] {\n return this.sourceElement;\n }\n\n constructor(protected sourceElement: T[]) {}\n\n /** @inheritDoc */\n public isValidGroup() {\n return Promise.resolve(true);\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
3
+ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./radio-group"), exports);
5
5
  //# sourceMappingURL=index.js.map
@@ -1,77 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rRadioGroup = void 0;
4
- var tslib_1 = require("tslib");
5
- var group_1 = require("../group");
4
+ const group_1 = require("../group");
6
5
  /**
7
6
  * Group element to manage a radio group
8
7
  */
9
- var O3rRadioGroup = /** @class */ (function (_super) {
10
- tslib_1.__extends(O3rRadioGroup, _super);
11
- function O3rRadioGroup(sourceElement) {
12
- return _super.call(this, sourceElement) || this;
8
+ class O3rRadioGroup extends group_1.O3rGroup {
9
+ constructor(sourceElement) {
10
+ super(sourceElement);
13
11
  }
14
12
  /** @inheritDoc */
15
- O3rRadioGroup.prototype.isValidGroup = function () {
16
- return tslib_1.__awaiter(this, void 0, void 0, function () {
17
- var name, _i, _a, item, itemName;
18
- return tslib_1.__generator(this, function (_b) {
19
- switch (_b.label) {
20
- case 0:
21
- name = '';
22
- _i = 0, _a = this.items;
23
- _b.label = 1;
24
- case 1:
25
- if (!(_i < _a.length)) return [3 /*break*/, 4];
26
- item = _a[_i];
27
- return [4 /*yield*/, item.getAttribute('name')];
28
- case 2:
29
- itemName = _b.sent();
30
- if (name !== '' && name !== itemName) {
31
- return [2 /*return*/, false];
32
- }
33
- if (itemName !== undefined) {
34
- name = itemName;
35
- }
36
- _b.label = 3;
37
- case 3:
38
- _i++;
39
- return [3 /*break*/, 1];
40
- case 4: return [2 /*return*/, true];
41
- }
42
- });
43
- });
44
- };
13
+ async isValidGroup() {
14
+ let name = '';
15
+ for (const item of this.items) {
16
+ const itemName = await item.getAttribute('name');
17
+ if (name !== '' && name !== itemName) {
18
+ return false;
19
+ }
20
+ if (itemName !== undefined) {
21
+ name = itemName;
22
+ }
23
+ }
24
+ return true;
25
+ }
45
26
  /**
46
27
  * Get the selected radio
47
28
  */
48
- O3rRadioGroup.prototype.getSelectedItem = function () {
49
- return tslib_1.__awaiter(this, void 0, void 0, function () {
50
- var _i, _a, item, isSelected;
51
- return tslib_1.__generator(this, function (_b) {
52
- switch (_b.label) {
53
- case 0:
54
- _i = 0, _a = this.items;
55
- _b.label = 1;
56
- case 1:
57
- if (!(_i < _a.length)) return [3 /*break*/, 4];
58
- item = _a[_i];
59
- return [4 /*yield*/, item.isChecked()];
60
- case 2:
61
- isSelected = _b.sent();
62
- if (isSelected) {
63
- return [2 /*return*/, item];
64
- }
65
- _b.label = 3;
66
- case 3:
67
- _i++;
68
- return [3 /*break*/, 1];
69
- case 4: return [2 /*return*/, undefined];
70
- }
71
- });
72
- });
73
- };
74
- return O3rRadioGroup;
75
- }(group_1.O3rGroup));
29
+ async getSelectedItem() {
30
+ for (const item of this.items) {
31
+ const isSelected = await item.isChecked();
32
+ if (isSelected) {
33
+ return item;
34
+ }
35
+ }
36
+ return undefined;
37
+ }
38
+ }
76
39
  exports.O3rRadioGroup = O3rRadioGroup;
77
40
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/playwright/groups/radio-group.ts"],"names":[],"mappings":";;;;AAMA,kCAEkB;AAElB;;GAEG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;QAC1C,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,oCAAY,GAAzB;;;;;;wBACM,IAAI,GAAG,EAAE,CAAC;8BAEe,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACI,qBAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAChD,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;4BACrC,sBAAO,KAAK,EAAC;wBACf,CAAC;wBACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;4BAC3B,IAAI,GAAG,QAAQ,CAAC;wBAClB,CAAC;;;wBAPgB,IAAU,CAAA;;4BAU7B,sBAAO,IAAI,EAAC;;;;KACb;IAED;;OAEG;IACU,uCAAe,GAA5B;;;;;;8BAC+B,EAAV,KAAA,IAAI,CAAC,KAAK;;;6BAAV,CAAA,cAAU,CAAA;wBAAlB,IAAI;wBACM,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAAnC,UAAU,GAAG,SAAsB;wBACzC,IAAI,UAAU,EAAE,CAAC;4BACf,sBAAO,IAAI,EAAC;wBACd,CAAC;;;wBAJgB,IAAU,CAAA;;4BAO7B,sBAAO,SAAS,EAAC;;;;KAClB;IACH,oBAAC;AAAD,CAAC,AAnCD,CAAmC,gBAAQ,GAmC1C;AAnCY,sCAAa","sourcesContent":["import {\n RadioGroupProfile,\n} from '../../groups/radio-group';\nimport {\n O3rRadioElement,\n} from '../elements/radio-element';\nimport {\n O3rGroup,\n} from '../group';\n\n/**\n * Group element to manage a radio group\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async isValidGroup() {\n let name = '';\n\n for (const item of this.items) {\n const itemName = await item.getAttribute('name');\n if (name !== '' && name !== itemName) {\n return false;\n }\n if (itemName !== undefined) {\n name = itemName;\n }\n }\n\n return true;\n }\n\n /**\n * Get the selected radio\n */\n public async getSelectedItem() {\n for (const item of this.items) {\n const isSelected = await item.isChecked();\n if (isSelected) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/core/playwright/groups/radio-group.ts"],"names":[],"mappings":";;;AAMA,oCAEkB;AAElB;;GAEG;AACH,MAAa,aAAc,SAAQ,gBAAyB;IAC1D,YAAY,aAAgC;QAC1C,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,YAAY;QACvB,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,IAAI,GAAG,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,eAAe;QAC1B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YAC1C,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAnCD,sCAmCC","sourcesContent":["import {\n RadioGroupProfile,\n} from '../../groups/radio-group';\nimport {\n O3rRadioElement,\n} from '../elements/radio-element';\nimport {\n O3rGroup,\n} from '../group';\n\n/**\n * Group element to manage a radio group\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async isValidGroup() {\n let name = '';\n\n for (const item of this.items) {\n const itemName = await item.getAttribute('name');\n if (name !== '' && name !== itemName) {\n return false;\n }\n if (itemName !== undefined) {\n name = itemName;\n }\n }\n\n return true;\n }\n\n /**\n * Get the selected radio\n */\n public async getSelectedItem() {\n for (const item of this.items) {\n const isSelected = await item.isChecked();\n if (isSelected) {\n return item;\n }\n }\n\n return undefined;\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
3
+ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./angular-materials"), exports);
5
5
  tslib_1.__exportStar(require("./component-fixture"), exports);
6
6
  tslib_1.__exportStar(require("./element"), exports);
@@ -1,27 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rPageFixture = void 0;
4
- var tslib_1 = require("tslib");
5
- var component_fixture_1 = require("./component-fixture");
4
+ const component_fixture_1 = require("./component-fixture");
6
5
  /**
7
6
  * Implementation of the page fixture dedicated to Playwright.
8
7
  */
9
- var O3rPageFixture = /** @class */ (function (_super) {
10
- tslib_1.__extends(O3rPageFixture, _super);
11
- function O3rPageFixture(rootElement) {
12
- return _super.call(this, rootElement) || this;
8
+ class O3rPageFixture extends component_fixture_1.O3rComponentFixture {
9
+ constructor(rootElement) {
10
+ super(rootElement);
13
11
  }
14
- O3rPageFixture.prototype.getTitle = function () {
15
- return tslib_1.__awaiter(this, void 0, void 0, function () {
16
- return tslib_1.__generator(this, function (_a) {
17
- switch (_a.label) {
18
- case 0: return [4 /*yield*/, this.rootElement.sourceElement.page.title()];
19
- case 1: return [2 /*return*/, _a.sent()];
20
- }
21
- });
22
- });
23
- };
24
- return O3rPageFixture;
25
- }(component_fixture_1.O3rComponentFixture));
12
+ async getTitle() {
13
+ return await this.rootElement.sourceElement.page.title();
14
+ }
15
+ }
26
16
  exports.O3rPageFixture = O3rPageFixture;
27
17
  //# sourceMappingURL=page-fixture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/playwright/page-fixture.ts"],"names":[],"mappings":";;;;AAGA,yDAE6B;AAO7B;;GAEG;AACH;IAAuE,0CAAsB;IAC3F,wBAAY,WAAc;QACxB,OAAA,MAAK,YAAC,WAAW,CAAC,SAAC;IACrB,CAAC;IAEY,iCAAQ,GAArB;;;;4BACS,qBAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,EAAA;4BAAxD,sBAAO,SAAiD,EAAC;;;;KAC1D;IACH,qBAAC;AAAD,CAAC,AARD,CAAuE,uCAAmB,GAQzF;AARY,wCAAc","sourcesContent":["import {\n PageFixtureProfile,\n} from '../page-fixture';\nimport {\n O3rComponentFixture,\n} from './component-fixture';\nimport {\n O3rElement,\n} from './element';\n\nexport { PageFixtureProfile } from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Playwright.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(rootElement: V) {\n super(rootElement);\n }\n\n public async getTitle() {\n return await this.rootElement.sourceElement.page.title();\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../../src/core/playwright/page-fixture.ts"],"names":[],"mappings":";;;AAGA,2DAE6B;AAO7B;;GAEG;AACH,MAAa,cAAkD,SAAQ,uCAAsB;IAC3F,YAAY,WAAc;QACxB,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3D,CAAC;CACF;AARD,wCAQC","sourcesContent":["import {\n PageFixtureProfile,\n} from '../page-fixture';\nimport {\n O3rComponentFixture,\n} from './component-fixture';\nimport {\n O3rElement,\n} from './element';\n\nexport { PageFixtureProfile } from '../page-fixture';\n\n/**\n * Implementation of the page fixture dedicated to Playwright.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\n constructor(rootElement: V) {\n super(rootElement);\n }\n\n public async getTitle() {\n return await this.rootElement.sourceElement.page.title();\n }\n}\n"]}
@@ -1,37 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MatAutocomplete = void 0;
4
- var tslib_1 = require("tslib");
5
- var protractor_1 = require("protractor");
6
- var element_1 = require("../element");
4
+ const protractor_1 = require("protractor");
5
+ const element_1 = require("../element");
7
6
  /**
8
7
  * Implementation dedicated to Protractor.
9
8
  * @deprecated Will be removed in v13, please use Playwright instead
10
9
  */
11
- var MatAutocomplete = /** @class */ (function (_super) {
12
- tslib_1.__extends(MatAutocomplete, _super);
13
- function MatAutocomplete(sourceElement) {
14
- return _super.call(this, sourceElement) || this;
10
+ class MatAutocomplete extends element_1.O3rElement {
11
+ constructor(sourceElement) {
12
+ super(sourceElement);
15
13
  }
16
14
  /** @inheritdoc */
17
- MatAutocomplete.prototype.selectByValue = function (value, _timeout) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function () {
19
- var matOption;
20
- return tslib_1.__generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4 /*yield*/, this.setValue(value)];
23
- case 1:
24
- _a.sent();
25
- return [4 /*yield*/, this.click()];
26
- case 2:
27
- _a.sent();
28
- matOption = (0, protractor_1.element)(protractor_1.By.css('.mat-option, mat-option'));
29
- return [2 /*return*/, new element_1.O3rElement(matOption).click()];
30
- }
31
- });
32
- });
33
- };
34
- return MatAutocomplete;
35
- }(element_1.O3rElement));
15
+ async selectByValue(value, _timeout) {
16
+ await this.setValue(value);
17
+ await this.click();
18
+ const matOption = (0, protractor_1.element)(protractor_1.By.css('.mat-option, mat-option'));
19
+ return new element_1.O3rElement(matOption).click();
20
+ }
21
+ }
36
22
  exports.MatAutocomplete = MatAutocomplete;
37
23
  //# sourceMappingURL=autocomplete-material.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/protractor/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,yCAIoB;AAIpB,sCAEoB;AAEpB;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAyC;QACnD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,SAAS,GAAG,IAAA,oBAAO,EAAC,eAAE,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KAC1C;IACH,sBAAC;AAAD,CAAC,AAZD,CAAqC,oBAAU,GAY9C;AAZY,0CAAe","sourcesContent":["import {\n By,\n element,\n ElementFinder,\n} from 'protractor';\nimport {\n MatAutocompleteProfile,\n} from '../../angular-materials';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Protractor.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n await this.click();\n const matOption = element(By.css('.mat-option, mat-option'));\n return new O3rElement(matOption).click();\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/protractor/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;AAAA,2CAIoB;AAIpB,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,eAAgB,SAAQ,oBAAU;IAC7C,YAAY,aAAyC;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,QAAiB;QACzD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,eAAE,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAC7D,OAAO,IAAI,oBAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;CACF;AAZD,0CAYC","sourcesContent":["import {\n By,\n element,\n ElementFinder,\n} from 'protractor';\nimport {\n MatAutocompleteProfile,\n} from '../../angular-materials';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Protractor.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.setValue(value);\n await this.click();\n const matOption = element(By.css('.mat-option, mat-option'));\n return new O3rElement(matOption).click();\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
3
+ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./autocomplete-material"), exports);
5
5
  tslib_1.__exportStar(require("./select-material"), exports);
6
6
  //# sourceMappingURL=index.js.map