@o3r/testing 13.0.0-next.5 → 13.0.0-prerelease.1

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 (129) 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/errors/fixture-usage-error.js +5 -10
  88. package/errors/fixture-usage-error.js.map +1 -1
  89. package/errors/index.js +1 -1
  90. package/errors/transpilation-purpose-only.js +5 -10
  91. package/errors/transpilation-purpose-only.js.map +1 -1
  92. package/kassette/index.js +1 -1
  93. package/kassette/update-dates-in-mocks.js +66 -85
  94. package/kassette/update-dates-in-mocks.js.map +1 -1
  95. package/localization/index.js +1 -1
  96. package/localization/localization-mock.js +38 -60
  97. package/localization/localization-mock.js.map +1 -1
  98. package/mocks/index.js +1 -1
  99. package/mocks/mock-component-generator.js +54 -53
  100. package/mocks/mock-component-generator.js.map +1 -1
  101. package/package.json +68 -61
  102. package/public_api.js +1 -1
  103. package/schematics/add-functions-to-fixture/models.d.ts.map +1 -1
  104. package/schematics/add-functions-to-fixture/models.js.map +1 -1
  105. package/schematics/ng-add/index.d.ts.map +1 -1
  106. package/schematics/ng-add/index.js +7 -7
  107. package/schematics/ng-add/index.js.map +1 -1
  108. package/schematics/ng-add/playwright/index.d.ts.map +1 -1
  109. package/schematics/ng-add/playwright/index.js +3 -4
  110. package/schematics/ng-add/playwright/index.js.map +1 -1
  111. package/schematics/ng-add/schema.json +2 -1
  112. package/schematics/playwright/sanity/schema.json +2 -1
  113. package/schematics/playwright/scenario/schema.json +2 -1
  114. package/store/index.js +1 -1
  115. package/store/testable-select.js +13 -13
  116. package/store/testable-select.js.map +1 -1
  117. package/tools/index.js +1 -1
  118. package/tools/path-replacement/index.js +1 -1
  119. package/tools/path-replacement/path-replacement.js +24 -20
  120. package/tools/path-replacement/path-replacement.js.map +1 -1
  121. package/visual-test/index.js +1 -1
  122. package/visual-test/utils.js +18 -7
  123. package/visual-test/utils.js.map +1 -1
  124. package/visual-test/visual-test.d.ts.map +1 -1
  125. package/visual-test/visual-test.js +30 -35
  126. package/visual-test/visual-test.js.map +1 -1
  127. package/visual-testing-reporter/index.d.ts.map +1 -1
  128. package/visual-testing-reporter/index.js +37 -40
  129. package/visual-testing-reporter/index.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/core/element.ts"],"names":[],"mappings":";;;AAAA,yCAEyB;AAiEzB;;;GAGG;AACH;IACE,oBAAY,cAAmB;IAAG,CAAC;IAE5B,iCAAY,GAAnB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,4BAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,iCAAY,GAAnB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,0BAAK,GAAZ;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,iCAAY,GAAnB,UAAoB,cAAsB;QACxC,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,8BAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,6BAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,6BAAQ,GAAf,UAAgB,MAAc;QAC5B,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,+BAAU,GAAjB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,8BAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,iBAAC;AAAD,CAAC,AAnDD,IAmDC;AAnDY,gCAAU","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\n\n/**\n * Interface to describe the ElementProfile that are queried inside a fixture.\n * As for ComponentFixture, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface ElementProfile {\n /**\n * Click on the element. Simple click with left button.\n */\n click(): Promise<void>;\n\n /**\n * Returns a promise that resolves with the value of the attribute given in parameter.\n */\n getAttribute(attributeName: string): Promise<string | undefined>;\n\n /**\n * Returns a promise that resolves with the text of the element or undefined.\n */\n getText(): Promise<string | undefined>;\n\n /**\n * Get the text of an element, remove the multiple whitespaces and linebreaks\n * Returns a promise that resolves with the formatted text or undefined.\n */\n getPlainText(): Promise<string | undefined>;\n\n /**\n * Returns a promise that resolves with the inner html of the element or undefined.\n */\n getInnerHTML(): Promise<string | undefined>;\n\n /**\n * Put the cusrsor on the element.\n */\n mouseOver(): Promise<void>;\n\n /**\n * Returns a promise that resolves with the current value of an input or undefined.\n */\n getValue(): Promise<string | undefined>;\n\n /**\n * Set the value in an input.\n */\n setValue(input: string): Promise<void>;\n\n /**\n * Clears the value in the input\n */\n clearValue(): Promise<void>;\n\n /**\n * Check if an element is visible ( display !none and visibility !hidden)\n */\n isVisible(): Promise<boolean>;\n}\n\n/**\n * Constructor of a O3rElement\n */\nexport type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: any) => T;\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rElement implements ElementProfile {\n constructor(_sourceElement: any) {}\n\n public getInnerHTML(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getText(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getPlainText(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public click(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getAttribute(_attributeName: string): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public mouseOver(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getValue(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public setValue(_input: string): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public clearValue(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public isVisible(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/core/element.ts"],"names":[],"mappings":";;;AAAA,2CAEyB;AAiEzB;;;GAGG;AACH,MAAa,UAAU;IACrB,YAAY,cAAmB,IAAG,CAAC;IAE5B,YAAY;QACjB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,YAAY;QACjB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,KAAK;QACV,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,YAAY,CAAC,cAAsB;QACxC,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,SAAS;QACd,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,QAAQ;QACb,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,QAAQ,CAAC,MAAc;QAC5B,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,UAAU;QACf,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,SAAS;QACd,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AAnDD,gCAmDC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\n\n/**\n * Interface to describe the ElementProfile that are queried inside a fixture.\n * As for ComponentFixture, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface ElementProfile {\n /**\n * Click on the element. Simple click with left button.\n */\n click(): Promise<void>;\n\n /**\n * Returns a promise that resolves with the value of the attribute given in parameter.\n */\n getAttribute(attributeName: string): Promise<string | undefined>;\n\n /**\n * Returns a promise that resolves with the text of the element or undefined.\n */\n getText(): Promise<string | undefined>;\n\n /**\n * Get the text of an element, remove the multiple whitespaces and linebreaks\n * Returns a promise that resolves with the formatted text or undefined.\n */\n getPlainText(): Promise<string | undefined>;\n\n /**\n * Returns a promise that resolves with the inner html of the element or undefined.\n */\n getInnerHTML(): Promise<string | undefined>;\n\n /**\n * Put the cusrsor on the element.\n */\n mouseOver(): Promise<void>;\n\n /**\n * Returns a promise that resolves with the current value of an input or undefined.\n */\n getValue(): Promise<string | undefined>;\n\n /**\n * Set the value in an input.\n */\n setValue(input: string): Promise<void>;\n\n /**\n * Clears the value in the input\n */\n clearValue(): Promise<void>;\n\n /**\n * Check if an element is visible ( display !none and visibility !hidden)\n */\n isVisible(): Promise<boolean>;\n}\n\n/**\n * Constructor of a O3rElement\n */\nexport type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: any) => T;\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rElement implements ElementProfile {\n constructor(_sourceElement: any) {}\n\n public getInnerHTML(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getText(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getPlainText(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public click(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getAttribute(_attributeName: string): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public mouseOver(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public getValue(): Promise<string | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public setValue(_input: string): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public clearValue(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritdoc */\n public isVisible(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1,32 +1,28 @@
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 index_1 = require("../../errors/index");
6
- var element_1 = require("../element");
4
+ const index_1 = require("../../errors/index");
5
+ const element_1 = require("../element");
7
6
  /**
8
7
  * Mock for ElementProfile class.
9
8
  * This class is used for fixture compilation purpose.
10
9
  */
11
- var O3rCheckboxElement = /** @class */ (function (_super) {
12
- tslib_1.__extends(O3rCheckboxElement, _super);
13
- function O3rCheckboxElement(_sourceElement) {
14
- return _super.call(this, _sourceElement) || this;
10
+ class O3rCheckboxElement extends element_1.O3rElement {
11
+ constructor(_sourceElement) {
12
+ super(_sourceElement);
15
13
  }
16
14
  /** @inheritDoc */
17
- O3rCheckboxElement.prototype.check = function (_value, _associatedLabel) {
18
- if (_value === void 0) { _value = true; }
15
+ check(_value = true, _associatedLabel) {
19
16
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
20
- };
17
+ }
21
18
  /** @inheritDoc */
22
- O3rCheckboxElement.prototype.uncheck = function () {
19
+ uncheck() {
23
20
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
24
- };
21
+ }
25
22
  /** @inheritDoc */
26
- O3rCheckboxElement.prototype.isChecked = function () {
23
+ isChecked() {
27
24
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
28
- };
29
- return O3rCheckboxElement;
30
- }(element_1.O3rElement));
25
+ }
26
+ }
31
27
  exports.O3rCheckboxElement = O3rCheckboxElement;
32
28
  //# sourceMappingURL=checkbox-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../src/core/elements/checkbox-element.ts"],"names":[],"mappings":";;;;AAAA,4CAE4B;AAC5B,sCAGoB;AA0BpB;;;GAGG;AACH;IAAwC,8CAAU;IAChD,4BAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED,kBAAkB;IACX,kCAAK,GAAZ,UAAa,MAAa,EAAE,gBAA6B;QAA5C,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,oCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,sCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,yBAAC;AAAD,CAAC,AAnBD,CAAwC,oBAAU,GAmBjD;AAnBY,gDAAkB","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Checkbox elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface CheckboxElementProfile extends ElementProfile {\n /**\n * Check the checkbox element\n * @param value If specified, determine the value of the checkbox button\n * @param associatedLabel If specified, specify the label associated to the checkbox\n */\n check(value?: boolean, associatedLabel?: O3rElement): Promise<void>;\n\n /**\n * Uncheck the checkbox element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the checkbox button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true, _associatedLabel?: O3rElement): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../src/core/elements/checkbox-element.ts"],"names":[],"mappings":";;;AAAA,8CAE4B;AAC5B,wCAGoB;AA0BpB;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,oBAAU;IAChD,YAAY,cAAmB;QAC7B,KAAK,CAAC,cAAc,CAAC,CAAC;IACxB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,gBAA6B;QACvD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,SAAS;QACd,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AAnBD,gDAmBC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Checkbox elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface CheckboxElementProfile extends ElementProfile {\n /**\n * Check the checkbox element\n * @param value If specified, determine the value of the checkbox button\n * @param associatedLabel If specified, specify the label associated to the checkbox\n */\n check(value?: boolean, associatedLabel?: O3rElement): Promise<void>;\n\n /**\n * Uncheck the checkbox element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the checkbox button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true, _associatedLabel?: O3rElement): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\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,32 +1,28 @@
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 index_1 = require("../../errors/index");
6
- var element_1 = require("../element");
4
+ const index_1 = require("../../errors/index");
5
+ const element_1 = require("../element");
7
6
  /**
8
7
  * Mock for ElementProfile class.
9
8
  * This class is used for fixture compilation purpose.
10
9
  */
11
- var O3rRadioElement = /** @class */ (function (_super) {
12
- tslib_1.__extends(O3rRadioElement, _super);
13
- function O3rRadioElement(_sourceElement) {
14
- return _super.call(this, _sourceElement) || this;
10
+ class O3rRadioElement extends element_1.O3rElement {
11
+ constructor(_sourceElement) {
12
+ super(_sourceElement);
15
13
  }
16
14
  /** @inheritDoc */
17
- O3rRadioElement.prototype.check = function (_value) {
18
- if (_value === void 0) { _value = true; }
15
+ check(_value = true) {
19
16
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
20
- };
17
+ }
21
18
  /** @inheritDoc */
22
- O3rRadioElement.prototype.uncheck = function () {
19
+ uncheck() {
23
20
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
24
- };
21
+ }
25
22
  /** @inheritDoc */
26
- O3rRadioElement.prototype.isChecked = function () {
23
+ isChecked() {
27
24
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
28
- };
29
- return O3rRadioElement;
30
- }(element_1.O3rElement));
25
+ }
26
+ }
31
27
  exports.O3rRadioElement = O3rRadioElement;
32
28
  //# sourceMappingURL=radio-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../src/core/elements/radio-element.ts"],"names":[],"mappings":";;;;AAAA,4CAE4B;AAC5B,sCAGoB;AAyBpB;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED,kBAAkB;IACX,+BAAK,GAAZ,UAAa,MAAa;QAAb,uBAAA,EAAA,aAAa;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,iCAAO,GAAd;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,mCAAS,GAAhB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAnBD,CAAqC,oBAAU,GAmB9C;AAnBY,0CAAe","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Radio elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioElementProfile extends ElementProfile {\n /**\n * Check the radio element\n * @param value If specified, determine the value of the radio button\n */\n check(value?: boolean): Promise<void>;\n\n /**\n * Uncheck the radio element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the radio button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../src/core/elements/radio-element.ts"],"names":[],"mappings":";;;AAAA,8CAE4B;AAC5B,wCAGoB;AAyBpB;;;GAGG;AACH,MAAa,eAAgB,SAAQ,oBAAU;IAC7C,YAAY,cAAmB;QAC7B,KAAK,CAAC,cAAc,CAAC,CAAC;IACxB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,MAAM,GAAG,IAAI;QACxB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,kBAAkB;IACX,SAAS;QACd,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AAnBD,0CAmBC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Radio elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioElementProfile extends ElementProfile {\n /**\n * Check the radio element\n * @param value If specified, determine the value of the radio button\n */\n check(value?: boolean): Promise<void>;\n\n /**\n * Uncheck the radio element\n */\n uncheck(): Promise<void>;\n\n /**\n * Return true if the radio button is checked\n */\n isChecked(): Promise<boolean>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /** @inheritDoc */\n public check(_value = true): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public uncheck(): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /** @inheritDoc */\n public isChecked(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1,35 +1,32 @@
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 index_1 = require("../../errors/index");
6
- var element_1 = require("../element");
4
+ const index_1 = require("../../errors/index");
5
+ const element_1 = require("../element");
7
6
  /**
8
7
  * Mock for ElementProfile class.
9
8
  * This class is used for fixture compilation purpose.
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
  /**
17
15
  * Select an element in a dropdown by index.
18
16
  * @param _index
19
17
  * @param _timeout
20
18
  */
21
- O3rSelectElement.prototype.selectByIndex = function (_index, _timeout) {
19
+ selectByIndex(_index, _timeout) {
22
20
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
23
- };
21
+ }
24
22
  /**
25
23
  * Select an element in a dropdown by value.
26
24
  * @param _value
27
25
  * @param _timeout
28
26
  */
29
- O3rSelectElement.prototype.selectByValue = function (_value, _timeout) {
27
+ selectByValue(_value, _timeout) {
30
28
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
31
- };
32
- return O3rSelectElement;
33
- }(element_1.O3rElement));
29
+ }
30
+ }
34
31
  exports.O3rSelectElement = O3rSelectElement;
35
32
  //# sourceMappingURL=select-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../src/core/elements/select-element.ts"],"names":[],"mappings":";;;;AAAA,4CAE4B;AAC5B,sCAGoB;AAmBpB;;;GAGG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,cAAmB;QAC7B,OAAA,MAAK,YAAC,cAAc,CAAC,SAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,wCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,uBAAC;AAAD,CAAC,AAtBD,CAAsC,oBAAU,GAsB/C;AAtBY,4CAAgB","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SelectElementProfile extends ElementProfile {\n /**\n * Select an element in a dropdown by index.\n */\n selectByIndex(index: number, _timeout?: number): Promise<void>;\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string, _timeout?: number): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../src/core/elements/select-element.ts"],"names":[],"mappings":";;;AAAA,8CAE4B;AAC5B,wCAGoB;AAmBpB;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,oBAAU;IAC9C,YAAY,cAAmB;QAC7B,KAAK,CAAC,cAAc,CAAC,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AAtBD,4CAsBC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Select elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SelectElementProfile extends ElementProfile {\n /**\n * Select an element in a dropdown by index.\n */\n selectByIndex(index: number, _timeout?: number): Promise<void>;\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string, _timeout?: number): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\n }\n\n /**\n * Select an element in a dropdown by index.\n * @param _index\n * @param _timeout\n */\n public selectByIndex(_index: number, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by value.\n * @param _value\n * @param _timeout\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
@@ -1,18 +1,15 @@
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
  * Mock for ElementProfile class.
8
7
  * This class is used for fixture compilation purpose.
9
8
  */
10
- var O3rSliderElement = /** @class */ (function (_super) {
11
- tslib_1.__extends(O3rSliderElement, _super);
12
- function O3rSliderElement(sourceElement, _trackSelector, _thumbSelector) {
13
- return _super.call(this, sourceElement) || this;
9
+ class O3rSliderElement extends element_1.O3rElement {
10
+ constructor(sourceElement, _trackSelector, _thumbSelector) {
11
+ super(sourceElement);
14
12
  }
15
- return O3rSliderElement;
16
- }(element_1.O3rElement));
13
+ }
17
14
  exports.O3rSliderElement = O3rSliderElement;
18
15
  //# sourceMappingURL=slider-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider-element.js","sourceRoot":"","sources":["../../../src/core/elements/slider-element.ts"],"names":[],"mappings":";;;;AAAA,sCAGoB;AASpB;;;GAGG;AACH;IAAsC,4CAAU;IAC9C,0BAAY,aAAkB,EAAE,cAAuB,EAAE,cAAuB;QAC9E,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IACH,uBAAC;AAAD,CAAC,AAJD,CAAsC,oBAAU,GAI/C;AAJY,4CAAgB","sourcesContent":["import {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Slider elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SliderElementProfile extends ElementProfile {}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSliderElement extends O3rElement implements SliderElementProfile {\n constructor(sourceElement: any, _trackSelector?: string, _thumbSelector?: string) {\n super(sourceElement);\n }\n}\n"]}
1
+ {"version":3,"file":"slider-element.js","sourceRoot":"","sources":["../../../src/core/elements/slider-element.ts"],"names":[],"mappings":";;;AAAA,wCAGoB;AASpB;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,oBAAU;IAC9C,YAAY,aAAkB,EAAE,cAAuB,EAAE,cAAuB;QAC9E,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;CACF;AAJD,4CAIC","sourcesContent":["import {\n ElementProfile,\n O3rElement,\n} from '../element';\n\n/**\n * Interface to describe the Slider elements that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface SliderElementProfile extends ElementProfile {}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rSliderElement extends O3rElement implements SliderElementProfile {\n constructor(sourceElement: any, _trackSelector?: string, _thumbSelector?: string) {\n super(sourceElement);\n }\n}\n"]}
package/core/group.js CHANGED
@@ -1,27 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.O3rGroup = void 0;
4
- var index_1 = require("../errors/index");
4
+ const index_1 = require("../errors/index");
5
5
  /**
6
6
  * Mock for GroupProfile class.
7
7
  * This class is used for fixture compilation purpose.
8
8
  */
9
- var O3rGroup = /** @class */ (function () {
10
- function O3rGroup(_sourceElement) {
9
+ class O3rGroup {
10
+ /** @inheritDoc */
11
+ get items() {
12
+ throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
11
13
  }
12
- Object.defineProperty(O3rGroup.prototype, "items", {
13
- /** @inheritDoc */
14
- get: function () {
15
- throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
16
- },
17
- enumerable: false,
18
- configurable: true
19
- });
14
+ constructor(_sourceElement) { }
20
15
  /** @inheritDoc */
21
- O3rGroup.prototype.isValidGroup = function () {
16
+ isValidGroup() {
22
17
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
23
- };
24
- return O3rGroup;
25
- }());
18
+ }
19
+ }
26
20
  exports.O3rGroup = O3rGroup;
27
21
  //# sourceMappingURL=group.js.map
package/core/group.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/core/group.ts"],"names":[],"mappings":";;;AAAA,yCAEyB;AAwBzB;;;GAGG;AACH;IAME,kBAAY,cAAmB;IAAG,CAAC;IAJnC,sBAAW,2BAAK;QADhB,kBAAkB;aAClB;YACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;QACnF,CAAC;;;OAAA;IAID,kBAAkB;IACX,+BAAY,GAAnB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,eAAC;AAAD,CAAC,AAZD,IAYC;AAZY,4BAAQ","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\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 * Interface to describe the GroupProfile that are queried inside a fixture.\n * As for ComponentFixture, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface GroupProfile<T extends ElementProfile> {\n /** List of items */\n items: T[];\n\n /** Check if the group is valid */\n isValidGroup(): Promise<boolean>;\n}\n\n/**\n * Mock for GroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rGroup<T extends O3rElement> implements GroupProfile<T> {\n /** @inheritDoc */\n public get items(): T[] {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n constructor(_sourceElement: T[]) {}\n\n /** @inheritDoc */\n public isValidGroup(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/core/group.ts"],"names":[],"mappings":";;;AAAA,2CAEyB;AAwBzB;;;GAGG;AACH,MAAa,QAAQ;IACnB,kBAAkB;IAClB,IAAW,KAAK;QACd,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED,YAAY,cAAmB,IAAG,CAAC;IAEnC,kBAAkB;IACX,YAAY;QACjB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AAZD,4BAYC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\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 * Interface to describe the GroupProfile that are queried inside a fixture.\n * As for ComponentFixture, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface GroupProfile<T extends ElementProfile> {\n /** List of items */\n items: T[];\n\n /** Check if the group is valid */\n isValidGroup(): Promise<boolean>;\n}\n\n/**\n * Mock for GroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rGroup<T extends O3rElement> implements GroupProfile<T> {\n /** @inheritDoc */\n public get items(): T[] {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n constructor(_sourceElement: T[]) {}\n\n /** @inheritDoc */\n public isValidGroup(): Promise<boolean> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\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,22 +1,19 @@
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 index_1 = require("../../errors/index");
6
- var group_1 = require("../group");
4
+ const index_1 = require("../../errors/index");
5
+ const group_1 = require("../group");
7
6
  /**
8
7
  * Mock for RadioGroupProfile class.
9
8
  * This class is used for fixture compilation purpose.
10
9
  */
11
- var O3rRadioGroup = /** @class */ (function (_super) {
12
- tslib_1.__extends(O3rRadioGroup, _super);
13
- function O3rRadioGroup(sourceElement) {
14
- return _super.call(this, sourceElement) || this;
10
+ class O3rRadioGroup extends group_1.O3rGroup {
11
+ constructor(sourceElement) {
12
+ super(sourceElement);
15
13
  }
16
- O3rRadioGroup.prototype.getSelectedItem = function () {
14
+ getSelectedItem() {
17
15
  throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
18
- };
19
- return O3rRadioGroup;
20
- }(group_1.O3rGroup));
16
+ }
17
+ }
21
18
  exports.O3rRadioGroup = O3rRadioGroup;
22
19
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/core/groups/radio-group.ts"],"names":[],"mappings":";;;;AAAA,4CAE4B;AAK5B,kCAGkB;AAYlB;;;GAGG;AACH;IAAmC,yCAAyB;IAC1D,uBAAY,aAAgC;QAC1C,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAEM,uCAAe,GAAtB;QACE,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,oBAAC;AAAD,CAAC,AARD,CAAmC,gBAAQ,GAQ1C;AARY,sCAAa","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n O3rRadioElement,\n RadioElementProfile,\n} from '../elements/radio-element';\nimport {\n GroupProfile,\n O3rGroup,\n} from '../group';\n\n/**\n * Interface to describe the Radio Group that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioGroupProfile extends GroupProfile<RadioElementProfile> {\n /** Get of selected items */\n getSelectedItem(): Promise<RadioElementProfile | undefined>;\n}\n\n/**\n * Mock for RadioGroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n public getSelectedItem(): Promise<O3rRadioElement | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../src/core/groups/radio-group.ts"],"names":[],"mappings":";;;AAAA,8CAE4B;AAK5B,oCAGkB;AAYlB;;;GAGG;AACH,MAAa,aAAc,SAAQ,gBAAyB;IAC1D,YAAY,aAAgC;QAC1C,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAEM,eAAe;QACpB,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;CACF;AARD,sCAQC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../../errors/index';\nimport {\n O3rRadioElement,\n RadioElementProfile,\n} from '../elements/radio-element';\nimport {\n GroupProfile,\n O3rGroup,\n} from '../group';\n\n/**\n * Interface to describe the Radio Group that are used inside a fixture.\n * As for ComponentFixtureProfile, this abstracts the testing framework that is used by choosing the right\n * implementation at runtime.\n */\nexport interface RadioGroupProfile extends GroupProfile<RadioElementProfile> {\n /** Get of selected items */\n getSelectedItem(): Promise<RadioElementProfile | undefined>;\n}\n\n/**\n * Mock for RadioGroupProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rRadioGroup extends O3rGroup<O3rRadioElement> implements RadioGroupProfile {\n constructor(sourceElement: O3rRadioElement[]) {\n super(sourceElement);\n }\n\n public getSelectedItem(): Promise<O3rRadioElement | undefined> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
package/core/helpers.js CHANGED
@@ -1,36 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withTimeout = exports.TimeoutError = exports.isPromise = void 0;
4
- var tslib_1 = require("tslib");
5
4
  /**
6
5
  * Determine if the given item is a promise
7
6
  * @param item Item to check
8
7
  */
9
- var isPromise = function (item) { return !!item && typeof item.then === 'function'; };
8
+ const isPromise = (item) => !!item && typeof item.then === 'function';
10
9
  exports.isPromise = isPromise;
11
10
  /**
12
11
  * Error raised when promise timeout
13
12
  */
14
- var TimeoutError = /** @class */ (function (_super) {
15
- tslib_1.__extends(TimeoutError, _super);
16
- function TimeoutError(message) {
17
- return _super.call(this, message || 'Timeout of the promise') || this;
13
+ class TimeoutError extends Error {
14
+ constructor(message) {
15
+ super(message || 'Timeout of the promise');
18
16
  }
19
- return TimeoutError;
20
- }(Error));
17
+ }
21
18
  exports.TimeoutError = TimeoutError;
22
19
  /**
23
20
  * Apply timeout to a given promise
24
21
  * @param promise Promise to timeout
25
22
  * @param timeout timeout of the given promise (in ms)
26
23
  */
27
- var withTimeout = function (promise, timeout) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
28
- return tslib_1.__generator(this, function (_a) {
29
- if (!timeout) {
30
- return [2 /*return*/, promise];
31
- }
32
- return [2 /*return*/, Promise.race([promise, new Promise(function (_, reject) { return setTimeout(function () { return reject(new TimeoutError()); }, timeout); })])];
33
- });
34
- }); };
24
+ const withTimeout = async (promise, timeout) => {
25
+ if (!timeout) {
26
+ return promise;
27
+ }
28
+ return Promise.race([promise, new Promise((_, reject) => setTimeout(() => reject(new TimeoutError()), timeout))]);
29
+ };
35
30
  exports.withTimeout = withTimeout;
36
31
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/core/helpers.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACI,IAAM,SAAS,GAAG,UAAI,IAAoB,IAAyB,OAAA,CAAC,CAAC,IAAI,IAAI,OAAQ,IAAmB,CAAC,IAAI,KAAK,UAAU,EAAzD,CAAyD,CAAC;AAAvH,QAAA,SAAS,aAA8G;AAEpI;;GAEG;AACH;IAAkC,wCAAK;IACrC,sBAAY,OAAgB;QAC1B,OAAA,MAAK,YAAC,OAAO,IAAI,wBAAwB,CAAC,SAAC;IAC7C,CAAC;IACH,mBAAC;AAAD,CAAC,AAJD,CAAkC,KAAK,GAItC;AAJY,oCAAY;AAMzB;;;;GAIG;AACI,IAAM,WAAW,GAAG,UAAU,OAAmB,EAAE,OAAgB;;QACxE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,sBAAO,OAAO,EAAC;QACjB,CAAC;QACD,sBAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,OAAO,CAAI,UAAC,CAAC,EAAE,MAAM,IAAK,OAAA,UAAU,CAAC,cAAM,OAAA,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,EAA1B,CAA0B,EAAE,OAAO,CAAC,EAArD,CAAqD,CAAC,CAAC,CAAC,EAAC;;KACtH,CAAC;AALW,QAAA,WAAW,eAKtB","sourcesContent":["/**\n * Determine if the given item is a promise\n * @param item Item to check\n */\nexport const isPromise = <T>(item: T | Promise<T>): item is Promise<T> => !!item && typeof (item as Promise<T>).then === 'function';\n\n/**\n * Error raised when promise timeout\n */\nexport class TimeoutError extends Error {\n constructor(message?: string) {\n super(message || 'Timeout of the promise');\n }\n}\n\n/**\n * Apply timeout to a given promise\n * @param promise Promise to timeout\n * @param timeout timeout of the given promise (in ms)\n */\nexport const withTimeout = async <T>(promise: Promise<T>, timeout?: number): Promise<T> => {\n if (!timeout) {\n return promise;\n }\n return Promise.race([promise, new Promise<T>((_, reject) => setTimeout(() => reject(new TimeoutError()), timeout))]);\n};\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/core/helpers.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,SAAS,GAAG,CAAI,IAAoB,EAAsB,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,OAAQ,IAAmB,CAAC,IAAI,KAAK,UAAU,CAAC;AAAvH,QAAA,SAAS,aAA8G;AAEpI;;GAEG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,wBAAwB,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,oCAIC;AAED;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAAK,OAAmB,EAAE,OAAgB,EAAc,EAAE;IACxF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,OAAO,CAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACvH,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB","sourcesContent":["/**\n * Determine if the given item is a promise\n * @param item Item to check\n */\nexport const isPromise = <T>(item: T | Promise<T>): item is Promise<T> => !!item && typeof (item as Promise<T>).then === 'function';\n\n/**\n * Error raised when promise timeout\n */\nexport class TimeoutError extends Error {\n constructor(message?: string) {\n super(message || 'Timeout of the promise');\n }\n}\n\n/**\n * Apply timeout to a given promise\n * @param promise Promise to timeout\n * @param timeout timeout of the given promise (in ms)\n */\nexport const withTimeout = async <T>(promise: Promise<T>, timeout?: number): Promise<T> => {\n if (!timeout) {\n return promise;\n }\n return Promise.race([promise, new Promise<T>((_, reject) => setTimeout(() => reject(new TimeoutError()), timeout))]);\n};\n"]}
package/core/index.js CHANGED
@@ -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,24 @@
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 index_1 = require("../errors/index");
6
- var component_fixture_1 = require("./component-fixture");
4
+ const index_1 = require("../errors/index");
5
+ const component_fixture_1 = require("./component-fixture");
7
6
  /**
8
7
  * Mock for page fixture class.
9
8
  * This class is used for fixture compilation purpose.
10
9
  */
11
- var O3rPageFixture = /** @class */ (function (_super) {
12
- tslib_1.__extends(O3rPageFixture, _super);
10
+ class O3rPageFixture extends component_fixture_1.O3rComponentFixture {
13
11
  /**
14
12
  * Root element of this fixture. Optional in a Protractor.
15
13
  * All further queries will be applied to the element tree if any, otherwise they will be applied to the whole DOM.
16
14
  * @param _rootElement
17
15
  */
18
- function O3rPageFixture(_rootElement) {
19
- return _super.call(this) || this;
16
+ constructor(_rootElement) {
17
+ super();
20
18
  }
21
- O3rPageFixture.prototype.getTitle = function () {
19
+ getTitle() {
22
20
  throw new index_1.TranspilationPurposeOnlyError('Should target Playwright implementation');
23
- };
24
- return O3rPageFixture;
25
- }(component_fixture_1.O3rComponentFixture));
21
+ }
22
+ }
26
23
  exports.O3rPageFixture = O3rPageFixture;
27
24
  //# sourceMappingURL=page-fixture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../src/core/page-fixture.ts"],"names":[],"mappings":";;;;AAAA,yCAEyB;AACzB,yDAG6B;AAgB7B;;;GAGG;AACH;IAAuE,0CAAsB;IAC3F;;;;OAIG;IACH,wBAAY,YAAgB;QAC1B,OAAA,MAAK,WAAE,SAAC;IACV,CAAC;IAEM,iCAAQ,GAAf;QACE,MAAM,IAAI,qCAA6B,CAAC,yCAAyC,CAAC,CAAC;IACrF,CAAC;IACH,qBAAC;AAAD,CAAC,AAbD,CAAuE,uCAAmB,GAazF;AAbY,wCAAc","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\nimport {\n ComponentFixtureProfile,\n O3rComponentFixture,\n} from './component-fixture';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\n\n/**\n * Interface to describe a page fixture.\n */\nexport interface PageFixtureProfile<V extends ElementProfile> extends ComponentFixtureProfile<V> {\n /**\n * Returns the title of the page\n */\n getTitle(): Promise<string>;\n}\n\n/**\n * Mock for page fixture class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\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 super();\n }\n\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('Should target Playwright implementation');\n }\n}\n"]}
1
+ {"version":3,"file":"page-fixture.js","sourceRoot":"","sources":["../../src/core/page-fixture.ts"],"names":[],"mappings":";;;AAAA,2CAEyB;AACzB,2DAG6B;AAgB7B;;;GAGG;AACH,MAAa,cAAkD,SAAQ,uCAAsB;IAC3F;;;;OAIG;IACH,YAAY,YAAgB;QAC1B,KAAK,EAAE,CAAC;IACV,CAAC;IAEM,QAAQ;QACb,MAAM,IAAI,qCAA6B,CAAC,yCAAyC,CAAC,CAAC;IACrF,CAAC;CACF;AAbD,wCAaC","sourcesContent":["import {\n TranspilationPurposeOnlyError,\n} from '../errors/index';\nimport {\n ComponentFixtureProfile,\n O3rComponentFixture,\n} from './component-fixture';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\n\n/**\n * Interface to describe a page fixture.\n */\nexport interface PageFixtureProfile<V extends ElementProfile> extends ComponentFixtureProfile<V> {\n /**\n * Returns the title of the page\n */\n getTitle(): Promise<string>;\n}\n\n/**\n * Mock for page fixture class.\n * This class is used for fixture compilation purpose.\n */\nexport class O3rPageFixture<V extends O3rElement = O3rElement> extends O3rComponentFixture<V> implements PageFixtureProfile<V> {\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 super();\n }\n\n public getTitle(): Promise<string> {\n throw new TranspilationPurposeOnlyError('Should target Playwright implementation');\n }\n}\n"]}
@@ -1,66 +1,36 @@
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 element_1 = require("../element");
4
+ const element_1 = require("../element");
6
5
  /**
7
6
  * Implementation dedicated to Playwright.
8
7
  */
9
- var MatAutocomplete = /** @class */ (function (_super) {
10
- tslib_1.__extends(MatAutocomplete, _super);
11
- function MatAutocomplete(sourceElement) {
12
- return _super.call(this, sourceElement) || this;
8
+ class MatAutocomplete extends element_1.O3rElement {
9
+ constructor(sourceElement) {
10
+ super(sourceElement);
13
11
  }
14
12
  /** @inheritdoc */
15
- MatAutocomplete.prototype.selectByValue = function (value_1) {
16
- return tslib_1.__awaiter(this, arguments, void 0, function (value, timeout) {
17
- var element, matOptions, matOptionsCount, options, i, _a, _b, _c, selectedOption;
18
- if (timeout === void 0) { timeout = 5000; }
19
- return tslib_1.__generator(this, function (_d) {
20
- switch (_d.label) {
21
- case 0: return [4 /*yield*/, this.setValue(value)];
22
- case 1:
23
- _d.sent();
24
- return [4 /*yield*/, this.click()];
25
- case 2:
26
- _d.sent();
27
- element = this.sourceElement.page;
28
- matOptions = element.locator('.mat-option, mat-option');
29
- return [4 /*yield*/, matOptions.first().waitFor({ state: 'attached', timeout: timeout })];
30
- case 3:
31
- _d.sent();
32
- return [4 /*yield*/, matOptions.count()];
33
- case 4:
34
- matOptionsCount = _d.sent();
35
- options = [];
36
- if (!(matOptionsCount > 1)) return [3 /*break*/, 9];
37
- i = 0;
38
- _d.label = 5;
39
- case 5:
40
- if (!(i < matOptionsCount)) return [3 /*break*/, 8];
41
- _b = (_a = options).push;
42
- _c = element_1.getPlainText;
43
- return [4 /*yield*/, matOptions.nth(i).innerText()];
44
- case 6:
45
- _b.apply(_a, [_c.apply(void 0, [_d.sent()])]);
46
- _d.label = 7;
47
- case 7:
48
- i++;
49
- return [3 /*break*/, 5];
50
- case 8: throw new Error("MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ".concat(options.join(', ')));
51
- case 9:
52
- if (!(matOptionsCount === 1)) return [3 /*break*/, 11];
53
- selectedOption = { element: matOptions.nth(0), page: this.sourceElement.page };
54
- return [4 /*yield*/, new element_1.O3rElement(selectedOption).click()];
55
- case 10:
56
- _d.sent();
57
- return [2 /*return*/, this.sourceElement.element.press('Tab')];
58
- case 11: return [2 /*return*/, Promise.reject(new Error('Element with selector .mat-option, mat-option not found.'))];
59
- }
60
- });
61
- });
62
- };
63
- return MatAutocomplete;
64
- }(element_1.O3rElement));
13
+ async selectByValue(value, timeout = 5000) {
14
+ await this.setValue(value);
15
+ await this.click();
16
+ const element = this.sourceElement.page;
17
+ const matOptions = element.locator('.mat-option, mat-option');
18
+ await matOptions.first().waitFor({ state: 'attached', timeout });
19
+ const matOptionsCount = await matOptions.count();
20
+ const options = [];
21
+ if (matOptionsCount > 1) {
22
+ for (let i = 0; i < matOptionsCount; i++) {
23
+ options.push((0, element_1.getPlainText)(await matOptions.nth(i).innerText()));
24
+ }
25
+ throw new Error(`MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ${options.join(', ')}`);
26
+ }
27
+ if (matOptionsCount === 1) {
28
+ const selectedOption = { element: matOptions.nth(0), page: this.sourceElement.page };
29
+ await new element_1.O3rElement(selectedOption).click();
30
+ return this.sourceElement.element.press('Tab');
31
+ }
32
+ return Promise.reject(new Error('Element with selector .mat-option, mat-option not found.'));
33
+ }
34
+ }
65
35
  exports.MatAutocomplete = MatAutocomplete;
66
36
  //# sourceMappingURL=autocomplete-material.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAGA,sCAIoB;AAEpB;;GAEG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,aAAmD;QAC7D,OAAA,MAAK,YAAC,aAAa,CAAC,SAAC;IACvB,CAAC;IAED,kBAAkB;IACL,uCAAa,GAA1B;oEAA2B,KAAa,EAAE,OAAc;;YAAd,wBAAA,EAAA,cAAc;;;4BACtD,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;wBACb,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;wBAClC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;wBAC9D,qBAAM,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;wBAAhE,SAAgE,CAAC;wBACzC,qBAAM,UAAU,CAAC,KAAK,EAAE,EAAA;;wBAA1C,eAAe,GAAG,SAAwB;wBAC1C,OAAO,GAA2B,EAAE,CAAC;6BACvC,CAAA,eAAe,GAAG,CAAC,CAAA,EAAnB,wBAAmB;wBACZ,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,eAAe,CAAA;wBACjC,KAAA,CAAA,KAAA,OAAO,CAAA,CAAC,IAAI,CAAA;wBAAC,KAAA,sBAAY,CAAA;wBAAC,qBAAM,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAA;;wBAA7D,cAAa,kBAAa,SAAmC,EAAC,EAAC,CAAC;;;wBAD7B,CAAC,EAAE,CAAA;;4BAGxC,MAAM,IAAI,KAAK,CAAC,qGAA8F,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;;6BAElI,CAAA,eAAe,KAAK,CAAC,CAAA,EAArB,yBAAqB;wBACjB,cAAc,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAA6C,CAAC;wBAChI,qBAAM,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAA;;wBAA5C,SAA4C,CAAC;wBAC7C,sBAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAC;6BAGjD,sBAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC,EAAC;;;;KAC9F;IACH,sBAAC;AAAD,CAAC,AA5BD,CAAqC,oBAAU,GA4B9C;AA5BY,0CAAe","sourcesContent":["import {\n MatAutocompleteProfile,\n} from '../../angular-materials';\nimport {\n getPlainText,\n O3rElement,\n PlaywrightSourceElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.setValue(value);\n await this.click();\n const element = this.sourceElement.page;\n const matOptions = element.locator('.mat-option, mat-option');\n await matOptions.first().waitFor({ state: 'attached', timeout });\n const matOptionsCount = await matOptions.count();\n const options: (string | undefined)[] = [];\n if (matOptionsCount > 1) {\n for (let i = 0; i < matOptionsCount; i++) {\n options.push(getPlainText(await matOptions.nth(i).innerText()));\n }\n throw new Error(`MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ${options.join(', ')}`);\n }\n if (matOptionsCount === 1) {\n const selectedOption = { element: matOptions.nth(0), page: this.sourceElement.page } as const satisfies PlaywrightSourceElement;\n await new O3rElement(selectedOption).click();\n return this.sourceElement.element.press('Tab');\n }\n\n return Promise.reject(new Error('Element with selector .mat-option, mat-option not found.'));\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../../src/core/playwright/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;AAGA,wCAIoB;AAEpB;;GAEG;AACH,MAAa,eAAgB,SAAQ,oBAAU;IAC7C,YAAY,aAAmD;QAC7D,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,OAAO,GAAG,IAAI;QACtD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAC9D,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACjE,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;QACjD,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,OAAO,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8FAA8F,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtI,CAAC;QACD,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,EAA6C,CAAC;YAChI,MAAM,IAAI,oBAAU,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF;AA5BD,0CA4BC","sourcesContent":["import {\n MatAutocompleteProfile,\n} from '../../angular-materials';\nimport {\n getPlainText,\n O3rElement,\n PlaywrightSourceElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Playwright.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(sourceElement: PlaywrightSourceElement | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, timeout = 5000) {\n await this.setValue(value);\n await this.click();\n const element = this.sourceElement.page;\n const matOptions = element.locator('.mat-option, mat-option');\n await matOptions.first().waitFor({ state: 'attached', timeout });\n const matOptionsCount = await matOptions.count();\n const options: (string | undefined)[] = [];\n if (matOptionsCount > 1) {\n for (let i = 0; i < matOptionsCount; i++) {\n options.push(getPlainText(await matOptions.nth(i).innerText()));\n }\n throw new Error(`MatAutocomplete selectByValue works only for filtered autocomplete. Found multiple values: ${options.join(', ')}`);\n }\n if (matOptionsCount === 1) {\n const selectedOption = { element: matOptions.nth(0), page: this.sourceElement.page } as const satisfies PlaywrightSourceElement;\n await new O3rElement(selectedOption).click();\n return this.sourceElement.element.press('Tab');\n }\n\n return Promise.reject(new Error('Element with selector .mat-option, mat-option not found.'));\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
  tslib_1.__exportStar(require("./slider-material"), exports);