@o3r/testing 12.5.0-prerelease.6 → 12.5.0-prerelease.61
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/core/angular/angular-materials/autocomplete-material.js +9 -20
- package/core/angular/angular-materials/autocomplete-material.js.map +1 -1
- package/core/angular/angular-materials/index.js +1 -1
- package/core/angular/angular-materials/select-material.js +42 -91
- package/core/angular/angular-materials/select-material.js.map +1 -1
- package/core/angular/angular-materials/slider-material.js +8 -11
- package/core/angular/angular-materials/slider-material.js.map +1 -1
- package/core/angular/component-fixture.js +68 -148
- package/core/angular/component-fixture.js.map +1 -1
- package/core/angular/element.js +44 -50
- package/core/angular/element.js.map +1 -1
- package/core/angular/elements/checkbox-element.js +12 -16
- package/core/angular/elements/checkbox-element.js.map +1 -1
- package/core/angular/elements/index.js +1 -1
- package/core/angular/elements/radio-element.js +12 -16
- package/core/angular/elements/radio-element.js.map +1 -1
- package/core/angular/elements/select-element.js +28 -49
- package/core/angular/elements/select-element.js.map +1 -1
- package/core/angular/elements/slider-element.js +38 -42
- package/core/angular/elements/slider-element.js.map +1 -1
- package/core/angular/group.js +9 -14
- package/core/angular/group.js.map +1 -1
- package/core/angular/groups/index.js +1 -1
- package/core/angular/groups/radio-group.js +25 -62
- package/core/angular/groups/radio-group.js.map +1 -1
- package/core/angular/index.js +1 -1
- package/core/angular/page-fixture.js +8 -11
- package/core/angular/page-fixture.js.map +1 -1
- package/core/angular-materials/autocomplete-material.js +8 -11
- package/core/angular-materials/autocomplete-material.js.map +1 -1
- package/core/angular-materials/index.js +1 -1
- package/core/angular-materials/select-material.js +12 -15
- package/core/angular-materials/select-material.js.map +1 -1
- package/core/angular-materials/slider-material.js +5 -8
- package/core/angular-materials/slider-material.js.map +1 -1
- package/core/component-fixture.js +28 -33
- package/core/component-fixture.js.map +1 -1
- package/core/element.js +24 -26
- package/core/element.js.map +1 -1
- package/core/elements/checkbox-element.js +12 -16
- package/core/elements/checkbox-element.js.map +1 -1
- package/core/elements/index.js +1 -1
- package/core/elements/radio-element.js +12 -16
- package/core/elements/radio-element.js.map +1 -1
- package/core/elements/select-element.js +10 -13
- package/core/elements/select-element.js.map +1 -1
- package/core/elements/slider-element.js +5 -8
- package/core/elements/slider-element.js.map +1 -1
- package/core/group.js +9 -15
- package/core/group.js.map +1 -1
- package/core/groups/index.js +1 -1
- package/core/groups/radio-group.js +8 -11
- package/core/groups/radio-group.js.map +1 -1
- package/core/helpers.js +11 -16
- package/core/helpers.js.map +1 -1
- package/core/index.js +1 -1
- package/core/page-fixture.js +8 -11
- package/core/page-fixture.js.map +1 -1
- package/core/playwright/angular-materials/autocomplete-material.js +26 -56
- package/core/playwright/angular-materials/autocomplete-material.js.map +1 -1
- package/core/playwright/angular-materials/index.js +1 -1
- package/core/playwright/angular-materials/select-material.js +48 -110
- package/core/playwright/angular-materials/select-material.js.map +1 -1
- package/core/playwright/angular-materials/slider-material.js +7 -10
- package/core/playwright/angular-materials/slider-material.js.map +1 -1
- package/core/playwright/component-fixture.js +88 -173
- package/core/playwright/component-fixture.js.map +1 -1
- package/core/playwright/element.js +38 -90
- package/core/playwright/element.js.map +1 -1
- package/core/playwright/elements/checkbox-element.js +49 -94
- package/core/playwright/elements/checkbox-element.js.map +1 -1
- package/core/playwright/elements/index.js +1 -1
- package/core/playwright/elements/radio-element.js +18 -34
- package/core/playwright/elements/radio-element.js.map +1 -1
- package/core/playwright/elements/select-element.js +14 -21
- package/core/playwright/elements/select-element.js.map +1 -1
- package/core/playwright/elements/slider-element.js +78 -157
- package/core/playwright/elements/slider-element.js.map +1 -1
- package/core/playwright/group.js +9 -14
- package/core/playwright/group.js.map +1 -1
- package/core/playwright/groups/index.js +1 -1
- package/core/playwright/groups/radio-group.js +27 -64
- package/core/playwright/groups/radio-group.js.map +1 -1
- package/core/playwright/index.js +1 -1
- package/core/playwright/page-fixture.js +8 -18
- package/core/playwright/page-fixture.js.map +1 -1
- package/core/protractor/angular-materials/autocomplete-material.js +12 -26
- package/core/protractor/angular-materials/autocomplete-material.js.map +1 -1
- package/core/protractor/angular-materials/index.js +1 -1
- package/core/protractor/angular-materials/select-material.js +45 -97
- package/core/protractor/angular-materials/select-material.js.map +1 -1
- package/core/protractor/component-fixture.js +89 -200
- package/core/protractor/component-fixture.js.map +1 -1
- package/core/protractor/element.js +46 -118
- package/core/protractor/element.js.map +1 -1
- package/core/protractor/elements/checkbox-element.js +18 -40
- package/core/protractor/elements/checkbox-element.js.map +1 -1
- package/core/protractor/elements/index.js +1 -1
- package/core/protractor/elements/radio-element.js +20 -42
- package/core/protractor/elements/radio-element.js.map +1 -1
- package/core/protractor/elements/select-element.js +16 -37
- package/core/protractor/elements/select-element.js.map +1 -1
- package/core/protractor/group.js +9 -14
- package/core/protractor/group.js.map +1 -1
- package/core/protractor/groups/index.js +1 -1
- package/core/protractor/groups/radio-group.js +29 -66
- package/core/protractor/groups/radio-group.js.map +1 -1
- package/core/protractor/index.js +1 -1
- package/core/protractor/page-fixture.js +9 -12
- package/core/protractor/page-fixture.js.map +1 -1
- package/core/protractor/utils.js +1 -1
- package/core/protractor/utils.js.map +1 -1
- package/errors/fixture-usage-error.js +5 -10
- package/errors/fixture-usage-error.js.map +1 -1
- package/errors/index.js +1 -1
- package/errors/transpilation-purpose-only.js +5 -10
- package/errors/transpilation-purpose-only.js.map +1 -1
- package/kassette/index.js +1 -1
- package/kassette/update-dates-in-mocks.js +66 -85
- package/kassette/update-dates-in-mocks.js.map +1 -1
- package/localization/index.js +1 -1
- package/localization/localization-mock.js +38 -60
- package/localization/localization-mock.js.map +1 -1
- package/mocks/index.js +1 -1
- package/mocks/mock-component-generator.js +54 -53
- package/mocks/mock-component-generator.js.map +1 -1
- package/package.json +27 -20
- package/public_api.js +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +31 -26
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/playwright/index.d.ts.map +1 -1
- package/schematics/ng-add/playwright/index.js +17 -15
- package/schematics/ng-add/playwright/index.js.map +1 -1
- package/store/index.js +1 -1
- package/store/testable-select.js +13 -13
- package/store/testable-select.js.map +1 -1
- package/tools/index.js +1 -1
- package/tools/path-replacement/index.js +1 -1
- package/tools/path-replacement/path-replacement.js +24 -19
- package/tools/path-replacement/path-replacement.js.map +1 -1
- package/tools/protractor/fetch-manager/_fetch-manager.d.ts +1 -0
- package/tools/protractor/fetch-manager/_fetch-manager.d.ts.map +1 -0
- package/tools/protractor/fetch-manager/_fetch-manager.js +127 -0
- package/tools/protractor/fetch-manager/_fetch-manager.js.map +1 -0
- package/tools/protractor/fetch-manager/index.js +1 -1
- package/tools/protractor/fetch-manager/utils.js +15 -51
- package/tools/protractor/fetch-manager/utils.js.map +1 -1
- package/tools/protractor/index.js +1 -1
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts +5 -0
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.d.ts.map +1 -0
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js +157 -0
- package/tools/protractor/post-message-interceptor/_post-message-interceptor.js.map +1 -0
- package/tools/protractor/post-message-interceptor/index.js +1 -1
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js +30 -103
- package/tools/protractor/post-message-interceptor/post-message-interceptor.js.map +1 -1
- package/visual-test/index.js +1 -1
- package/visual-test/utils.js +18 -7
- package/visual-test/utils.js.map +1 -1
- package/visual-test/visual-test.js +29 -34
- package/visual-test/visual-test.js.map +1 -1
- package/visual-testing-reporter/index.d.ts.map +1 -1
- package/visual-testing-reporter/index.js +37 -40
- package/visual-testing-reporter/index.js.map +1 -1
@@ -1,145 +1,73 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.O3rElement = void 0;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
var utils_1 = require("./utils");
|
4
|
+
const protractor_1 = require("protractor");
|
5
|
+
const ptor_1 = require("protractor/built/ptor");
|
6
|
+
const protractor_2 = require("../../tools/protractor");
|
7
|
+
const utils_1 = require("./utils");
|
9
8
|
/**
|
10
9
|
* Implementation dedicated to protractor.
|
11
10
|
* @deprecated Will be removed in v13, please use Playwright instead
|
12
11
|
*/
|
13
|
-
|
14
|
-
|
12
|
+
class O3rElement {
|
13
|
+
constructor(sourceElement) {
|
15
14
|
this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;
|
16
15
|
}
|
17
16
|
/** @inheritdoc */
|
18
|
-
|
17
|
+
getText() {
|
19
18
|
return (0, utils_1.convertPromise)(this.sourceElement.getText());
|
20
|
-
}
|
19
|
+
}
|
21
20
|
/** @inheritdoc */
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
switch (_a.label) {
|
27
|
-
case 0: return [4 /*yield*/, this.getText()];
|
28
|
-
case 1:
|
29
|
-
innerText = _a.sent();
|
30
|
-
return [2 /*return*/, Promise.resolve(innerText ? innerText.replace(/\r\n|\r|\n/g, ' ').replace(/\s\s+/g, ' ').trim() : undefined)];
|
31
|
-
}
|
32
|
-
});
|
33
|
-
});
|
34
|
-
};
|
21
|
+
async getPlainText() {
|
22
|
+
const innerText = await this.getText();
|
23
|
+
return Promise.resolve(innerText ? innerText.replace(/\r\n|\r|\n/g, ' ').replace(/\s\s+/g, ' ').trim() : undefined);
|
24
|
+
}
|
35
25
|
/** @inheritdoc */
|
36
|
-
|
26
|
+
getInnerHTML() {
|
37
27
|
return (0, utils_1.convertPromise)(this.sourceElement.getInnerHtml());
|
38
|
-
}
|
28
|
+
}
|
39
29
|
/** @inheritdoc */
|
40
|
-
|
30
|
+
mouseOver() {
|
41
31
|
return (0, utils_1.convertPromise)(protractor_1.browser
|
42
32
|
.actions()
|
43
33
|
.mouseMove(this.sourceElement)
|
44
34
|
.perform());
|
45
|
-
}
|
35
|
+
}
|
46
36
|
/** @inheritdoc */
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
switch (_a.label) {
|
52
|
-
case 0: return [4 /*yield*/, this.sourceElement.getAttribute('value')];
|
53
|
-
case 1:
|
54
|
-
value = _a.sent();
|
55
|
-
return [2 /*return*/, value === null ? undefined : value];
|
56
|
-
}
|
57
|
-
});
|
58
|
-
});
|
59
|
-
};
|
37
|
+
async getValue() {
|
38
|
+
const value = await this.sourceElement.getAttribute('value');
|
39
|
+
return value === null ? undefined : value;
|
40
|
+
}
|
60
41
|
/** @inheritdoc */
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
case 1:
|
69
|
-
// Clears the value in the field
|
70
|
-
_a.sent();
|
71
|
-
return [4 /*yield*/, this.sourceElement.sendKeys(input)];
|
72
|
-
case 2:
|
73
|
-
_a.sent();
|
74
|
-
return [4 /*yield*/, this.sourceElement.sendKeys(ptor_1.protractor.Key.TAB)];
|
75
|
-
case 3:
|
76
|
-
_a.sent();
|
77
|
-
return [2 /*return*/, (0, protractor_2.waitForOtterStable)()];
|
78
|
-
}
|
79
|
-
});
|
80
|
-
});
|
81
|
-
};
|
42
|
+
async setValue(input) {
|
43
|
+
// Clears the value in the field
|
44
|
+
await this.clearValue();
|
45
|
+
await this.sourceElement.sendKeys(input);
|
46
|
+
await this.sourceElement.sendKeys(ptor_1.protractor.Key.TAB);
|
47
|
+
return (0, protractor_2.waitForOtterStable)();
|
48
|
+
}
|
82
49
|
/** @inheritdoc */
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
case 1:
|
91
|
-
currentValue = _b.sent();
|
92
|
-
if (!(currentValue !== undefined)) return [3 /*break*/, 3];
|
93
|
-
// eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
|
94
|
-
return [4 /*yield*/, (_a = this.sourceElement).sendKeys.apply(_a, (new Array(currentValue.length + 1).fill(ptor_1.protractor.Key.BACK_SPACE)))];
|
95
|
-
case 2:
|
96
|
-
// eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
|
97
|
-
_b.sent();
|
98
|
-
_b.label = 3;
|
99
|
-
case 3: return [2 /*return*/];
|
100
|
-
}
|
101
|
-
});
|
102
|
-
});
|
103
|
-
};
|
50
|
+
async clearValue() {
|
51
|
+
const currentValue = await this.getValue();
|
52
|
+
if (currentValue !== undefined) {
|
53
|
+
// eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose
|
54
|
+
await this.sourceElement.sendKeys(...(new Array(currentValue.length + 1).fill(ptor_1.protractor.Key.BACK_SPACE)));
|
55
|
+
}
|
56
|
+
}
|
104
57
|
/** @inheritdoc */
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
case 0: return [4 /*yield*/, this.sourceElement.click()];
|
110
|
-
case 1:
|
111
|
-
_a.sent();
|
112
|
-
return [2 /*return*/, (0, protractor_2.waitForOtterStable)()];
|
113
|
-
}
|
114
|
-
});
|
115
|
-
});
|
116
|
-
};
|
58
|
+
async click() {
|
59
|
+
await this.sourceElement.click();
|
60
|
+
return (0, protractor_2.waitForOtterStable)();
|
61
|
+
}
|
117
62
|
/** @inheritdoc */
|
118
|
-
|
119
|
-
return
|
120
|
-
|
121
|
-
switch (_a.label) {
|
122
|
-
case 0: return [4 /*yield*/, this.sourceElement.isDisplayed()];
|
123
|
-
case 1: return [2 /*return*/, _a.sent()];
|
124
|
-
}
|
125
|
-
});
|
126
|
-
});
|
127
|
-
};
|
63
|
+
async isVisible() {
|
64
|
+
return await this.sourceElement.isDisplayed();
|
65
|
+
}
|
128
66
|
/** @inheritdoc */
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
case 0: return [4 /*yield*/, this.sourceElement.getAttribute(attributeName)];
|
135
|
-
case 1:
|
136
|
-
attribute = _a.sent();
|
137
|
-
return [2 /*return*/, attribute === null ? undefined : attribute];
|
138
|
-
}
|
139
|
-
});
|
140
|
-
});
|
141
|
-
};
|
142
|
-
return O3rElement;
|
143
|
-
}());
|
67
|
+
async getAttribute(attributeName) {
|
68
|
+
const attribute = await this.sourceElement.getAttribute(attributeName);
|
69
|
+
return attribute === null ? undefined : attribute;
|
70
|
+
}
|
71
|
+
}
|
144
72
|
exports.O3rElement = O3rElement;
|
145
73
|
//# sourceMappingURL=element.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../src/core/protractor/element.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n browser,\n ElementFinder,\n} from 'protractor';\nimport {\n protractor as ptor,\n} from 'protractor/built/ptor';\nimport {\n waitForOtterStable,\n} from '../../tools/protractor';\nimport {\n ElementProfile,\n} from '../element';\nimport {\n convertPromise,\n} from './utils';\n\nexport { ElementProfile } from '../element';\n\n/**\n * Implementation dedicated to protractor.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rElement implements ElementProfile {\n /** Protractor ElementProfile */\n public sourceElement: ElementFinder;\n\n constructor(sourceElement: ElementFinder | O3rElement) {\n this.sourceElement = sourceElement instanceof O3rElement ? sourceElement.sourceElement : sourceElement;\n }\n\n /** @inheritdoc */\n public getText() {\n return convertPromise(this.sourceElement.getText());\n }\n\n /** @inheritdoc */\n public async getPlainText() {\n const innerText = await this.getText();\n return Promise.resolve(innerText ? innerText.replace(/\\r\\n|\\r|\\n/g, ' ').replace(/\\s\\s+/g, ' ').trim() : undefined);\n }\n\n /** @inheritdoc */\n public getInnerHTML(): Promise<string | undefined> {\n return convertPromise(this.sourceElement.getInnerHtml());\n }\n\n /** @inheritdoc */\n public mouseOver() {\n return convertPromise(\n browser\n .actions()\n .mouseMove(this.sourceElement)\n .perform()\n );\n }\n\n /** @inheritdoc */\n public async getValue() {\n const value = await this.sourceElement.getAttribute('value');\n return value === null ? undefined : value;\n }\n\n /** @inheritdoc */\n public async setValue(input: string) {\n // Clears the value in the field\n await this.clearValue();\n await this.sourceElement.sendKeys(input);\n await this.sourceElement.sendKeys(ptor.Key.TAB);\n return waitForOtterStable();\n }\n\n /** @inheritdoc */\n public async clearValue() {\n const currentValue = await this.getValue();\n\n if (currentValue !== undefined) {\n // eslint-disable-next-line unicorn/no-new-array -- Required for array initialization purpose\n await this.sourceElement.sendKeys(...(new Array<string>(currentValue.length + 1).fill(ptor.Key.BACK_SPACE)));\n }\n }\n\n /** @inheritdoc */\n public async click() {\n await this.sourceElement.click();\n return waitForOtterStable();\n }\n\n /** @inheritdoc */\n public async isVisible() {\n return await this.sourceElement.isDisplayed();\n }\n\n /** @inheritdoc */\n public async getAttribute(attributeName: string) {\n const attribute = await this.sourceElement.getAttribute(attributeName);\n return attribute === null ? undefined : attribute;\n }\n}\n\n/**\n * Constructor of a O3rElement\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: ElementFinder | O3rElement) => T;\n"]}
|
@@ -1,54 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.O3rCheckboxElement = void 0;
|
4
|
-
|
5
|
-
var element_1 = require("../element");
|
4
|
+
const element_1 = require("../element");
|
6
5
|
/**
|
7
6
|
* Implementation dedicated to karma / TestBed.
|
8
7
|
* @deprecated Will be removed in v13, please use Playwright instead
|
9
8
|
*/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
return _super.call(this, sourceElement) || this;
|
9
|
+
class O3rCheckboxElement extends element_1.O3rElement {
|
10
|
+
constructor(sourceElement) {
|
11
|
+
super(sourceElement);
|
14
12
|
}
|
15
13
|
/** @inheritDoc */
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
case 1:
|
24
|
-
currentValue = _a.sent();
|
25
|
-
if (currentValue === value) {
|
26
|
-
return [2 /*return*/, Promise.resolve()];
|
27
|
-
}
|
28
|
-
return [2 /*return*/, associatedLabel ? associatedLabel.click() : this.click()];
|
29
|
-
}
|
30
|
-
});
|
31
|
-
});
|
32
|
-
};
|
14
|
+
async check(value = true, associatedLabel) {
|
15
|
+
const currentValue = await this.isChecked();
|
16
|
+
if (currentValue === value) {
|
17
|
+
return Promise.resolve();
|
18
|
+
}
|
19
|
+
return associatedLabel ? associatedLabel.click() : this.click();
|
20
|
+
}
|
33
21
|
/** @inheritDoc */
|
34
|
-
|
22
|
+
uncheck() {
|
35
23
|
return this.check(false);
|
36
|
-
}
|
24
|
+
}
|
37
25
|
/** @inheritDoc */
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
case 0: return [4 /*yield*/, this.sourceElement.isSelected()];
|
44
|
-
case 1:
|
45
|
-
value = _a.sent();
|
46
|
-
return [2 /*return*/, value];
|
47
|
-
}
|
48
|
-
});
|
49
|
-
});
|
50
|
-
};
|
51
|
-
return O3rCheckboxElement;
|
52
|
-
}(element_1.O3rElement));
|
26
|
+
async isChecked() {
|
27
|
+
const value = await this.sourceElement.isSelected();
|
28
|
+
return value;
|
29
|
+
}
|
30
|
+
}
|
53
31
|
exports.O3rCheckboxElement = O3rCheckboxElement;
|
54
32
|
//# sourceMappingURL=checkbox-element.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"checkbox-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/checkbox-element.ts"],"names":[],"mappings":";;;AAMA,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,oBAAU;IAChD,YAAY,aAA4B;QACtC,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,eAA4B;QAC3D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;YAC3B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAClE,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,SAAS;QACpB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAzBD,gDAyBC","sourcesContent":["import {\n ElementFinder,\n} from 'protractor';\nimport {\n CheckboxElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rCheckboxElement extends O3rElement implements CheckboxElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true, associatedLabel?: O3rElement) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n return Promise.resolve();\n }\n\n return associatedLabel ? associatedLabel.click() : this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const value = await this.sourceElement.isSelected();\n return value;\n }\n}\n"]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
3
|
+
const tslib_1 = require("tslib");
|
4
4
|
tslib_1.__exportStar(require("./checkbox-element"), exports);
|
5
5
|
tslib_1.__exportStar(require("./radio-element"), exports);
|
6
6
|
tslib_1.__exportStar(require("./select-element"), exports);
|
@@ -1,56 +1,34 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.O3rRadioElement = void 0;
|
4
|
-
|
5
|
-
var element_1 = require("../element");
|
4
|
+
const element_1 = require("../element");
|
6
5
|
/**
|
7
6
|
* Implementation dedicated to karma / TestBed.
|
8
7
|
* @deprecated Will be removed in v13, please use Playwright instead
|
9
8
|
*/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
return _super.call(this, sourceElement) || this;
|
9
|
+
class O3rRadioElement extends element_1.O3rElement {
|
10
|
+
constructor(sourceElement) {
|
11
|
+
super(sourceElement);
|
14
12
|
}
|
15
13
|
/** @inheritDoc */
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
if (currentValue === value) {
|
26
|
-
// eslint-disable-next-line no-console -- no other logger available
|
27
|
-
console.warn("O3rRadioElement is already ".concat(value ? 'checked' : 'unchecked'));
|
28
|
-
return [2 /*return*/, Promise.resolve()];
|
29
|
-
}
|
30
|
-
return [2 /*return*/, this.click()];
|
31
|
-
}
|
32
|
-
});
|
33
|
-
});
|
34
|
-
};
|
14
|
+
async check(value = true) {
|
15
|
+
const currentValue = await this.isChecked();
|
16
|
+
if (currentValue === value) {
|
17
|
+
// eslint-disable-next-line no-console -- no other logger available
|
18
|
+
console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);
|
19
|
+
return Promise.resolve();
|
20
|
+
}
|
21
|
+
return this.click();
|
22
|
+
}
|
35
23
|
/** @inheritDoc */
|
36
|
-
|
24
|
+
uncheck() {
|
37
25
|
return this.check(false);
|
38
|
-
}
|
26
|
+
}
|
39
27
|
/** @inheritDoc */
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
case 0: return [4 /*yield*/, this.getAttribute('checked')];
|
46
|
-
case 1:
|
47
|
-
checked = _a.sent();
|
48
|
-
return [2 /*return*/, checked !== undefined];
|
49
|
-
}
|
50
|
-
});
|
51
|
-
});
|
52
|
-
};
|
53
|
-
return O3rRadioElement;
|
54
|
-
}(element_1.O3rElement));
|
28
|
+
async isChecked() {
|
29
|
+
const checked = await this.getAttribute('checked');
|
30
|
+
return checked !== undefined;
|
31
|
+
}
|
32
|
+
}
|
55
33
|
exports.O3rRadioElement = O3rRadioElement;
|
56
34
|
//# sourceMappingURL=radio-element.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"radio-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/radio-element.ts"],"names":[],"mappings":";;;AAMA,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,eAAgB,SAAQ,oBAAU;IAC7C,YAAY,aAA4B;QACtC,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI;QAC7B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;YAC3B,mEAAmE;YACnE,OAAO,CAAC,IAAI,CAAC,8BAA8B,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YAC9E,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,kBAAkB;IACX,OAAO;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,SAAS;QACpB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACnD,OAAO,OAAO,KAAK,SAAS,CAAC;IAC/B,CAAC;CACF;AA3BD,0CA2BC","sourcesContent":["import {\n ElementFinder,\n} from 'protractor';\nimport {\n RadioElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rRadioElement extends O3rElement implements RadioElementProfile {\n constructor(sourceElement: ElementFinder) {\n super(sourceElement);\n }\n\n /** @inheritDoc */\n public async check(value = true) {\n const currentValue = await this.isChecked();\n if (currentValue === value) {\n // eslint-disable-next-line no-console -- no other logger available\n console.warn(`O3rRadioElement is already ${value ? 'checked' : 'unchecked'}`);\n return Promise.resolve();\n }\n\n return this.click();\n }\n\n /** @inheritDoc */\n public uncheck() {\n return this.check(false);\n }\n\n /** @inheritDoc */\n public async isChecked(): Promise<boolean> {\n const checked = await this.getAttribute('checked');\n return checked !== undefined;\n }\n}\n"]}
|
@@ -1,49 +1,28 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.O3rSelectElement = void 0;
|
4
|
-
|
5
|
-
|
6
|
-
var element_1 = require("../element");
|
4
|
+
const protractor_1 = require("protractor");
|
5
|
+
const element_1 = require("../element");
|
7
6
|
/**
|
8
7
|
* Implementation dedicated to Protractor.
|
9
8
|
* @deprecated Will be removed in v13, please use Playwright instead
|
10
9
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return _super.call(this, sourceElement) || this;
|
10
|
+
class O3rSelectElement extends element_1.O3rElement {
|
11
|
+
constructor(sourceElement) {
|
12
|
+
super(sourceElement);
|
15
13
|
}
|
16
14
|
/** @inheritdoc */
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
case 0: return [4 /*yield*/, this.click()];
|
23
|
-
case 1:
|
24
|
-
_a.sent();
|
25
|
-
options = this.sourceElement.all(protractor_1.By.tagName('option'));
|
26
|
-
return [2 /*return*/, new element_1.O3rElement(options.get(index)).click()];
|
27
|
-
}
|
28
|
-
});
|
29
|
-
});
|
30
|
-
};
|
15
|
+
async selectByIndex(index, _timeout) {
|
16
|
+
await this.click();
|
17
|
+
const options = this.sourceElement.all(protractor_1.By.tagName('option'));
|
18
|
+
return new element_1.O3rElement(options.get(index)).click();
|
19
|
+
}
|
31
20
|
/** @inheritdoc */
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
case 1:
|
39
|
-
_a.sent();
|
40
|
-
option = this.sourceElement.element(protractor_1.By.css("option[value='".concat(value, "']")));
|
41
|
-
return [2 /*return*/, new element_1.O3rElement(option).click()];
|
42
|
-
}
|
43
|
-
});
|
44
|
-
});
|
45
|
-
};
|
46
|
-
return O3rSelectElement;
|
47
|
-
}(element_1.O3rElement));
|
21
|
+
async selectByValue(value, _timeout) {
|
22
|
+
await this.click();
|
23
|
+
const option = this.sourceElement.element(protractor_1.By.css(`option[value='${value}']`));
|
24
|
+
return new element_1.O3rElement(option).click();
|
25
|
+
}
|
26
|
+
}
|
48
27
|
exports.O3rSelectElement = O3rSelectElement;
|
49
28
|
//# sourceMappingURL=select-element.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"select-element.js","sourceRoot":"","sources":["../../../../src/core/protractor/elements/select-element.ts"],"names":[],"mappings":";;;AAAA,2CAGoB;AAIpB,wCAEoB;AAEpB;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,oBAAU;IAC9C,YAAY,aAAyC;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,QAAiB;QACzD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7D,OAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACpD,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,QAAiB;QACzD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,eAAE,CAAC,GAAG,CAAC,iBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC;QAC9E,OAAO,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;CACF;AAlBD,4CAkBC","sourcesContent":["import {\n By,\n ElementFinder,\n} from 'protractor';\nimport {\n SelectElementProfile,\n} from '../../elements';\nimport {\n O3rElement,\n} from '../element';\n\n/**\n * Implementation dedicated to Protractor.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rSelectElement extends O3rElement implements SelectElementProfile {\n constructor(sourceElement: ElementFinder | O3rElement) {\n super(sourceElement);\n }\n\n /** @inheritdoc */\n public async selectByIndex(index: number, _timeout?: number) {\n await this.click();\n const options = this.sourceElement.all(By.tagName('option'));\n return new O3rElement(options.get(index)).click();\n }\n\n /** @inheritdoc */\n public async selectByValue(value: string, _timeout?: number) {\n await this.click();\n const option = this.sourceElement.element(By.css(`option[value='${value}']`));\n return new O3rElement(option).click();\n }\n}\n"]}
|
package/core/protractor/group.js
CHANGED
@@ -5,23 +5,18 @@ exports.O3rGroup = void 0;
|
|
5
5
|
* Implementation dedicated to karma / TestBed.
|
6
6
|
* @deprecated Will be removed in v13, please use Playwright instead
|
7
7
|
*/
|
8
|
-
|
9
|
-
|
8
|
+
class O3rGroup {
|
9
|
+
/** @inheritDoc */
|
10
|
+
get items() {
|
11
|
+
return this.sourceElement;
|
12
|
+
}
|
13
|
+
constructor(sourceElement) {
|
10
14
|
this.sourceElement = sourceElement;
|
11
15
|
}
|
12
|
-
Object.defineProperty(O3rGroup.prototype, "items", {
|
13
|
-
/** @inheritDoc */
|
14
|
-
get: function () {
|
15
|
-
return this.sourceElement;
|
16
|
-
},
|
17
|
-
enumerable: false,
|
18
|
-
configurable: true
|
19
|
-
});
|
20
16
|
/** @inheritDoc */
|
21
|
-
|
17
|
+
isValidGroup() {
|
22
18
|
return Promise.resolve(true);
|
23
|
-
}
|
24
|
-
|
25
|
-
}());
|
19
|
+
}
|
20
|
+
}
|
26
21
|
exports.O3rGroup = O3rGroup;
|
27
22
|
//# sourceMappingURL=group.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/core/protractor/group.ts"],"names":[],"mappings":";;;AAgBA;;;GAGG;AACH;
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../src/core/protractor/group.ts"],"names":[],"mappings":";;;AAgBA;;;GAGG;AACH,MAAa,QAAQ;IACnB,kBAAkB;IAClB,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,YAAsB,aAAkB;QAAlB,kBAAa,GAAb,aAAa,CAAK;IAAG,CAAC;IAE5C,kBAAkB;IACX,YAAY;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAZD,4BAYC","sourcesContent":["import {\n GroupProfile,\n} from '../group';\nimport {\n ElementProfile,\n O3rElement,\n} from './element';\n\nexport { GroupProfile } from '../group';\n\n/**\n * Constructor of a O3rGroup\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport type O3rGroupConstructor<T extends GroupProfile<V>, V extends ElementProfile> = new (sourceElement: V[]) => T;\n\n/**\n * Implementation dedicated to karma / TestBed.\n * @deprecated Will be removed in v13, please use Playwright instead\n */\nexport class O3rGroup<T extends O3rElement> implements GroupProfile<T> {\n /** @inheritDoc */\n public get items(): T[] {\n return this.sourceElement;\n }\n\n constructor(protected sourceElement: T[]) {}\n\n /** @inheritDoc */\n public isValidGroup() {\n return Promise.resolve(true);\n }\n}\n"]}
|