@o3r/testing 10.0.0-next.8 → 11.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/core/angular/component-fixture.d.ts +0 -15
- package/core/angular/component-fixture.d.ts.map +1 -1
- package/core/angular/component-fixture.js +11 -20
- package/core/angular/component-fixture.js.map +1 -1
- package/core/angular/element.d.ts +0 -1
- package/core/angular/element.d.ts.map +1 -1
- package/core/angular/element.js +0 -1
- package/core/angular/element.js.map +1 -1
- package/core/angular-materials/autocomplete-material.d.ts +0 -1
- package/core/angular-materials/autocomplete-material.d.ts.map +1 -1
- package/core/angular-materials/autocomplete-material.js +0 -1
- package/core/angular-materials/autocomplete-material.js.map +1 -1
- package/core/angular-materials/select-material.d.ts +0 -7
- package/core/angular-materials/select-material.d.ts.map +1 -1
- package/core/angular-materials/select-material.js +0 -9
- package/core/angular-materials/select-material.js.map +1 -1
- package/core/component-fixture.d.ts +20 -12
- package/core/component-fixture.d.ts.map +1 -1
- package/core/component-fixture.js +18 -5
- package/core/component-fixture.js.map +1 -1
- package/core/elements/checkbox-element.d.ts +0 -1
- package/core/elements/checkbox-element.d.ts.map +1 -1
- package/core/elements/checkbox-element.js.map +1 -1
- package/core/elements/radio-element.d.ts +0 -1
- package/core/elements/radio-element.d.ts.map +1 -1
- package/core/elements/radio-element.js.map +1 -1
- package/core/elements/select-element.d.ts +0 -2
- package/core/elements/select-element.d.ts.map +1 -1
- package/core/elements/select-element.js +0 -2
- package/core/elements/select-element.js.map +1 -1
- package/core/helpers.d.ts +0 -2
- package/core/helpers.d.ts.map +1 -1
- package/core/helpers.js +0 -2
- package/core/helpers.js.map +1 -1
- package/core/page-fixture.d.ts +0 -1
- package/core/page-fixture.d.ts.map +1 -1
- package/core/page-fixture.js +0 -1
- package/core/page-fixture.js.map +1 -1
- package/core/playwright/component-fixture.d.ts +0 -15
- package/core/playwright/component-fixture.d.ts.map +1 -1
- package/core/playwright/component-fixture.js +14 -24
- package/core/playwright/component-fixture.js.map +1 -1
- package/core/playwright/element.d.ts +0 -2
- package/core/playwright/element.d.ts.map +1 -1
- package/core/playwright/element.js +0 -1
- package/core/playwright/element.js.map +1 -1
- package/core/protractor/component-fixture.d.ts +0 -15
- package/core/protractor/component-fixture.d.ts.map +1 -1
- package/core/protractor/component-fixture.js +11 -21
- package/core/protractor/component-fixture.js.map +1 -1
- package/core/protractor/utils.d.ts +0 -1
- package/core/protractor/utils.d.ts.map +1 -1
- package/core/protractor/utils.js +0 -1
- package/core/protractor/utils.js.map +1 -1
- package/kassette/update-dates-in-mocks.d.ts +0 -3
- package/kassette/update-dates-in-mocks.d.ts.map +1 -1
- package/kassette/update-dates-in-mocks.js +10 -6
- package/kassette/update-dates-in-mocks.js.map +1 -1
- package/localization/localization-mock.d.ts +0 -1
- package/localization/localization-mock.d.ts.map +1 -1
- package/localization/localization-mock.js +4 -3
- package/localization/localization-mock.js.map +1 -1
- package/mocks/mock-component-generator.d.ts +5 -4
- package/mocks/mock-component-generator.d.ts.map +1 -1
- package/mocks/mock-component-generator.js +5 -9
- package/mocks/mock-component-generator.js.map +1 -1
- package/package.json +65 -54
- package/schematics/add-functions-to-fixture/index.js +1 -1
- package/schematics/add-functions-to-fixture/index.js.map +1 -1
- package/schematics/add-functions-to-fixture/schema.json +1 -1
- package/schematics/fixture-to-component/index.d.ts.map +1 -1
- package/schematics/fixture-to-component/index.js +1 -1
- package/schematics/fixture-to-component/index.js.map +1 -1
- package/schematics/fixture-to-component/schema.json +1 -1
- package/schematics/ng-add/fixture/index.d.ts +2 -1
- package/schematics/ng-add/fixture/index.d.ts.map +1 -1
- package/schematics/ng-add/fixture/index.js +43 -16
- package/schematics/ng-add/fixture/index.js.map +1 -1
- package/schematics/ng-add/index.d.ts +0 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +17 -18
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/playwright/index.d.ts +0 -1
- package/schematics/ng-add/playwright/index.d.ts.map +1 -1
- package/schematics/ng-add/playwright/index.js +1 -2
- package/schematics/ng-add/playwright/index.js.map +1 -1
- package/schematics/ng-add/schema.json +2 -2
- package/schematics/ng-add/templates/project/jest.config.js.template +1 -1
- package/schematics/ng-add/templates/workspace/jest.config.js.template +1 -1
- package/schematics/ng-add/templates/workspace/jest.config.ut.js.template +53 -41
- package/schematics/playwright/sanity/index.d.ts +0 -1
- package/schematics/playwright/sanity/index.d.ts.map +1 -1
- package/schematics/playwright/sanity/index.js +2 -4
- package/schematics/playwright/sanity/index.js.map +1 -1
- package/schematics/playwright/sanity/schema.json +1 -1
- package/schematics/playwright/scenario/index.d.ts +0 -1
- package/schematics/playwright/scenario/index.d.ts.map +1 -1
- package/schematics/playwright/scenario/index.js +2 -4
- package/schematics/playwright/scenario/index.js.map +1 -1
- package/schematics/playwright/scenario/schema.json +1 -1
- package/store/testable-select.d.ts +0 -3
- package/store/testable-select.d.ts.map +1 -1
- package/store/testable-select.js +0 -6
- package/store/testable-select.js.map +1 -1
- package/store/typings.d.ts +0 -1
- package/store/typings.d.ts.map +1 -1
- package/store/typings.js +0 -1
- package/store/typings.js.map +1 -1
- package/tools/path-replacement/path-replacement.d.ts +0 -1
- package/tools/path-replacement/path-replacement.d.ts.map +1 -1
- package/tools/path-replacement/path-replacement.js +0 -1
- package/tools/path-replacement/path-replacement.js.map +1 -1
- package/tools/protractor/fetch-manager/_fetch-manager.js +0 -1
- package/tools/protractor/fetch-manager/_fetch-manager.js.map +1 -1
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js +0 -4
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js.map +1 -1
- package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts +0 -4
- package/tools/protractor/post-message-interceptor/post-message-interceptor.d.ts.map +1 -1
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js +0 -4
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js.map +1 -1
- package/visual-test/utils.d.ts +0 -2
- package/visual-test/utils.d.ts.map +1 -1
- package/visual-test/utils.js +0 -2
- package/visual-test/utils.js.map +1 -1
- package/visual-test/visual-test.d.ts +1 -5
- package/visual-test/visual-test.d.ts.map +1 -1
- package/visual-test/visual-test.js +1 -5
- package/visual-test/visual-test.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1 align="center">Otter testing</h1>
|
|
2
2
|
<p align="center">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main
|
|
3
|
+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
|
|
@@ -12,14 +12,12 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
12
12
|
protected element: V;
|
|
13
13
|
/**
|
|
14
14
|
* Root element of this fixture. It will be used as the context for further queries.
|
|
15
|
-
*
|
|
16
15
|
* @param element
|
|
17
16
|
*/
|
|
18
17
|
constructor(element: V);
|
|
19
18
|
/**
|
|
20
19
|
* Throws an exception if the element is undefined.
|
|
21
20
|
* Otherwise returns the element.
|
|
22
|
-
*
|
|
23
21
|
* @param element ElementProfile to test
|
|
24
22
|
* @param _timeout specific timeout that will throw when reach
|
|
25
23
|
*/
|
|
@@ -27,22 +25,12 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
27
25
|
/**
|
|
28
26
|
* Throws an exception if the element is undefined.
|
|
29
27
|
* Otherwise returns the element.
|
|
30
|
-
*
|
|
31
|
-
* @param element ElementProfile to test
|
|
32
|
-
* @deprecated use {@link Promise} only as {@link throwOnUndefined} parameter or use {@see throwOnUndefinedElement} instead. Will be removed in v10
|
|
33
|
-
*/
|
|
34
|
-
protected throwOnUndefined<T extends O3rElement>(element?: T): T;
|
|
35
|
-
/**
|
|
36
|
-
* Throws an exception if the element is undefined.
|
|
37
|
-
* Otherwise returns the element.
|
|
38
|
-
*
|
|
39
28
|
* @param element ElementProfile to test
|
|
40
29
|
* @param timeout specific timeout that will throw when reach
|
|
41
30
|
*/
|
|
42
31
|
protected throwOnUndefined<T extends O3rElement>(element: Promise<T | undefined>, timeout?: number): Promise<T>;
|
|
43
32
|
/**
|
|
44
33
|
* Get the element associated to the selector if present
|
|
45
|
-
*
|
|
46
34
|
* @param selector Selector to access the element
|
|
47
35
|
* @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
48
36
|
* @param options Options supported
|
|
@@ -62,7 +50,6 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
62
50
|
}): Promise<T | undefined>;
|
|
63
51
|
/**
|
|
64
52
|
* Get text from the element associated to the given selector, or undefined if the element is not found or not visible
|
|
65
|
-
*
|
|
66
53
|
* @param selector Selector to access the element
|
|
67
54
|
* @param options Options supported
|
|
68
55
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -78,7 +65,6 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
78
65
|
}): Promise<string | undefined>;
|
|
79
66
|
/**
|
|
80
67
|
* Check if the element associated to the given selector is visible
|
|
81
|
-
*
|
|
82
68
|
* @param selector Selector to access the element
|
|
83
69
|
* @param options Options supported
|
|
84
70
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -94,7 +80,6 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
94
80
|
}): Promise<boolean>;
|
|
95
81
|
/**
|
|
96
82
|
* Click on the element associated to the given selector if it exists and is visible
|
|
97
|
-
*
|
|
98
83
|
* @param selector Selector to access the element
|
|
99
84
|
* @param options Options supported
|
|
100
85
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-fixture.d.ts","sourceRoot":"","sources":["../../../src/core/angular/component-fixture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAC,uBAAuB,EAAE,aAAa,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEpG;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,YAAW,uBAAuB,CAAC,CAAC,CAAC;IACvG;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"component-fixture.d.ts","sourceRoot":"","sources":["../../../src/core/angular/component-fixture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAC,uBAAuB,EAAE,aAAa,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEpG;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,YAAW,uBAAuB,CAAC,CAAC,CAAC;IACvG;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAErB;;;OAGG;gBACS,OAAO,EAAE,CAAC;IAItB;;;;;OAKG;IACH,SAAS,CAAC,uBAAuB,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CA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AAC;IACrH,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAC9I,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAuB/L,kBAAkB;IACX,UAAU;IAIjB,kBAAkB;IACX,gBAAgB,IAAI,OAAO,CAAC;QAAE,CAAC,aAAa,EAAE,MAAM,GAAG,uBAAuB,EAAE,CAAA;KAAE,CAAC;IAI1F,kBAAkB;IACX,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG9E"}
|
|
@@ -13,7 +13,6 @@ var element_1 = require("./element");
|
|
|
13
13
|
var O3rComponentFixture = /** @class */ (function () {
|
|
14
14
|
/**
|
|
15
15
|
* Root element of this fixture. It will be used as the context for further queries.
|
|
16
|
-
*
|
|
17
16
|
* @param element
|
|
18
17
|
*/
|
|
19
18
|
function O3rComponentFixture(element) {
|
|
@@ -22,7 +21,6 @@ var O3rComponentFixture = /** @class */ (function () {
|
|
|
22
21
|
/**
|
|
23
22
|
* Throws an exception if the element is undefined.
|
|
24
23
|
* Otherwise returns the element.
|
|
25
|
-
*
|
|
26
24
|
* @param element ElementProfile to test
|
|
27
25
|
* @param _timeout specific timeout that will throw when reach
|
|
28
26
|
*/
|
|
@@ -35,26 +33,22 @@ var O3rComponentFixture = /** @class */ (function () {
|
|
|
35
33
|
/**
|
|
36
34
|
* Throws an exception if the element is undefined.
|
|
37
35
|
* Otherwise returns the element.
|
|
38
|
-
*
|
|
39
36
|
* @param element ElementProfile to test
|
|
40
37
|
* @param timeout specific timeout that will throw when reach
|
|
41
|
-
* @deprecated use {@link Promise} only as {@link throwOnUndefined} parameter or use {@link throwOnUndefinedElement} instead. Will be removed in v10
|
|
42
38
|
*/
|
|
43
39
|
O3rComponentFixture.prototype.throwOnUndefined = function (element, timeout) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return el;
|
|
40
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
41
|
+
var _this = this;
|
|
42
|
+
return tslib_1.__generator(this, function (_a) {
|
|
43
|
+
return [2 /*return*/, (0, helpers_1.withTimeout)(element, timeout)
|
|
44
|
+
.then(function (el) {
|
|
45
|
+
if (!el) {
|
|
46
|
+
throw new Error('Element not found in ' + _this.constructor.name);
|
|
47
|
+
}
|
|
48
|
+
return el;
|
|
49
|
+
})];
|
|
55
50
|
});
|
|
56
|
-
}
|
|
57
|
-
return element;
|
|
51
|
+
});
|
|
58
52
|
};
|
|
59
53
|
O3rComponentFixture.prototype.queryWithOptions = function (selector, elementConstructor, options) {
|
|
60
54
|
if (options === void 0) { options = {}; }
|
|
@@ -83,7 +77,6 @@ var O3rComponentFixture = /** @class */ (function () {
|
|
|
83
77
|
};
|
|
84
78
|
/**
|
|
85
79
|
* Get text from the element associated to the given selector, or undefined if the element is not found or not visible
|
|
86
|
-
*
|
|
87
80
|
* @param selector Selector to access the element
|
|
88
81
|
* @param options Options supported
|
|
89
82
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -118,7 +111,6 @@ var O3rComponentFixture = /** @class */ (function () {
|
|
|
118
111
|
};
|
|
119
112
|
/**
|
|
120
113
|
* Check if the element associated to the given selector is visible
|
|
121
|
-
*
|
|
122
114
|
* @param selector Selector to access the element
|
|
123
115
|
* @param options Options supported
|
|
124
116
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -148,7 +140,6 @@ var O3rComponentFixture = /** @class */ (function () {
|
|
|
148
140
|
};
|
|
149
141
|
/**
|
|
150
142
|
* Click on the element associated to the given selector if it exists and is visible
|
|
151
|
-
*
|
|
152
143
|
* @param selector Selector to access the element
|
|
153
144
|
* @param options Options supported
|
|
154
145
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/angular/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,8DAA6C;AAC7C,4CAAqD;AAErD,sCAAkD;AAClD,qCAA4D;AAK5D;;GAEG;AACH;IAME;;;;OAIG;IACH,6BAAY,OAAU;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACO,qDAAuB,GAAjC,UAAwD,OAAW,EAAE,QAAiB;QACpF,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClE;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAkBD;;;;;;;OAOG;IACO,8CAAgB,GAA1B,UAAiD,OAAoC,EAAE,OAAgB;QAAvG,iBAcC;QAbC,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClE;QACD,IAAI,IAAA,mBAAS,EAAC,OAAO,CAAC,EAAE;YACtB,OAAO,IAAA,qBAAW,EAAC,OAAO,EAAE,OAAO,CAAC;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KAClC;IAED,kBAAkB;IACX,wCAAU,GAAjB;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,8CAAgB,GAAvB;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IAC1C,CAAC;IAED,kBAAkB;IACX,6CAAe,GAAtB,UAAuB,QAAgB,EAAE,QAAiB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACH,0BAAC;AAAD,CAAC,AA/OD,IA+OC;AA/OY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport {By} from '@angular/platform-browser';\nimport {FixtureUsageError} from '../../errors/index';\nimport type {ComponentFixtureProfile} from '../component-fixture';\nimport {isPromise, withTimeout} from '../helpers';\nimport {O3rElement, O3rElementConstructor} from './element';\nimport {O3rGroup, O3rGroupConstructor} from './group';\n\nexport type {ComponentFixtureProfile, Constructable, FixtureWithCustom} from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to angular, hence using angular testing framework.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected element: V;\n\n /**\n * Root element of this fixture. It will be used as the context for further queries.\n *\n * @param element\n */\n constructor(element: V) {\n this.element = element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n *\n * @param element ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(element?: T, _timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(element);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n *\n * @param element ElementProfile to test\n * @deprecated use {@link Promise} only as {@link throwOnUndefined} parameter or use {@see throwOnUndefinedElement} instead. Will be removed in v10\n */\n protected throwOnUndefined<T extends O3rElement>(element?: T): T;\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n *\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(element: Promise<T | undefined>, timeout?: number): Promise<T>;\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n *\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n * @deprecated use {@link Promise} only as {@link throwOnUndefined} parameter or use {@link throwOnUndefinedElement} instead. Will be removed in v10\n */\n protected throwOnUndefined<T extends O3rElement>(element?: Promise<T | undefined> | T, timeout?: number): Promise<T> | T {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n if (isPromise(element)) {\n return withTimeout(element, timeout)\n .then((el) => {\n if (!el) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return el;\n });\n }\n return element;\n }\n\n /**\n * Get the element associated to the selector if present\n *\n * @param selector Selector to access the element\n * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options Options supported\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async queryWithOptions(\n selector: string,\n elementConstructor: undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<O3rElement | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<T | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T> | undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<T | O3rElement | undefined> {\n let element: T | O3rElement | undefined;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\n }\n\n /**\n * Get text from the element associated to the given selector, or undefined if the element is not found or not visible\n *\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async getText<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!element || !await element.isVisible()) {\n return;\n }\n return await element.getText();\n }\n\n /**\n * Check if the element associated to the given selector is visible\n *\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async isVisible<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<boolean> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n return !!element && await element.isVisible();\n }\n\n /**\n * Click on the element associated to the given selector if it exists and is visible\n *\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async click<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<void> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!!element && await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.query(By.css(selector));\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector))[index];\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public async queryAll(_selector: string, _returnType?: undefined, groupType?: undefined, _timeout?: number): Promise<O3rElement[]>;\n public async queryAll<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>, groupType?: undefined, _timeout?: number): Promise<T[]>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(selector: string, returnType: O3rElementConstructor<T>, groupType: O3rGroupConstructor<K, T>, _timeout?: number): Promise<K>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(\n selector: string,\n returnType: O3rElementConstructor<T> | undefined,\n groupType: O3rGroupConstructor<K, T> | undefined,\n _timeout?: number\n ): Promise<(T | O3rElement)[] | K> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector));\n\n const elements = queriedElement.map((el) => (returnType ? new returnType(el) : new O3rElement(el)));\n if (groupType) {\n const group = new groupType(elements as T[]);\n const isValid = await group.isValidGroup();\n\n if (!isValid) {\n throw new FixtureUsageError('invalid group of items');\n }\n return Promise.resolve(group);\n }\n\n return Promise.resolve(elements);\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.element;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({block: [this]});\n }\n\n /** @inheritDoc */\n public queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n return Promise.resolve(!this.element.sourceElement.query(By.css(selector)));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"component-fixture.js","sourceRoot":"","sources":["../../../src/core/angular/component-fixture.ts"],"names":[],"mappings":";;;;AAAA,4BAA4B;AAC5B,8DAA6C;AAC7C,4CAAqD;AAErD,sCAAuC;AACvC,qCAA4D;AAK5D;;GAEG;AACH;IAME;;;OAGG;IACH,6BAAY,OAAU;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACO,qDAAuB,GAAjC,UAAwD,OAAW,EAAE,QAAiB;QACpF,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClE;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACa,8CAAgB,GAAhC,UAAuD,OAA+B,EAAE,OAAgB;;;;gBACtG,sBAAO,IAAA,qBAAW,EAAC,OAAO,EAAE,OAAO,CAAC;yBACjC,IAAI,CAAC,UAAC,EAAE;wBACP,IAAI,CAAC,EAAE,EAAE;4BACP,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAI,CAAC,WAAW,CAAC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KAAK,EAAE,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IAC1C,CAAC;IAED,kBAAkB;IACX,6CAAe,GAAtB,UAAuB,QAAgB,EAAE,QAAiB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACH,0BAAC;AAAD,CAAC,AAjND,IAiNC;AAjNY,kDAAmB","sourcesContent":["/* eslint-disable new-cap */\nimport {By} from '@angular/platform-browser';\nimport {FixtureUsageError} from '../../errors/index';\nimport type {ComponentFixtureProfile} from '../component-fixture';\nimport {withTimeout} from '../helpers';\nimport {O3rElement, O3rElementConstructor} from './element';\nimport {O3rGroup, O3rGroupConstructor} from './group';\n\nexport type {ComponentFixtureProfile, Constructable, FixtureWithCustom} from '../component-fixture';\n\n/**\n * Implementation of the fixture dedicated to angular, hence using angular testing framework.\n */\nexport class O3rComponentFixture<V extends O3rElement = O3rElement> implements ComponentFixtureProfile<V> {\n /**\n * DOM element linked to the fixture.\n */\n protected element: V;\n\n /**\n * Root element of this fixture. It will be used as the context for further queries.\n * @param element\n */\n constructor(element: V) {\n this.element = element;\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param _timeout specific timeout that will throw when reach\n */\n protected throwOnUndefinedElement<T extends O3rElement>(element?: T, _timeout?: number): Promise<T> {\n if (!element) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return Promise.resolve(element);\n }\n\n /**\n * Throws an exception if the element is undefined.\n * Otherwise returns the element.\n * @param element ElementProfile to test\n * @param timeout specific timeout that will throw when reach\n */\n protected async throwOnUndefined<T extends O3rElement>(element: Promise<T | undefined>, timeout?: number): Promise<T> {\n return withTimeout(element, timeout)\n .then((el) => {\n if (!el) {\n throw new Error('Element not found in ' + this.constructor.name);\n }\n return el;\n });\n }\n\n /**\n * Get the element associated to the selector if present\n * @param selector Selector to access the element\n * @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options Options supported\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async queryWithOptions(\n selector: string,\n elementConstructor: undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<O3rElement | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T>,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n }\n ): Promise<T | undefined>;\n protected async queryWithOptions<T extends O3rElement>(\n selector: string,\n elementConstructor: O3rElementConstructor<T> | undefined,\n options: {\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}\n ): Promise<T | O3rElement | undefined> {\n let element: T | O3rElement | undefined;\n if (options.index !== undefined) {\n element = await this.queryNth(selector, options.index, elementConstructor as any);\n } else {\n element = await this.query(selector, elementConstructor as any);\n }\n if (options.shouldThrowIfNotPresent) {\n return this.throwOnUndefinedElement<O3rElement>(element, options.timeout);\n }\n return element;\n }\n\n /**\n * Get text from the element associated to the given selector, or undefined if the element is not found or not visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async getText<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<string | undefined> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!element || !await element.isVisible()) {\n return;\n }\n return await element.getText();\n }\n\n /**\n * Check if the element associated to the given selector is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async isVisible<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<boolean> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n return !!element && await element.isVisible();\n }\n\n /**\n * Click on the element associated to the given selector if it exists and is visible\n * @param selector Selector to access the element\n * @param options Options supported\n * @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement\n * @param options.index index Select the element associated to the index\n * @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present\n * @param options.timeout Duration to wait for the element to be present before it throws\n */\n protected async click<T extends O3rElement>(selector: string, options: {\n elementConstructor?: O3rElementConstructor<T> | undefined;\n index?: number;\n shouldThrowIfNotPresent?: boolean;\n timeout?: number;\n } = {}): Promise<void> {\n const element = await this.queryWithOptions(selector, options.elementConstructor as any, options);\n if (!!element && await element.isVisible()) {\n await element.click();\n }\n }\n\n /** @inheritdoc */\n public query(selector: string, returnType?: undefined): Promise<O3rElement | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public query<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.query(By.css(selector));\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public queryNth(selector: string, index: number, returnType?: undefined): Promise<O3rElement | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T>): Promise<T | undefined>;\n public queryNth<T extends O3rElement>(selector: string, index: number, returnType: O3rElementConstructor<T> | undefined): Promise<T | O3rElement | undefined> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector))[index];\n return Promise.resolve(queriedElement ? (returnType ? new returnType(queriedElement) : new O3rElement(queriedElement)) : undefined);\n }\n\n /** @inheritdoc */\n public async queryAll(_selector: string, _returnType?: undefined, groupType?: undefined, _timeout?: number): Promise<O3rElement[]>;\n public async queryAll<T extends O3rElement>(selector: string, returnType: O3rElementConstructor<T>, groupType?: undefined, _timeout?: number): Promise<T[]>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(selector: string, returnType: O3rElementConstructor<T>, groupType: O3rGroupConstructor<K, T>, _timeout?: number): Promise<K>;\n public async queryAll<T extends O3rElement, K extends O3rGroup<T>>(\n selector: string,\n returnType: O3rElementConstructor<T> | undefined,\n groupType: O3rGroupConstructor<K, T> | undefined,\n _timeout?: number\n ): Promise<(T | O3rElement)[] | K> {\n const queriedElement = this.element.sourceElement.queryAll(By.css(selector));\n\n const elements = queriedElement.map((el) => (returnType ? new returnType(el) : new O3rElement(el)));\n if (groupType) {\n const group = new groupType(elements as T[]);\n const isValid = await group.isValidGroup();\n\n if (!isValid) {\n throw new FixtureUsageError('invalid group of items');\n }\n return Promise.resolve(group);\n }\n\n return Promise.resolve(elements);\n }\n\n /** @inheritdoc */\n public getElement() {\n return this.element;\n }\n\n /** @inheritdoc */\n public getSubComponents(): Promise<{ [componentName: string]: ComponentFixtureProfile[] }> {\n return Promise.resolve({block: [this]});\n }\n\n /** @inheritDoc */\n public queryNotPresent(selector: string, _timeout?: number): Promise<boolean> {\n return Promise.resolve(!this.element.sourceElement.query(By.css(selector)));\n }\n}\n"]}
|
|
@@ -12,7 +12,6 @@ export declare class O3rElement implements ElementProfile {
|
|
|
12
12
|
* Returns the text content of the DOM node.
|
|
13
13
|
* Prioritizes .innerText, but fallbacks on .textContent in case the former is undefined in order
|
|
14
14
|
* to support JSDOM.
|
|
15
|
-
*
|
|
16
15
|
* @protected
|
|
17
16
|
*/
|
|
18
17
|
protected get text(): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/core/angular/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,qBAAa,UAAW,YAAW,cAAc;IAC/C,sBAAsB;IACf,aAAa,EAAE,YAAY,CAAC;gBAEvB,aAAa,EAAE,YAAY,GAAG,UAAU;IAIpD
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/core/angular/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,qBAAa,UAAW,YAAW,cAAc;IAC/C,sBAAsB;IACf,aAAa,EAAE,YAAY,CAAC;gBAEvB,aAAa,EAAE,YAAY,GAAG,UAAU;IAIpD;;;;;OAKG;IACH,SAAS,KAAK,IAAI,IAAI,MAAM,GAAG,SAAS,CAGvC;IAED,kBAAkB;IACX,OAAO;IAId,kBAAkB;IACX,YAAY;IAKnB,kBAAkB;IACX,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIlD,kBAAkB;IACX,KAAK;IAKZ,kBAAkB;IACX,SAAS;IAIhB,kBAAkB;IACX,YAAY,CAAC,aAAa,EAAE,MAAM;IAIzC,kBAAkB;IACX,SAAS;IAMhB,kBAAkB;IACX,QAAQ;IAIf,kBAAkB;IACX,QAAQ,CAAC,KAAK,EAAE,MAAM;IAc7B,kBAAkB;IACX,UAAU;CAOlB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,cAAc,IAAI,KAAK,aAAa,EAAE,YAAY,GAAG,UAAU,KAAK,CAAC,CAAC"}
|
package/core/angular/element.js
CHANGED
|
@@ -13,7 +13,6 @@ var O3rElement = /** @class */ (function () {
|
|
|
13
13
|
* Returns the text content of the DOM node.
|
|
14
14
|
* Prioritizes .innerText, but fallbacks on .textContent in case the former is undefined in order
|
|
15
15
|
* to support JSDOM.
|
|
16
|
-
*
|
|
17
16
|
* @protected
|
|
18
17
|
*/
|
|
19
18
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/angular/element.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH;IAIE,oBAAY,aAAwC;QAClD,IAAI,CAAC,aAAa,GAAG,aAAa,YAAY,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;IACzG,CAAC;
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/angular/element.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH;IAIE,oBAAY,aAAwC;QAClD,IAAI,CAAC,aAAa,GAAG,aAAa,YAAY,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;IACzG,CAAC;IAQD,sBAAc,4BAAI;QANlB;;;;;WAKG;aACH;YACE,IAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC;YACjD,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3G,CAAC;;;OAAA;IAED,kBAAkB;IACX,4BAAO,GAAd;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,C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Content":["import { DebugElement } from '@angular/core';\nimport { ElementProfile } from '../element';\n\nexport { ElementProfile } from '../element';\n\n/**\n * Implementation dedicated to angular / TestBed.\n */\nexport class O3rElement implements ElementProfile {\n /** Angular element */\n public sourceElement: DebugElement;\n\n constructor(sourceElement: DebugElement | O3rElement) {\n this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;\n }\n\n /**\n * Returns the text content of the DOM node.\n * Prioritizes .innerText, but fallbacks on .textContent in case the former is undefined in order\n * to support JSDOM.\n * @protected\n */\n protected get text(): string | undefined {\n const element = this.sourceElement.nativeElement;\n return element ? (element.innerText !== undefined ? element.innerText : element.textContent) : undefined;\n }\n\n /** @inheritdoc */\n public getText() {\n return Promise.resolve(this.text);\n }\n\n /** @inheritdoc */\n public getPlainText() {\n const innerText = this.text;\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 Promise.resolve(this.sourceElement.nativeElement && (this.sourceElement.nativeElement.innerHTML as string));\n }\n\n /** @inheritdoc */\n public click() {\n this.sourceElement.nativeElement.click();\n return Promise.resolve();\n }\n\n /** @inheritdoc */\n public isVisible() {\n return Promise.resolve(this.sourceElement.nativeElement.style.display !== 'none' && this.sourceElement.nativeElement.style.visibility !== 'hidden');\n }\n\n /** @inheritdoc */\n public getAttribute(attributeName: string) {\n return Promise.resolve(this.sourceElement.nativeElement && (this.sourceElement.nativeElement.getAttribute(attributeName) as string));\n }\n\n /** @inheritdoc */\n public mouseOver() {\n this.sourceElement.nativeElement.mouseOver();\n this.sourceElement.nativeElement.dispatchEvent(new Event('mouseover'));\n return Promise.resolve();\n }\n\n /** @inheritdoc */\n public getValue() {\n return Promise.resolve(this.sourceElement.nativeElement && (this.sourceElement.nativeElement.value as string));\n }\n\n /** @inheritdoc */\n public setValue(input: string) {\n this.sourceElement.triggerEventHandler('focus', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n input.split('').forEach((key) => {\n this.sourceElement.triggerEventHandler('keydown', {target: this.sourceElement.nativeElement, key, preventDefault: () => {}, stopPropagation: () => {}});\n this.sourceElement.triggerEventHandler('keypress', {target: this.sourceElement.nativeElement, key, preventDefault: () => {}, stopPropagation: () => {}});\n this.sourceElement.triggerEventHandler('keyup', {target: this.sourceElement.nativeElement, key, preventDefault: () => {}, stopPropagation: () => {}});\n });\n this.sourceElement.nativeElement.value = input;\n this.sourceElement.triggerEventHandler('input', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n this.sourceElement.triggerEventHandler('blur', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n\n return Promise.resolve();\n }\n\n /** @inheritdoc */\n public clearValue() {\n this.sourceElement.triggerEventHandler('focus', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n this.sourceElement.nativeElement.value = '';\n this.sourceElement.triggerEventHandler('input', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n this.sourceElement.triggerEventHandler('blur', {target: this.sourceElement.nativeElement, preventDefault: () => {}, stopPropagation: () => {}});\n return Promise.resolve();\n }\n}\n\n/**\n * Constructor of a O3rElement\n */\nexport type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: DebugElement | O3rElement) => T;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-material.d.ts","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAE5D;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,UAAW,YAAW,sBAAsB;gBACnE,cAAc,EAAE,GAAG;IAI/B
|
|
1
|
+
{"version":3,"file":"autocomplete-material.d.ts","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAE5D;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,UAAW,YAAW,sBAAsB;gBACnE,cAAc,EAAE,GAAG;IAI/B;;;;OAIG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAexD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"autocomplete-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/autocomplete-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AAEnE,sCAAwD;AAexD;;;GAGG;AACH;IAAqC,2CAAU;IAC7C,yBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,uCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,sBAAC;AAAD,CAAC,AAbD,CAAqC,oBAAU,GAa9C;AAbY,0CAAe","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\n\nimport { ElementProfile, O3rElement } from '../element';\n\n/**\n * Interface to describe the material autocomplete 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 MatAutocompleteProfile extends ElementProfile {\n\n /**\n * Select an element in a dropdown by value.\n */\n selectByValue(value: string): Promise<void>;\n}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatAutocomplete extends O3rElement implements MatAutocompleteProfile {\n constructor(_sourceElement: any) {\n super(_sourceElement);\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"]}
|
|
@@ -15,14 +15,12 @@ export declare class MatSelect extends O3rElement implements MatSelectProfile {
|
|
|
15
15
|
constructor(_sourceElement: any);
|
|
16
16
|
/**
|
|
17
17
|
* Select an element in a dropdown by index.
|
|
18
|
-
*
|
|
19
18
|
* @param _index
|
|
20
19
|
* @param _timeout
|
|
21
20
|
*/
|
|
22
21
|
selectByIndex(_index: number, _timeout?: number): Promise<void>;
|
|
23
22
|
/**
|
|
24
23
|
* Select an element in a dropdown by value.
|
|
25
|
-
*
|
|
26
24
|
* @param _value
|
|
27
25
|
* @param _timeout
|
|
28
26
|
* @deprecated selectByValue relies on ng-reflect-value, which doesn't work when app is in production mode
|
|
@@ -30,14 +28,9 @@ export declare class MatSelect extends O3rElement implements MatSelectProfile {
|
|
|
30
28
|
selectByValue(_value: string, _timeout?: number): Promise<void>;
|
|
31
29
|
/**
|
|
32
30
|
* Select an element in a dropdown by label.
|
|
33
|
-
*
|
|
34
31
|
* @param _label
|
|
35
32
|
* @param _timeout
|
|
36
33
|
*/
|
|
37
34
|
selectByLabel(_label: string, _timeout?: number): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Usage of "getValue" is not recommended on Material Select elements. Use "getPlainText()" instead.
|
|
40
|
-
*/
|
|
41
|
-
getValue(): Promise<string | undefined>;
|
|
42
35
|
}
|
|
43
36
|
//# sourceMappingURL=select-material.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-material.d.ts","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;CAAG;AAEjE;;;GAGG;AACH,qBAAa,SAAU,SAAQ,UAAW,YAAW,gBAAgB;gBACvD,cAAc,EAAE,GAAG;IAI/B
|
|
1
|
+
{"version":3,"file":"select-material.d.ts","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;CAAG;AAEjE;;;GAGG;AACH,qBAAa,SAAU,SAAQ,UAAW,YAAW,gBAAgB;gBACvD,cAAc,EAAE,GAAG;IAI/B;;;;OAIG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;;;;OAKG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;;;OAIG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGvE"}
|
|
@@ -15,7 +15,6 @@ var MatSelect = /** @class */ (function (_super) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Select an element in a dropdown by index.
|
|
18
|
-
*
|
|
19
18
|
* @param _index
|
|
20
19
|
* @param _timeout
|
|
21
20
|
*/
|
|
@@ -24,7 +23,6 @@ var MatSelect = /** @class */ (function (_super) {
|
|
|
24
23
|
};
|
|
25
24
|
/**
|
|
26
25
|
* Select an element in a dropdown by value.
|
|
27
|
-
*
|
|
28
26
|
* @param _value
|
|
29
27
|
* @param _timeout
|
|
30
28
|
* @deprecated selectByValue relies on ng-reflect-value, which doesn't work when app is in production mode
|
|
@@ -34,19 +32,12 @@ var MatSelect = /** @class */ (function (_super) {
|
|
|
34
32
|
};
|
|
35
33
|
/**
|
|
36
34
|
* Select an element in a dropdown by label.
|
|
37
|
-
*
|
|
38
35
|
* @param _label
|
|
39
36
|
* @param _timeout
|
|
40
37
|
*/
|
|
41
38
|
MatSelect.prototype.selectByLabel = function (_label, _timeout) {
|
|
42
39
|
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
|
|
43
40
|
};
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Usage of "getValue" is not recommended on Material Select elements. Use "getPlainText()" instead.
|
|
46
|
-
*/
|
|
47
|
-
MatSelect.prototype.getValue = function () {
|
|
48
|
-
return _super.prototype.getValue.call(this);
|
|
49
|
-
};
|
|
50
41
|
return MatSelect;
|
|
51
42
|
}(element_1.O3rElement));
|
|
52
43
|
exports.MatSelect = MatSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AACnE,sCAAwC;AAUxC;;;GAGG;AACH;IAA+B,qCAAU;IACvC,mBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"select-material.js","sourceRoot":"","sources":["../../../src/core/angular-materials/select-material.ts"],"names":[],"mappings":";;;;AAAA,4CAAmE;AACnE,sCAAwC;AAUxC;;;GAGG;AACH;IAA+B,qCAAU;IACvC,mBAAY,cAAmB;eAC7B,kBAAM,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACI,iCAAa,GAApB,UAAqB,MAAc,EAAE,QAAiB;QACpD,MAAM,IAAI,qCAA6B,CAAC,uCAAuC,CAAC,CAAC;IACnF,CAAC;IACH,gBAAC;AAAD,CAAC,AAhCD,CAA+B,oBAAU,GAgCxC;AAhCY,8BAAS","sourcesContent":["import { TranspilationPurposeOnlyError } from '../../errors/index';\nimport { O3rElement } from '../element';\nimport { SelectElementProfile } from '../elements';\n\n/**\n * Interface to describe the material 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 MatSelectProfile extends SelectElementProfile {}\n\n/**\n * Mock for ElementProfile class.\n * This class is used for fixture compilation purpose.\n */\nexport class MatSelect extends O3rElement implements MatSelectProfile {\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 * @deprecated selectByValue relies on ng-reflect-value, which doesn't work when app is in production mode\n */\n public selectByValue(_value: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n\n /**\n * Select an element in a dropdown by label.\n * @param _label\n * @param _timeout\n */\n public selectByLabel(_label: string, _timeout?: number): Promise<void> {\n throw new TranspilationPurposeOnlyError('Should target a proper implementation');\n }\n}\n"]}
|
|
@@ -14,7 +14,6 @@ export interface ComponentFixtureProfile<V extends ElementProfile = ElementProfi
|
|
|
14
14
|
* Queries an element using the CSS selector passed as argument.
|
|
15
15
|
* If the fixture has a context (was created with a TestBed or Protractor element) the query will be applied
|
|
16
16
|
* to this element's tree only.
|
|
17
|
-
*
|
|
18
17
|
* @param selector CSS selector for the desired element
|
|
19
18
|
* @param returnType Constructor of the element expected
|
|
20
19
|
*/
|
|
@@ -25,7 +24,6 @@ export interface ComponentFixtureProfile<V extends ElementProfile = ElementProfi
|
|
|
25
24
|
* Queries the nth element of a list using the CSS selector passed as argument.
|
|
26
25
|
* If the fixture has a context (was created with a TestBed or Protractor element) the query will be applied
|
|
27
26
|
* to this element's tree only.
|
|
28
|
-
*
|
|
29
27
|
* @param selector CSS selector for the desired element
|
|
30
28
|
* @param index Index of the element to retrieve
|
|
31
29
|
* @param returnType Constructor of the element expected
|
|
@@ -37,7 +35,6 @@ export interface ComponentFixtureProfile<V extends ElementProfile = ElementProfi
|
|
|
37
35
|
* Queries a list of elements using the CSS selector passed as argument.
|
|
38
36
|
* If the fixture has a context (was created with a TestBed or Protractor element) the query will be applied
|
|
39
37
|
* to this element's tree only.
|
|
40
|
-
*
|
|
41
38
|
* @param selector CSS selector for the desired elements
|
|
42
39
|
* @param returnType Constructor of the element expected
|
|
43
40
|
* @param groupType
|
|
@@ -56,7 +53,6 @@ export interface ComponentFixtureProfile<V extends ElementProfile = ElementProfi
|
|
|
56
53
|
/**
|
|
57
54
|
* Returns true if the provided selector has no match in the document.
|
|
58
55
|
* A custom timeout value can be passed for asynchronous implementations that support it.
|
|
59
|
-
*
|
|
60
56
|
* @param selector
|
|
61
57
|
* @param timeout
|
|
62
58
|
*/
|
|
@@ -89,7 +85,6 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
89
85
|
/**
|
|
90
86
|
* Throws an exception if the element is undefined.
|
|
91
87
|
* Otherwise returns the element.
|
|
92
|
-
*
|
|
93
88
|
* @param _element ElementProfile to test
|
|
94
89
|
* @param _timeout specific timeout that will throw when reach
|
|
95
90
|
*/
|
|
@@ -97,14 +92,12 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
97
92
|
/**
|
|
98
93
|
* Throws an exception if the element is undefined.
|
|
99
94
|
* Otherwise returns the element.
|
|
100
|
-
*
|
|
101
95
|
* @param _element ElementProfile to test
|
|
102
|
-
* @
|
|
96
|
+
* @param _timeout specific timeout that will throw when reach
|
|
103
97
|
*/
|
|
104
|
-
protected throwOnUndefined<T extends O3rElement>(_element?:
|
|
98
|
+
protected throwOnUndefined<T extends O3rElement>(_element: Promise<T | undefined>, _timeout?: number): Promise<T | undefined>;
|
|
105
99
|
/**
|
|
106
100
|
* Get the element associated to the selector if present
|
|
107
|
-
*
|
|
108
101
|
* @param selector Selector to access the element
|
|
109
102
|
* @param elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
110
103
|
* @param options Options supported
|
|
@@ -124,13 +117,18 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
124
117
|
}): Promise<T | undefined>;
|
|
125
118
|
/**
|
|
126
119
|
* Get text from the element associated to the given selector, or undefined if the element is not found or not visible
|
|
127
|
-
*
|
|
128
120
|
* @param selector Selector to access the element
|
|
129
121
|
* @param options Options supported
|
|
130
122
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
131
123
|
* @param options.index index Select the element associated to the index
|
|
132
124
|
* @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
|
|
133
125
|
* @param options.timeout Duration to wait for the element to be present before it throws
|
|
126
|
+
* @param _selector
|
|
127
|
+
* @param _options
|
|
128
|
+
* @param _options.elementConstructor
|
|
129
|
+
* @param _options.index
|
|
130
|
+
* @param _options.shouldThrowIfNotPresent
|
|
131
|
+
* @param _options.timeout
|
|
134
132
|
*/
|
|
135
133
|
protected getText<T extends O3rElement>(_selector: string, _options?: {
|
|
136
134
|
elementConstructor?: O3rElementConstructor<T> | undefined;
|
|
@@ -140,13 +138,18 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
140
138
|
}): Promise<string | undefined>;
|
|
141
139
|
/**
|
|
142
140
|
* Check if the element associated to the given selector is visible
|
|
143
|
-
*
|
|
144
141
|
* @param selector Selector to access the element
|
|
145
142
|
* @param options Options supported
|
|
146
143
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
147
144
|
* @param options.index index Select the element associated to the index
|
|
148
145
|
* @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
|
|
149
146
|
* @param options.timeout Duration to wait for the element to be present before it throws
|
|
147
|
+
* @param _selector
|
|
148
|
+
* @param _options
|
|
149
|
+
* @param _options.elementConstructor
|
|
150
|
+
* @param _options.index
|
|
151
|
+
* @param _options.shouldThrowIfNotPresent
|
|
152
|
+
* @param _options.timeout
|
|
150
153
|
*/
|
|
151
154
|
protected isVisible<T extends O3rElement>(_selector: string, _options?: {
|
|
152
155
|
elementConstructor?: O3rElementConstructor<T> | undefined;
|
|
@@ -156,13 +159,18 @@ export declare class O3rComponentFixture<V extends O3rElement = O3rElement> impl
|
|
|
156
159
|
}): Promise<boolean>;
|
|
157
160
|
/**
|
|
158
161
|
* Click on the element associated to the given selector if it exists and is visible
|
|
159
|
-
*
|
|
160
162
|
* @param selector Selector to access the element
|
|
161
163
|
* @param options Options supported
|
|
162
164
|
* @param options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
|
|
163
165
|
* @param options.index index Select the element associated to the index
|
|
164
166
|
* @param options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
|
|
165
167
|
* @param options.timeout Duration to wait for the element to be present before it throws
|
|
168
|
+
* @param _selector
|
|
169
|
+
* @param _options
|
|
170
|
+
* @param _options.elementConstructor
|
|
171
|
+
* @param _options.index
|
|
172
|
+
* @param _options.shouldThrowIfNotPresent
|
|
173
|
+
* @param _options.timeout
|
|
166
174
|
*/
|
|
167
175
|
protected click<T extends O3rElement>(_selector: string, _options?: {
|
|
168
176
|
elementConstructor?: O3rElementConstructor<T> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-fixture.d.ts","sourceRoot":"","sources":["../../src/core/component-fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAChF;;OAEG;IACH,UAAU,IAAI,CAAC,GAAG,SAAS,CAAC;IAE5B
|
|
1
|
+
{"version":3,"file":"component-fixture.d.ts","sourceRoot":"","sources":["../../src/core/component-fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAChF;;OAEG;IACH,UAAU,IAAI,CAAC,GAAG,SAAS,CAAC;IAE5B;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IACrF,KAAK,CAAC,CAAC,SAAS,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,C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