@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,145 +1,73 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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");
4
+ const protractor_1 = require("protractor");
5
+ const ptor_1 = require("protractor/built/ptor");
6
+ const protractor_2 = require("../../tools/protractor");
7
+ const utils_1 = require("./utils");
9
8
  /**
10
9
  * Implementation dedicated to protractor.
11
10
  * @deprecated Will be removed in v13, please use Playwright instead
12
11
  */
13
- var O3rElement = /** @class */ (function () {
14
- function O3rElement(sourceElement) {
12
+ class O3rElement {
13
+ constructor(sourceElement) {
15
14
  this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;
16
15
  }
17
16
  /** @inheritdoc */
18
- O3rElement.prototype.getText = function () {
17
+ getText() {
19
18
  return (0, utils_1.convertPromise)(this.sourceElement.getText());
20
- };
19
+ }
21
20
  /** @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
- };
21
+ async getPlainText() {
22
+ const innerText = await this.getText();
23
+ return Promise.resolve(innerText ? innerText.replace(/\r\n|\r|\n/g, ' ').replace(/\s\s+/g, ' ').trim() : undefined);
24
+ }
35
25
  /** @inheritdoc */
36
- O3rElement.prototype.getInnerHTML = function () {
26
+ getInnerHTML() {
37
27
  return (0, utils_1.convertPromise)(this.sourceElement.getInnerHtml());
38
- };
28
+ }
39
29
  /** @inheritdoc */
40
- O3rElement.prototype.mouseOver = function () {
30
+ mouseOver() {
41
31
  return (0, utils_1.convertPromise)(protractor_1.browser
42
32
  .actions()
43
33
  .mouseMove(this.sourceElement)
44
34
  .perform());
45
- };
35
+ }
46
36
  /** @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
- };
37
+ async getValue() {
38
+ const value = await this.sourceElement.getAttribute('value');
39
+ return value === null ? undefined : value;
40
+ }
60
41
  /** @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
- };
42
+ async setValue(input) {
43
+ // Clears the value in the field
44
+ await this.clearValue();
45
+ await this.sourceElement.sendKeys(input);
46
+ await this.sourceElement.sendKeys(ptor_1.protractor.Key.TAB);
47
+ return (0, protractor_2.waitForOtterStable)();
48
+ }
82
49
  /** @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
- };
50
+ async clearValue() {
51
+ const currentValue = await this.getValue();
52
+ if (currentValue !== undefined) {
53
+ // eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
54
+ await this.sourceElement.sendKeys(...(new Array(currentValue.length + 1).fill(ptor_1.protractor.Key.BACK_SPACE)));
55
+ }
56
+ }
104
57
  /** @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
- };
58
+ async click() {
59
+ await this.sourceElement.click();
60
+ return (0, protractor_2.waitForOtterStable)();
61
+ }
117
62
  /** @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
- };
63
+ async isVisible() {
64
+ return await this.sourceElement.isDisplayed();
65
+ }
128
66
  /** @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
- }());
67
+ async getAttribute(attributeName) {
68
+ const attribute = await this.sourceElement.getAttribute(attributeName);
69
+ return attribute === null ? undefined : attribute;
70
+ }
71
+ }
144
72
  exports.O3rElement = O3rElement;
145
73
  //# sourceMappingURL=element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":"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","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
+ {"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":"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","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,54 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rCheckboxElement = 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 karma / TestBed.
8
7
  * @deprecated Will be removed in v13, please use Playwright instead
9
8
  */
10
- var O3rCheckboxElement = /** @class */ (function (_super) {
11
- tslib_1.__extends(O3rCheckboxElement, _super);
12
- function O3rCheckboxElement(sourceElement) {
13
- return _super.call(this, sourceElement) || this;
9
+ class O3rCheckboxElement extends element_1.O3rElement {
10
+ constructor(sourceElement) {
11
+ super(sourceElement);
14
12
  }
15
13
  /** @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
- };
14
+ async check(value = true, associatedLabel) {
15
+ const currentValue = await this.isChecked();
16
+ if (currentValue === value) {
17
+ return Promise.resolve();
18
+ }
19
+ return associatedLabel ? associatedLabel.click() : this.click();
20
+ }
33
21
  /** @inheritDoc */
34
- O3rCheckboxElement.prototype.uncheck = function () {
22
+ uncheck() {
35
23
  return this.check(false);
36
- };
24
+ }
37
25
  /** @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));
26
+ async isChecked() {
27
+ const value = await this.sourceElement.isSelected();
28
+ return value;
29
+ }
30
+ }
53
31
  exports.O3rCheckboxElement = O3rCheckboxElement;
54
32
  //# sourceMappingURL=checkbox-element.js.map
@@ -1 +1 @@
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
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":";;;AAMA,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,oBAAU;IAChD,YAAY,aAA4B;QACtC,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,eAA4B;QAC3D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;YAC3B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,SAAS;QACpB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAzBD,gDAyBC","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,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("./checkbox-element"), exports);
5
5
  tslib_1.__exportStar(require("./radio-element"), exports);
6
6
  tslib_1.__exportStar(require("./select-element"), exports);
@@ -1,56 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rRadioElement = 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 karma / TestBed.
8
7
  * @deprecated Will be removed in v13, please use Playwright instead
9
8
  */
10
- var O3rRadioElement = /** @class */ (function (_super) {
11
- tslib_1.__extends(O3rRadioElement, _super);
12
- function O3rRadioElement(sourceElement) {
13
- return _super.call(this, sourceElement) || this;
9
+ class O3rRadioElement extends element_1.O3rElement {
10
+ constructor(sourceElement) {
11
+ super(sourceElement);
14
12
  }
15
13
  /** @inheritDoc */
16
- O3rRadioElement.prototype.check = function () {
17
- return tslib_1.__awaiter(this, arguments, void 0, function (value) {
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
- // eslint-disable-next-line no-console -- no other logger available
27
- console.warn("O3rRadioElement is already ".concat(value ? 'checked' : 'unchecked'));
28
- return [2 /*return*/, Promise.resolve()];
29
- }
30
- return [2 /*return*/, this.click()];
31
- }
32
- });
33
- });
34
- };
14
+ async check(value = true) {
15
+ const currentValue = await this.isChecked();
16
+ if (currentValue === value) {
17
+ // eslint-disable-next-line no-console -- no other logger available
18
+ console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);
19
+ return Promise.resolve();
20
+ }
21
+ return this.click();
22
+ }
35
23
  /** @inheritDoc */
36
- O3rRadioElement.prototype.uncheck = function () {
24
+ uncheck() {
37
25
  return this.check(false);
38
- };
26
+ }
39
27
  /** @inheritDoc */
40
- O3rRadioElement.prototype.isChecked = function () {
41
- return tslib_1.__awaiter(this, void 0, void 0, function () {
42
- var checked;
43
- return tslib_1.__generator(this, function (_a) {
44
- switch (_a.label) {
45
- case 0: return [4 /*yield*/, this.getAttribute('checked')];
46
- case 1:
47
- checked = _a.sent();
48
- return [2 /*return*/, checked !== undefined];
49
- }
50
- });
51
- });
52
- };
53
- return O3rRadioElement;
54
- }(element_1.O3rElement));
28
+ async isChecked() {
29
+ const checked = await this.getAttribute('checked');
30
+ return checked !== undefined;
31
+ }
32
+ }
55
33
  exports.O3rRadioElement = O3rRadioElement;
56
34
  //# sourceMappingURL=radio-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":";;;;AAMA,sCAEoB;AAEpB;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAA4B;QACtC,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,+BAAK,GAAlB;oEAAmB,KAAY;;YAAZ,sBAAA,EAAA,YAAY;;;4BACR,qBAAM,IAAI,CAAC,SAAS,EAAE,EAAA;;wBAArC,YAAY,GAAG,SAAsB;wBAC3C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;4BAC3B,mEAAmE;4BACnE,OAAO,CAAC,IAAI,CAAC,qCAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAE,CAAC,CAAC;4BAC9E,sBAAO,OAAO,CAAC,OAAO,EAAE,EAAC;wBAC3B,CAAC;wBAED,sBAAO,IAAI,CAAC,KAAK,EAAE,EAAC;;;;KACrB;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACL,mCAAS,GAAtB;;;;;4BACkB,qBAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAA;;wBAA5C,OAAO,GAAG,SAAkC;wBAClD,sBAAO,OAAO,KAAK,SAAS,EAAC;;;;KAC9B;IACH,sBAAC;AAAD,CAAC,AA3BD,CAAqC,oBAAU,GA2B9C;AA3BY,0CAAe","sourcesContent":["import {\n ElementFinder,\n} from 'protractor';\nimport {\n RadioElementProfile,\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 O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n\n return 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 checked = await this.getAttribute('checked');\n return checked !== undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":";;;AAMA,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,eAAgB,SAAQ,oBAAU;IAC7C,YAAY,aAA4B;QACtC,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI;QAC7B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;YAC3B,mEAAmE;YACnE,OAAO,CAAC,IAAI,CAAC,8BAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YAC9E,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,SAAS;QACpB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACnD,OAAO,OAAO,KAAK,SAAS,CAAC;IAC/B,CAAC;CACF;AA3BD,0CA2BC","sourcesContent":["import {\n ElementFinder,\n} from 'protractor';\nimport {\n RadioElementProfile,\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 O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n\n return 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 checked = await this.getAttribute('checked');\n return checked !== undefined;\n }\n}\n"]}
@@ -1,49 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rSelectElement = 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 O3rSelectElement = /** @class */ (function (_super) {
12
- tslib_1.__extends(O3rSelectElement, _super);
13
- function O3rSelectElement(sourceElement) {
14
- return _super.call(this, sourceElement) || this;
10
+ class O3rSelectElement extends element_1.O3rElement {
11
+ constructor(sourceElement) {
12
+ super(sourceElement);
15
13
  }
16
14
  /** @inheritdoc */
17
- O3rSelectElement.prototype.selectByIndex = function (index, _timeout) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function () {
19
- var options;
20
- return tslib_1.__generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4 /*yield*/, this.click()];
23
- case 1:
24
- _a.sent();
25
- options = this.sourceElement.all(protractor_1.By.tagName('option'));
26
- return [2 /*return*/, new element_1.O3rElement(options.get(index)).click()];
27
- }
28
- });
29
- });
30
- };
15
+ async selectByIndex(index, _timeout) {
16
+ await this.click();
17
+ const options = this.sourceElement.all(protractor_1.By.tagName('option'));
18
+ return new element_1.O3rElement(options.get(index)).click();
19
+ }
31
20
  /** @inheritdoc */
32
- O3rSelectElement.prototype.selectByValue = function (value, _timeout) {
33
- return tslib_1.__awaiter(this, void 0, void 0, function () {
34
- var option;
35
- return tslib_1.__generator(this, function (_a) {
36
- switch (_a.label) {
37
- case 0: return [4 /*yield*/, this.click()];
38
- case 1:
39
- _a.sent();
40
- option = this.sourceElement.element(protractor_1.By.css("option[value='".concat(value, "']")));
41
- return [2 /*return*/, new element_1.O3rElement(option).click()];
42
- }
43
- });
44
- });
45
- };
46
- return O3rSelectElement;
47
- }(element_1.O3rElement));
21
+ async selectByValue(value, _timeout) {
22
+ await this.click();
23
+ const option = this.sourceElement.element(protractor_1.By.css(`option[value='${value}']`));
24
+ return new element_1.O3rElement(option).click();
25
+ }
26
+ }
48
27
  exports.O3rSelectElement = O3rSelectElement;
49
28
  //# sourceMappingURL=select-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,yCAGoB;AAIpB,sCAEoB;AAEpB;;;GAGG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAyC;QACnD,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAC7D,sBAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACnD;IAED,kBAAkB;IACL,wCAAa,GAA1B,UAA2B,KAAa,EAAE,QAAiB;;;;;4BACzD,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,eAAE,CAAC,GAAG,CAAC,wBAAiB,KAAK,OAAI,CAAC,CAAC,CAAC;wBAC9E,sBAAO,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAC;;;;KACvC;IACH,uBAAC;AAAD,CAAC,AAlBD,CAAsC,oBAAU,GAkB/C;AAlBY,4CAAgB","sourcesContent":["import {\n By,\n ElementFinder,\n} from 'protractor';\nimport {\n SelectElementProfile,\n} from '../../elements';\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 O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.all(By.tagName('option'));\n return new O3rElement(options.get(index)).click();\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const option = this.sourceElement.element(By.css(`option[value='${value}']`));\n return new O3rElement(option).click();\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":";;;AAAA,2CAGoB;AAIpB,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,oBAAU;IAC9C,YAAY,aAAyC;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,QAAiB;QACzD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7D,OAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACpD,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,QAAiB;QACzD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,eAAE,CAAC,GAAG,CAAC,iBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC;QAC9E,OAAO,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;CACF;AAlBD,4CAkBC","sourcesContent":["import {\n By,\n ElementFinder,\n} from 'protractor';\nimport {\n SelectElementProfile,\n} from '../../elements';\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 O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.all(By.tagName('option'));\n return new O3rElement(options.get(index)).click();\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const option = this.sourceElement.element(By.css(`option[value='${value}']`));\n return new O3rElement(option).click();\n }\n}\n"]}
@@ -5,23 +5,18 @@ exports.O3rGroup = void 0;
5
5
  * Implementation dedicated to karma / TestBed.
6
6
  * @deprecated Will be removed in v13, please use Playwright instead
7
7
  */
8
- var O3rGroup = /** @class */ (function () {
9
- function O3rGroup(sourceElement) {
8
+ class O3rGroup {
9
+ /** @inheritDoc */
10
+ get items() {
11
+ return this.sourceElement;
12
+ }
13
+ constructor(sourceElement) {
10
14
  this.sourceElement = sourceElement;
11
15
  }
12
- Object.defineProperty(O3rGroup.prototype, "items", {
13
- /** @inheritDoc */
14
- get: function () {
15
- return this.sourceElement;
16
- },
17
- enumerable: false,
18
- configurable: true
19
- });
20
16
  /** @inheritDoc */
21
- O3rGroup.prototype.isValidGroup = function () {
17
+ isValidGroup() {
22
18
  return Promise.resolve(true);
23
- };
24
- return O3rGroup;
25
- }());
19
+ }
20
+ }
26
21
  exports.O3rGroup = O3rGroup;
27
22
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/core/protractor/group.ts"],"names":[],"mappings":";;;AAgBA;;;GAGG;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 * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type O3rGroupConstructor<T extends GroupProfile<V>, V extends ElementProfile> = new (sourceElement: V[]) => T;\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\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/protractor/group.ts"],"names":[],"mappings":";;;AAgBA;;;GAGG;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 * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type O3rGroupConstructor<T extends GroupProfile<V>, V extends ElementProfile> = new (sourceElement: V[]) => T;\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\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