@sap_oss/wdio-qmate-service 2.16.3 → 2.18.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/lib/reuse/helper/errorHandler.js.map +1 -1
- package/lib/reuse/modules/nonUi5/assertion.d.ts +10 -0
- package/lib/reuse/modules/nonUi5/assertion.js +15 -0
- package/lib/reuse/modules/nonUi5/assertion.js.map +1 -1
- package/lib/reuse/modules/nonUi5/element.d.ts +10 -0
- package/lib/reuse/modules/nonUi5/element.js +13 -0
- package/lib/reuse/modules/nonUi5/element.js.map +1 -1
- package/lib/reuse/modules/ui5/navigationBar.js +12 -7
- package/lib/reuse/modules/ui5/navigationBar.js.map +1 -1
- package/lib/reuse/modules/ui5/table.d.ts +184 -7
- package/lib/reuse/modules/ui5/table.js +471 -43
- package/lib/reuse/modules/ui5/table.js.map +1 -1
- package/lib/reuse/modules/ui5/types/ui5.types.d.ts +20 -10
- package/lib/reuse/modules/util/browser.d.ts +2 -2
- package/lib/reuse/modules/util/browser.js +3 -3
- package/lib/reuse/modules/util/browser.js.map +1 -1
- package/package.json +1 -1
- package/test/helper/configurations/base.conf.js +1 -0
- package/test/reuse/nonUi5/assertion/expectTextToBe.spec.js +63 -0
- package/test/reuse/nonUi5/assertion/test.assertion.conf.js +2 -1
- package/test/reuse/nonUi5/element/isEnabled.spec.js +49 -0
- package/test/reuse/nonUi5/element/test.element.conf.js +1 -0
- package/test/reuse/ui5/navigationBar/clickSapLogo.spec.js +27 -0
- package/test/reuse/ui5/navigationBar/test.navigationBar.conf.js +2 -1
- package/test/reuse/ui5/table/deselectAllRows.spec.js +71 -0
- package/test/reuse/ui5/table/deselectRowByIndex.spec.js +86 -0
- package/test/reuse/ui5/table/getSelectorForRowByIndex.spec.js +78 -0
- package/test/reuse/ui5/table/getSelectorsForRowsByValues.spec.js +152 -0
- package/test/reuse/ui5/table/getTotalNumberOfRows.spec.js +144 -0
- package/test/reuse/ui5/table/getTotalNumberOfRowsByValues.spec.js +115 -0
- package/test/reuse/ui5/table/openItemByIndex.spec.js +84 -0
- package/test/reuse/ui5/table/openItemByValues.spec.js +102 -0
- package/test/reuse/ui5/table/selectAllRows.spec.js +64 -0
- package/test/reuse/ui5/table/selectRowByIndex.spec.js +89 -0
- package/test/reuse/ui5/table/test.table.conf.js +12 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { handleCookiesConsent } = require("../../../helper/utils");
|
|
3
|
+
|
|
4
|
+
let rowSelectors;
|
|
5
|
+
const tableSelector = {
|
|
6
|
+
elementProperties: {
|
|
7
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
8
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
9
|
+
id: "__table0"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe("table - getSelectorsForRowsByValues - smartTable - single value as a String", function () {
|
|
14
|
+
it("Preparation", async function () {
|
|
15
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
16
|
+
await handleCookiesConsent();
|
|
17
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("Execution", async function () {
|
|
21
|
+
const customerNameValue = "HäuHoh Huch GmbH";
|
|
22
|
+
rowSelectors = await ui5.table.getSelectorsForRowsByValues(tableSelector, customerNameValue);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("Verification", async function () {
|
|
26
|
+
const selector = {
|
|
27
|
+
elementProperties: {
|
|
28
|
+
metadata: "sap.ui.comp.navpopover.SmartLink",
|
|
29
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
30
|
+
text: [
|
|
31
|
+
{
|
|
32
|
+
model: "",
|
|
33
|
+
path: "Kunnr",
|
|
34
|
+
value: "HAEU03D",
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
model: "",
|
|
39
|
+
path: "Name1",
|
|
40
|
+
value: "HäuHoh Huch GmbH",
|
|
41
|
+
type: "string"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
ancestorProperties: rowSelectors[0].elementProperties
|
|
46
|
+
};
|
|
47
|
+
await expect(ui5.element.getDisplayed(selector)).resolves.not.toThrow();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("table - getSelectorsForRowsByValues - smartTable - single value as an Array", function () {
|
|
52
|
+
// it("Preparation", async function () {
|
|
53
|
+
// await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
54
|
+
// await handleCookiesConsent();
|
|
55
|
+
// await util.browser.switchToIframe("[id='sampleFrame']");
|
|
56
|
+
// });
|
|
57
|
+
|
|
58
|
+
it("Execution", async function () {
|
|
59
|
+
const customerNameValue = ["ToMa SE"];
|
|
60
|
+
rowSelectors = await ui5.table.getSelectorsForRowsByValues(tableSelector, customerNameValue);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("Verification", async function () {
|
|
64
|
+
const selector = {
|
|
65
|
+
elementProperties: {
|
|
66
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
67
|
+
metadata: "sap.ui.comp.navpopover.SmartLink",
|
|
68
|
+
text: [
|
|
69
|
+
{
|
|
70
|
+
model: "",
|
|
71
|
+
path: "Kunnr",
|
|
72
|
+
value: "EMPLOYEE1",
|
|
73
|
+
type: "string"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
model: "",
|
|
77
|
+
path: "Name1",
|
|
78
|
+
value: "ToMa SE",
|
|
79
|
+
type: "string"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
ancestorProperties: rowSelectors[0].elementProperties
|
|
84
|
+
};
|
|
85
|
+
await expect(ui5.element.getDisplayed(selector)).resolves.not.toThrow();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe("table - getSelectorsForRowsByValues - smartTable - multiple values as an Array, receiving multiple columns", function () {
|
|
90
|
+
// it("Preparation", async function () {
|
|
91
|
+
// await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
92
|
+
// await handleCookiesConsent();
|
|
93
|
+
// await util.browser.switchToIframe("[id='sampleFrame']");
|
|
94
|
+
// });
|
|
95
|
+
|
|
96
|
+
it("Execution", async function () {
|
|
97
|
+
const customerNameValue = ["Elena KG"];
|
|
98
|
+
rowSelectors = await ui5.table.getSelectorsForRowsByValues(tableSelector, customerNameValue);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("Verification", async function () {
|
|
102
|
+
const selector1 = {
|
|
103
|
+
elementProperties: {
|
|
104
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
105
|
+
metadata: "sap.m.Text",
|
|
106
|
+
text: [
|
|
107
|
+
{
|
|
108
|
+
model: "",
|
|
109
|
+
path: "Dmbtr",
|
|
110
|
+
value: "-1500.00",
|
|
111
|
+
type: "string"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
ancestorProperties: rowSelectors[0].elementProperties
|
|
116
|
+
};
|
|
117
|
+
const selector2 = {
|
|
118
|
+
elementProperties: {
|
|
119
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
120
|
+
metadata: "sap.m.Text",
|
|
121
|
+
text: [
|
|
122
|
+
{
|
|
123
|
+
model: "",
|
|
124
|
+
path: "Dmbtr",
|
|
125
|
+
value: "0.00",
|
|
126
|
+
type: "string"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
ancestorProperties: rowSelectors[1].elementProperties
|
|
131
|
+
};
|
|
132
|
+
await expect(ui5.element.getDisplayed(selector1)).resolves.not.toThrow();
|
|
133
|
+
await expect(ui5.element.getDisplayed(selector2)).resolves.not.toThrow();
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe("table - getSelectorsForRowsByValues - smartTable - unhappy case - multiple values as an array, receiving no row (empty array)", function () {
|
|
138
|
+
// it("Preparation", async function () {
|
|
139
|
+
// await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
140
|
+
// await handleCookiesConsent();
|
|
141
|
+
// await util.browser.switchToIframe("[id='sampleFrame']");
|
|
142
|
+
// });
|
|
143
|
+
|
|
144
|
+
it("Execution", async function () {
|
|
145
|
+
const customerNameValue = ["Elena KG", "abcdef"];
|
|
146
|
+
rowSelectors = await ui5.table.getSelectorsForRowsByValues(tableSelector, customerNameValue);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("Verification", async function () {
|
|
150
|
+
common.assertion.expectEqual(rowSelectors.length, 0);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { handleCookiesConsent } = require("../../../helper/utils");
|
|
3
|
+
|
|
4
|
+
describe("table - getTotalNumberOfRows - demo kit - passing SmartTable", function () {
|
|
5
|
+
let actNumberOfTableRows;
|
|
6
|
+
|
|
7
|
+
it("Preparation", async function () {
|
|
8
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable");
|
|
9
|
+
await handleCookiesConsent();
|
|
10
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("Execution", async function () {
|
|
14
|
+
const selector = {
|
|
15
|
+
elementProperties: {
|
|
16
|
+
viewName: "sap.ui.comp.sample.smarttable.SmartTable",
|
|
17
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
18
|
+
id: "__xmlview0--LineItemsSmartTable"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
await ui5.element.waitForAll(selector);
|
|
22
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRows(selector);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("Verification", async function () {
|
|
26
|
+
const expNumberOfTableRows = 54;
|
|
27
|
+
common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("table - getTotalNumberOfRows - demo kit - passing ID", function () {
|
|
32
|
+
let actNumberOfTableRows;
|
|
33
|
+
|
|
34
|
+
it("Preparation", async function () {
|
|
35
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable");
|
|
36
|
+
await handleCookiesConsent();
|
|
37
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("Execution", async function () {
|
|
41
|
+
const tableId = "__xmlview0--LineItemsSmartTable";
|
|
42
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRows(tableId);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("Verification", async function () {
|
|
46
|
+
const expNumberOfTableRows = 54;
|
|
47
|
+
common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("table - getTotalNumberOfRows - demo kit - 0 rows", function () {
|
|
52
|
+
let actNumberOfTableRows;
|
|
53
|
+
|
|
54
|
+
it("Preparation", async function () {
|
|
55
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable");
|
|
56
|
+
await handleCookiesConsent();
|
|
57
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
58
|
+
const selector = {
|
|
59
|
+
elementProperties: {
|
|
60
|
+
viewName: "sap.ui.comp.sample.smarttable.SmartTable",
|
|
61
|
+
metadata: "sap.ui.comp.smartfilterbar.SFBMultiInput",
|
|
62
|
+
value: [
|
|
63
|
+
{
|
|
64
|
+
path: "fi1t3rM0d31>/Gjahr/value"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const invalidFiscalYear = "2000";
|
|
70
|
+
await ui5.userInteraction.clearAndFill(selector, invalidFiscalYear);
|
|
71
|
+
common.userInteraction.pressEnter();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("Execution", async function () {
|
|
75
|
+
const selector = {
|
|
76
|
+
elementProperties: {
|
|
77
|
+
viewName: "sap.ui.comp.sample.smarttable.SmartTable",
|
|
78
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
79
|
+
id: "__xmlview0--LineItemsSmartTable"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
await ui5.element.waitForAll(selector);
|
|
83
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRows(selector);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("Verification", async function () {
|
|
87
|
+
const expNumberOfTableRows = 0;
|
|
88
|
+
common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Only for local testing -> Replace the placeholder with the correct URL, password and user name
|
|
93
|
+
|
|
94
|
+
// describe("table - getTotalNumberOfRows - productive app - passing SmartTable", function () {
|
|
95
|
+
// let actNumberOfTableRows;
|
|
96
|
+
|
|
97
|
+
// it("Preparation", async function () {
|
|
98
|
+
// await common.navigation.navigateToUrl("<system_url>/ui#ReportingTask-run&/?sap-iapp-state=ASQ7LUYSPNTEJR8D5BOKD7T4DNSJVXBD4GKZLB0Z");
|
|
99
|
+
// await ui5.session.login("<user>", "<password>");
|
|
100
|
+
// });
|
|
101
|
+
|
|
102
|
+
// it("Execution", async function () {
|
|
103
|
+
// const selector = {
|
|
104
|
+
// elementProperties: {
|
|
105
|
+
// viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
106
|
+
// metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
107
|
+
// id: "application-ReportingTask-run-component---ReportList--ReportingTable"
|
|
108
|
+
// }
|
|
109
|
+
// };
|
|
110
|
+
// await ui5.element.waitForAll(selector);
|
|
111
|
+
// actNumberOfTableRows = await ui5.table.getTotalNumberOfRows(selector);
|
|
112
|
+
// });
|
|
113
|
+
|
|
114
|
+
// it("Verification", async function () {
|
|
115
|
+
// const expNumberOfTableRows = 5;
|
|
116
|
+
// common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
117
|
+
// });
|
|
118
|
+
// });
|
|
119
|
+
|
|
120
|
+
// describe("table - getTotalNumberOfRows - productive app - passing Table", function () {
|
|
121
|
+
// let actNumberOfTableRows;
|
|
122
|
+
|
|
123
|
+
// it("Preparation", async function () {
|
|
124
|
+
// await common.navigation.navigateToUrl("<system_url>/ui#ReportingTask-run&/?sap-iapp-state=ASQ7LUYSPNTEJR8D5BOKD7T4DNSJVXBD4GKZLB0Z");
|
|
125
|
+
// await ui5.session.login("<user>", "<password>");
|
|
126
|
+
// });
|
|
127
|
+
|
|
128
|
+
// it("Execution", async function () {
|
|
129
|
+
// const selector = {
|
|
130
|
+
// elementProperties: {
|
|
131
|
+
// viewName: "gs.fin.runstatutoryreports.s1.view.ReportList",
|
|
132
|
+
// metadata: "sap.m.Table",
|
|
133
|
+
// id: "application-ReportingTask-run-component---ReportList--reportingTable"
|
|
134
|
+
// }
|
|
135
|
+
// };
|
|
136
|
+
// await ui5.element.waitForAll(selector);
|
|
137
|
+
// actNumberOfTableRows = await ui5.table.getTotalNumberOfRows(selector);
|
|
138
|
+
// });
|
|
139
|
+
|
|
140
|
+
// it("Verification", async function () {
|
|
141
|
+
// const expNumberOfTableRows = 5;
|
|
142
|
+
// common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
143
|
+
// });
|
|
144
|
+
// });
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { handleCookiesConsent } = require("../../../helper/utils");
|
|
3
|
+
|
|
4
|
+
describe("table - getTotalNumberOfRowsByValues - demo kit smartTable - 1 match", function () {
|
|
5
|
+
let actNumberOfTableRows;
|
|
6
|
+
|
|
7
|
+
it("Preparation", async function () {
|
|
8
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
9
|
+
await handleCookiesConsent();
|
|
10
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("Execution", async function () {
|
|
14
|
+
const selector = {
|
|
15
|
+
elementProperties: {
|
|
16
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
17
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
18
|
+
id: "__table0"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
await ui5.element.waitForAll(selector);
|
|
22
|
+
const value = "Metzgerei Mettmann";
|
|
23
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRowsByValues(selector, value);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("Verification", async function () {
|
|
27
|
+
const expNumberOfTableRows = 1;
|
|
28
|
+
await common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe("table - getTotalNumberOfRowsByValues - 2 matches", function () {
|
|
33
|
+
let actNumberOfTableRows;
|
|
34
|
+
|
|
35
|
+
it("Preparation", async function () {
|
|
36
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
37
|
+
await handleCookiesConsent();
|
|
38
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("Execution", async function () {
|
|
42
|
+
const selector = {
|
|
43
|
+
elementProperties: {
|
|
44
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
45
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
46
|
+
id: "__table0"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
await ui5.element.waitForAll(selector);
|
|
50
|
+
const value = "Elena KG";
|
|
51
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRowsByValues(selector, value);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("Verification", async function () {
|
|
55
|
+
const expNumberOfTableRows = 2;
|
|
56
|
+
await common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe("table - getTotalNumberOfRowsByValues - 1 match by two values", function () {
|
|
61
|
+
|
|
62
|
+
let actNumberOfTableRows;
|
|
63
|
+
|
|
64
|
+
it("Preparation", async function () {
|
|
65
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
66
|
+
await handleCookiesConsent();
|
|
67
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("Execution", async function () {
|
|
71
|
+
const selector = {
|
|
72
|
+
elementProperties: {
|
|
73
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
74
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
75
|
+
id: "__table0"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
await ui5.element.waitForAll(selector);
|
|
79
|
+
const values = ["Example Corp.", "16.68"];
|
|
80
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRowsByValues(selector, values);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("Verification", async function () {
|
|
84
|
+
const expNumberOfTableRows = 1;
|
|
85
|
+
await common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe("table - getTotalNumberOfRowsByValues - unhappy case- 0 matches", function () {
|
|
90
|
+
let actNumberOfTableRows;
|
|
91
|
+
|
|
92
|
+
it("Preparation", async function () {
|
|
93
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.smarttable.SmartTable/sample/sap.ui.comp.sample.smarttable.mtable");
|
|
94
|
+
await handleCookiesConsent();
|
|
95
|
+
await util.browser.switchToIframe("[id='sampleFrame']");
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("Execution", async function () {
|
|
99
|
+
const selector = {
|
|
100
|
+
elementProperties: {
|
|
101
|
+
viewName: "sap.ui.comp.sample.smarttable.mtable.SmartTable",
|
|
102
|
+
metadata: "sap.ui.comp.smarttable.SmartTable",
|
|
103
|
+
id: "__table0"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
await ui5.element.waitForAll(selector);
|
|
107
|
+
const value = "abcdefghijklmnop";
|
|
108
|
+
actNumberOfTableRows = await ui5.table.getTotalNumberOfRowsByValues(selector, value);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("Verification", async function () {
|
|
112
|
+
const expNumberOfTableRows = 0;
|
|
113
|
+
await common.assertion.expectEqual(actNumberOfTableRows, expNumberOfTableRows);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const smartTableSelector = {
|
|
3
|
+
"elementProperties": {
|
|
4
|
+
"viewName": "sap.suite.ui.generic.template.ListReport.view.ListReport",
|
|
5
|
+
"metadata": "sap.ui.comp.smarttable.SmartTable",
|
|
6
|
+
"id": "*listReport-1"
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const goButtonSelector = {
|
|
10
|
+
"elementProperties": {
|
|
11
|
+
"viewName": "sap.suite.ui.generic.template.ListReport.view.ListReport",
|
|
12
|
+
"metadata": "sap.m.Button",
|
|
13
|
+
"id": "*listReportFilter-btnGo"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe("table - openItemByIndex - smartTable - open first item", function () {
|
|
18
|
+
|
|
19
|
+
it("Preparation", async function () {
|
|
20
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
21
|
+
await common.navigation.navigateToUrl(url);
|
|
22
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("Execution", async function () {
|
|
26
|
+
await ui5.table.openItemByIndex(smartTableSelector, 0);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("Verification", async function () {
|
|
30
|
+
const pageTitle = "500000001";
|
|
31
|
+
const selector = {
|
|
32
|
+
|
|
33
|
+
"elementProperties": {
|
|
34
|
+
"viewName": "sap.suite.ui.generic.template.ObjectPage.view.Details",
|
|
35
|
+
"metadata": "sap.uxap.ObjectPageHeader",
|
|
36
|
+
"id": "*objectPageHeader"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const objectTitleValue = await ui5.element.getPropertyValue(selector, "objectTitle");
|
|
40
|
+
expect(objectTitleValue).toEqual(pageTitle);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe("table - openItemByIndex - smartTable - open third item", function () {
|
|
45
|
+
|
|
46
|
+
it("Preparation", async function () {
|
|
47
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
48
|
+
await common.navigation.navigateToUrl(url);
|
|
49
|
+
await util.browser.refresh();
|
|
50
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("Execution", async function () {
|
|
54
|
+
await ui5.table.openItemByIndex(smartTableSelector, 2);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("Verification", async function () {
|
|
58
|
+
const pageTitle = "500000007";
|
|
59
|
+
const selector = {
|
|
60
|
+
|
|
61
|
+
"elementProperties": {
|
|
62
|
+
"viewName": "sap.suite.ui.generic.template.ObjectPage.view.Details",
|
|
63
|
+
"metadata": "sap.uxap.ObjectPageHeader",
|
|
64
|
+
"id": "*objectPageHeader"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const objectTitleValue = await ui5.element.getPropertyValue(selector, "objectTitle");
|
|
68
|
+
expect(objectTitleValue).toEqual(pageTitle);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
describe("table - openItemByIndex - smartTable - unhappy case - try to open not existing item", function () {
|
|
73
|
+
|
|
74
|
+
it("Preparation", async function () {
|
|
75
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
76
|
+
await common.navigation.navigateToUrl(url);
|
|
77
|
+
await util.browser.refresh();
|
|
78
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("Execution & Verification", async function () {
|
|
82
|
+
await expect(ui5.table.openItemByIndex(smartTableSelector, 10)).rejects.toThrow(/No item found with index 10/);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const smartTableSelector = {
|
|
3
|
+
"elementProperties": {
|
|
4
|
+
"viewName": "sap.suite.ui.generic.template.ListReport.view.ListReport",
|
|
5
|
+
"metadata": "sap.ui.comp.smarttable.SmartTable",
|
|
6
|
+
"id": "*listReport-1"
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const goButtonSelector = {
|
|
10
|
+
"elementProperties": {
|
|
11
|
+
"viewName": "sap.suite.ui.generic.template.ListReport.view.ListReport",
|
|
12
|
+
"metadata": "sap.m.Button",
|
|
13
|
+
"id": "*listReportFilter-btnGo"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe("table - openItemByValues - smartTable - single value as a String", function () {
|
|
18
|
+
|
|
19
|
+
it("Preparation", async function () {
|
|
20
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
21
|
+
await common.navigation.navigateToUrl(url);
|
|
22
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("Execution", async function () {
|
|
26
|
+
await ui5.table.openItemByValues(smartTableSelector, "500000001");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("Verification", async function () {
|
|
30
|
+
const pageTitle = "500000001";
|
|
31
|
+
const selector = {
|
|
32
|
+
|
|
33
|
+
"elementProperties": {
|
|
34
|
+
"viewName": "sap.suite.ui.generic.template.ObjectPage.view.Details",
|
|
35
|
+
"metadata": "sap.uxap.ObjectPageHeader",
|
|
36
|
+
"id": "*objectPageHeader"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const objectTitleValue = await ui5.element.getPropertyValue(selector, "objectTitle");
|
|
40
|
+
expect(objectTitleValue).toEqual(pageTitle);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe("table - openItemByValues - smartTable - single value as an Array - 3 matches - open first one", function () {
|
|
45
|
+
|
|
46
|
+
it("Preparation", async function () {
|
|
47
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
48
|
+
await common.navigation.navigateToUrl(url);
|
|
49
|
+
await util.browser.refresh();
|
|
50
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("Execution - 3 matches - should open first one", async function () {
|
|
54
|
+
await ui5.table.openItemByValues(smartTableSelector, ["HT-1003"]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("Verification", async function () {
|
|
58
|
+
const pageTitle = "500000001";
|
|
59
|
+
const selector = {
|
|
60
|
+
|
|
61
|
+
"elementProperties": {
|
|
62
|
+
"viewName": "sap.suite.ui.generic.template.ObjectPage.view.Details",
|
|
63
|
+
"metadata": "sap.uxap.ObjectPageHeader",
|
|
64
|
+
"id": "*objectPageHeader"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const objectTitleValue = await ui5.element.getPropertyValue(selector, "objectTitle");
|
|
68
|
+
expect(objectTitleValue).toEqual(pageTitle);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("table - openItemByValues - smartTable - multiple values as an Array - one match", function () {
|
|
75
|
+
|
|
76
|
+
it("Preparation", async function () {
|
|
77
|
+
const url = "https://sapui5.hana.ondemand.com/test-resources/sap/suite/ui/generic/template/demokit/demokit.html?responderOn=true&demoApp=sttasalesordertt#";
|
|
78
|
+
await common.navigation.navigateToUrl(url);
|
|
79
|
+
await util.browser.refresh();
|
|
80
|
+
await ui5.userInteraction.click(goButtonSelector);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("Execution - 3 matches - should open first one", async function () {
|
|
84
|
+
await ui5.table.openItemByValues(smartTableSelector, ["HT-1003", "100000008"]);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("Verification", async function () {
|
|
88
|
+
const pageTitle = "500000007";
|
|
89
|
+
const selector = {
|
|
90
|
+
|
|
91
|
+
"elementProperties": {
|
|
92
|
+
"viewName": "sap.suite.ui.generic.template.ObjectPage.view.Details",
|
|
93
|
+
"metadata": "sap.uxap.ObjectPageHeader",
|
|
94
|
+
"id": "*objectPageHeader"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const objectTitleValue = await ui5.element.getPropertyValue(selector, "objectTitle");
|
|
98
|
+
expect(objectTitleValue).toEqual(pageTitle);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const tableSelector = {
|
|
4
|
+
elementProperties: {
|
|
5
|
+
viewName: "mycompany.myapp.MyWorklistApp.view.Worklist",
|
|
6
|
+
metadata: "sap.m.Table",
|
|
7
|
+
id: "container-MyWorklistApp---worklist--table"
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const checkBoxSelector = {
|
|
12
|
+
elementProperties: {
|
|
13
|
+
viewName: "mycompany.myapp.MyWorklistApp.view.Worklist",
|
|
14
|
+
metadata: "sap.m.CheckBox",
|
|
15
|
+
id: "*table-sa"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe("table - selectAllRows - demo kit - passing selector", function () {
|
|
20
|
+
it("Preparation", async function () {
|
|
21
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("Execution", async function () {
|
|
25
|
+
await ui5.table.selectAllRows(tableSelector);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("Verification", async function () {
|
|
29
|
+
const isSelected = await ui5.element.getPropertyValue(checkBoxSelector, "selected");
|
|
30
|
+
await common.assertion.expectEqual(isSelected, true);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe("table - selectAllRows - demo kit - passing id", function () {
|
|
35
|
+
it("Preparation", async function () {
|
|
36
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("Execution", async function () {
|
|
40
|
+
const tableSelectorId = tableSelector.elementProperties.id;
|
|
41
|
+
await ui5.table.selectAllRows(tableSelectorId);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("Verification", async function () {
|
|
45
|
+
const isSelected = await ui5.element.getPropertyValue(checkBoxSelector, "selected");
|
|
46
|
+
await common.assertion.expectEqual(isSelected, true);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("table - selectAllRows - demo kit - select all checkbox already selected", function () {
|
|
51
|
+
it("Preparation", async function () {
|
|
52
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html?sap-ui-theme=sap_horizon_dark");
|
|
53
|
+
await ui5.table.selectAllRows(tableSelector);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("Execution", async function () {
|
|
57
|
+
await ui5.table.selectAllRows(tableSelector);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("Verification", async function () {
|
|
61
|
+
const isSelected = await ui5.element.getPropertyValue(checkBoxSelector, "selected");
|
|
62
|
+
await common.assertion.expectEqual(isSelected, true);
|
|
63
|
+
});
|
|
64
|
+
});
|