@sap_oss/wdio-qmate-service 3.6.3 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/reuse/modules/ui5/userInteraction.d.ts +22 -6
- package/lib/reuse/modules/ui5/userInteraction.js +111 -46
- package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
- package/lib/scripts/locators/qmateLocator.js +62 -23
- package/lib/scripts/locators/qmateLocator.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/AncestorFilter.js +5 -0
- package/lib/scripts/locators/qmateLocatorSrc/filters/AncestorFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/BaseFilter.d.ts +2 -2
- package/lib/scripts/locators/qmateLocatorSrc/filters/BaseFilter.js +7 -2
- package/lib/scripts/locators/qmateLocatorSrc/filters/BaseFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/ChildFilter.js +5 -0
- package/lib/scripts/locators/qmateLocatorSrc/filters/ChildFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/DescendantFilter.js +6 -0
- package/lib/scripts/locators/qmateLocatorSrc/filters/DescendantFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/ElementFilter.js +13 -10
- package/lib/scripts/locators/qmateLocatorSrc/filters/ElementFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/PropertiesFilter.js +4 -3
- package/lib/scripts/locators/qmateLocatorSrc/filters/PropertiesFilter.js.map +1 -1
- package/lib/scripts/locators/qmateLocatorSrc/filters/SiblingFilter.js +5 -0
- package/lib/scripts/locators/qmateLocatorSrc/filters/SiblingFilter.js.map +1 -1
- package/package.json +1 -1
- package/reuseApi.json +2 -2
- package/test/core/functional/locators/ancestorProperties.test.js +63 -0
- package/test/core/functional/locators/childProperties.test.js +48 -0
- package/test/core/functional/locators/descendantProperties.test.js +60 -0
- package/test/core/functional/locators/siblingProperties.test.js +52 -0
- package/test/reuse/ui5/date/pickRange.spec.js +3 -3
- package/test/reuse/ui5/userInteraction/clickTab.spec.js +1 -1
- package/test/reuse/ui5/userInteraction/openValueHelp.spec.js +70 -0
- package/test/reuse/ui5/userInteraction/test.userInteraction.conf.js +1 -0
|
@@ -112,6 +112,58 @@ describe("webdriver.io page locator test", function () {
|
|
|
112
112
|
};
|
|
113
113
|
await expect(browser.uiControl(wrongProperties)).rejects.toThrowError(/No visible elements found/);
|
|
114
114
|
});
|
|
115
|
+
|
|
116
|
+
it("should access element by elementProperties and multiple siblingProperties as array - AND (happy case)", async function () {
|
|
117
|
+
// The AC list item has CSA as a sibling, and also has other StandardListItem siblings - both conditions must match
|
|
118
|
+
const selector = {
|
|
119
|
+
"elementProperties": {
|
|
120
|
+
"viewName": "sap.ui.demo.cart.view.Home",
|
|
121
|
+
"metadata": "sap.m.StandardListItem",
|
|
122
|
+
"bindingContextPath": "/ProductCategories*'AC')"
|
|
123
|
+
},
|
|
124
|
+
"siblingProperties": [
|
|
125
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem", "bindingContextPath": "/ProductCategories*'CSA')" },
|
|
126
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem" }
|
|
127
|
+
]
|
|
128
|
+
};
|
|
129
|
+
const elem = await browser.uiControl(selector);
|
|
130
|
+
await expect(elem).toBeDisplayed();
|
|
131
|
+
await expect(elem).toBeClickable();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("should fail when one entry of siblingProperties array does not match - AND (unhappy case)", async function () {
|
|
135
|
+
// Second entry points to a non-existent sibling - AND logic means the whole selector fails
|
|
136
|
+
const selector = {
|
|
137
|
+
"elementProperties": {
|
|
138
|
+
"viewName": "sap.ui.demo.cart.view.Home",
|
|
139
|
+
"metadata": "sap.m.StandardListItem",
|
|
140
|
+
"bindingContextPath": "/ProductCategories*'AC')"
|
|
141
|
+
},
|
|
142
|
+
"siblingProperties": [
|
|
143
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem", "bindingContextPath": "/ProductCategories*'CSA')" },
|
|
144
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem", "bindingContextPath": "/ProductCategories*'THIS-DOES-NOT-EXIST')" }
|
|
145
|
+
]
|
|
146
|
+
};
|
|
147
|
+
await expect(browser.uiControl(selector, 0, 1000))
|
|
148
|
+
.rejects.toThrowError(/No visible elements found/);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("should return multiple elements when multiple elements each satisfy array siblingProperties - AND (multiple results)", async function () {
|
|
152
|
+
// All category items (except AC and CSA themselves) have both AC and CSA as siblings - returns multiple items
|
|
153
|
+
const selector = {
|
|
154
|
+
"elementProperties": {
|
|
155
|
+
"viewName": "sap.ui.demo.cart.view.Home",
|
|
156
|
+
"metadata": "sap.m.StandardListItem"
|
|
157
|
+
},
|
|
158
|
+
"siblingProperties": [
|
|
159
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem", "bindingContextPath": "/ProductCategories*'CSA')" },
|
|
160
|
+
{ "viewName": "sap.ui.demo.cart.view.Home", "metadata": "sap.m.StandardListItem", "bindingContextPath": "/ProductCategories*'AC')" }
|
|
161
|
+
]
|
|
162
|
+
};
|
|
163
|
+
const elems = await browser.uiControls(selector);
|
|
164
|
+
expect(elems.length).toBeGreaterThan(1);
|
|
165
|
+
});
|
|
166
|
+
|
|
115
167
|
});
|
|
116
168
|
|
|
117
169
|
|
|
@@ -40,7 +40,7 @@ describe("date - pickRange - when DateRangeSelection do not have any value", fun
|
|
|
40
40
|
|
|
41
41
|
const startRange = getBorderOfRange(start);
|
|
42
42
|
const endRange = getBorderOfRange(end);
|
|
43
|
-
const rangeAsString = `${startRange}
|
|
43
|
+
const rangeAsString = `${startRange} – ${endRange}`;
|
|
44
44
|
|
|
45
45
|
common.assertion.expectEqual(arrivedRange, rangeAsString);
|
|
46
46
|
});
|
|
@@ -77,7 +77,7 @@ describe("date - pickRange - with index as 2", function () {
|
|
|
77
77
|
|
|
78
78
|
const startRange = getBorderOfRange(start);
|
|
79
79
|
const endRange = getBorderOfRange(end);
|
|
80
|
-
const rangeAsString = `${startRange}
|
|
80
|
+
const rangeAsString = `${startRange} – ${endRange}`;
|
|
81
81
|
|
|
82
82
|
common.assertion.expectEqual(arrivedRange, rangeAsString);
|
|
83
83
|
});
|
|
@@ -123,7 +123,7 @@ describe("date - pickRange - with icon as selector", function () {
|
|
|
123
123
|
|
|
124
124
|
const startRange = getBorderOfRange(start);
|
|
125
125
|
const endRange = getBorderOfRange(end);
|
|
126
|
-
const rangeAsString = `${startRange}
|
|
126
|
+
const rangeAsString = `${startRange} – ${endRange}`;
|
|
127
127
|
|
|
128
128
|
common.assertion.expectEqual(arrivedRange, rangeAsString);
|
|
129
129
|
});
|
|
@@ -58,7 +58,7 @@ describe("userInteraction - clickTab - multiple select values", function () {
|
|
|
58
58
|
title: "Summary"
|
|
59
59
|
},
|
|
60
60
|
ancestorProperties: {
|
|
61
|
-
metadata: "sap.
|
|
61
|
+
metadata: "sap.ui.documentation.ObjectPageSection",
|
|
62
62
|
viewName: "sap.ui.documentation.sdk.view.SubApiDetail",
|
|
63
63
|
title: "Events"
|
|
64
64
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const { BASE_URL } = require("../../../../src/reuse/constants.ts");
|
|
2
|
+
const { handleCookiesConsent } = require("../../../helper/utils");
|
|
3
|
+
|
|
4
|
+
const valueHelpSelector = {
|
|
5
|
+
"elementProperties": {
|
|
6
|
+
"metadata": "sap.m.Input",
|
|
7
|
+
"id": "sampleComp-sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp---IDView--idDeliveryTransport-input"
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const datePickerSelector = {
|
|
12
|
+
"elementProperties": {
|
|
13
|
+
"metadata": "sap.m.DatePicker",
|
|
14
|
+
"id": "sampleComp-sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp---IDView--idCreationDate-datePicker"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const valueHelpDialogTitle = {
|
|
19
|
+
"elementProperties": {
|
|
20
|
+
"metadata": "sap.m.Title",
|
|
21
|
+
"id": "sampleComp-sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp---IDView--idDeliveryTransport-input-valueHelpDialog-title"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
describe("userInteraction - openValueHelp - use valid valuehelp icon button", function () {
|
|
26
|
+
it("Preparation", async function () {
|
|
27
|
+
await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.valuehelpdialog.ValueHelpDialog/sample/sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp`);
|
|
28
|
+
await handleCookiesConsent();
|
|
29
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("Execution", async function () {
|
|
33
|
+
await ui5.userInteraction.openValueHelp(valueHelpSelector);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("Verification", async function () {
|
|
37
|
+
await ui5.assertion.expectToBeVisible(valueHelpDialogTitle);
|
|
38
|
+
await common.userInteraction.pressEscape();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe("userInteraction - openValueHelp - by F4 key - use valid valuehelp icon button", function () {
|
|
43
|
+
it("Preparation", async function () {
|
|
44
|
+
await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.valuehelpdialog.ValueHelpDialog/sample/sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp`);
|
|
45
|
+
await handleCookiesConsent();
|
|
46
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("Execution", async function () {
|
|
50
|
+
await ui5.userInteraction.openValueHelp(valueHelpSelector, 0, undefined, true);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("Verification", async function () {
|
|
54
|
+
await ui5.assertion.expectToBeVisible(valueHelpDialogTitle);
|
|
55
|
+
await common.userInteraction.pressEscape();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe("userInteraction - openValueHelp - use datepicker icon button (unhappy case)", function () {
|
|
60
|
+
it("Preparation", async function () {
|
|
61
|
+
await common.navigation.navigateToUrl(`${BASE_URL}/#/entity/sap.ui.comp.valuehelpdialog.ValueHelpDialog/sample/sap.ui.comp.sample.smartfield.SmartFieldWithValueHelp`);
|
|
62
|
+
await handleCookiesConsent();
|
|
63
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("Execution && Verification", async function () {
|
|
67
|
+
await expect(ui5.userInteraction.openValueHelp(datePickerSelector, 0, 3_000))
|
|
68
|
+
.rejects.toThrowError(/Element with CSS .* not found./);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -25,6 +25,7 @@ exports.config = merge(profile.config, {
|
|
|
25
25
|
path.resolve(__dirname, "fill.spec.js"),
|
|
26
26
|
path.resolve(__dirname, "fillAndRetry.spec.js"),
|
|
27
27
|
path.resolve(__dirname, "openF4Help.spec.js"),
|
|
28
|
+
path.resolve(__dirname, "openValueHelp.spec.js"),
|
|
28
29
|
path.resolve(__dirname, "searchFor.spec.js"),
|
|
29
30
|
path.resolve(__dirname, "scrollToElement.spec.js"),
|
|
30
31
|
path.resolve(__dirname, "selectBox.spec.js"),
|