@sap_oss/wdio-qmate-service 2.3.0 → 2.4.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.
Files changed (36) hide show
  1. package/docs/doc.md +41 -35
  2. package/docs/sections/features/config.md +2 -2
  3. package/lib/index.js +1 -2
  4. package/lib/index.js.map +1 -1
  5. package/lib/reuse/helper/clientsideUI5scripts.js +1 -0
  6. package/lib/reuse/helper/clientsideUI5scripts.js.map +1 -1
  7. package/lib/reuse/modules/nonUi5/element.d.ts +0 -19
  8. package/lib/reuse/modules/nonUi5/element.js +0 -26
  9. package/lib/reuse/modules/nonUi5/element.js.map +1 -1
  10. package/lib/reuse/modules/service/odata.js +4 -4
  11. package/lib/reuse/modules/service/odata.js.map +1 -1
  12. package/lib/reuse/modules/ui5/userInteraction.js +2 -2
  13. package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
  14. package/lib/reuse/modules/util/file.d.ts +30 -2
  15. package/lib/reuse/modules/util/file.js +146 -4
  16. package/lib/reuse/modules/util/file.js.map +1 -1
  17. package/lib/scripts/clientsideUI5scripts.js +1 -0
  18. package/lib/scripts/clientsideUI5scripts.js.map +1 -1
  19. package/lib/scripts/locators/qmateLocator.js +1 -0
  20. package/lib/scripts/locators/qmateLocator.js.map +1 -1
  21. package/lib/scripts/locators/uiveri5Locator.js +1 -0
  22. package/lib/scripts/locators/uiveri5Locator.js.map +1 -1
  23. package/package.json +14 -7
  24. package/test/core/dataExchange/specs/importExport.spec.js +1 -1
  25. package/test/helper/configurations/base.conf.js +1 -0
  26. package/test/helper/sleeper.js +1 -0
  27. package/test/reuse/nonUi5/userInteraction/clickElementInSvg.spec.js +1 -1
  28. package/test/reuse/service/rest/rest-server.js +1 -0
  29. package/test/reuse/ui5/mockserver_qunit/localService/mockserver.js +1 -1
  30. package/test/reuse/ui5/mockserver_qunit/localService/mockserverLoadAllData.js +1 -0
  31. package/test/reuse/util/browser/getUI5Version.spec.js +1 -0
  32. package/test/reuse/util/file/findFilePathRecursively.spec.js +14 -0
  33. package/test/reuse/util/file/getExcelData.spec.js +78 -0
  34. package/test/reuse/util/file/test.file.conf.js +6 -4
  35. package/test/reuse/util/file/testFiles/test.xls +0 -0
  36. package/test/reuse/util/file/testFiles/test1.xlsx +0 -0
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  "use strict";
2
3
 
3
4
  describe("browser - getUI5Version", function () {
@@ -0,0 +1,14 @@
1
+ const path = require("path");
2
+
3
+ describe("file - findFilePathRecursively - test the absolute file path for xls", function () {
4
+ let value;
5
+
6
+ it("Execution", async function () {
7
+ const xlsPath = path.resolve(__dirname, "./testFiles");
8
+ value = await util.file.findFilePathRecursively(xlsPath, "test.xls");
9
+ });
10
+
11
+ it("Verification", async function () {
12
+ common.assertion.expectTrue(value.includes("test.xls"));
13
+ });
14
+ });
@@ -0,0 +1,78 @@
1
+ const path = require("path");
2
+
3
+ describe("file - getExcelData - Retrieve xls file data", function () {
4
+ let value;
5
+
6
+ it("Execution", async function () {
7
+ const xlsPath = path.resolve(__dirname, "./testFiles");
8
+ value = await util.file.getExcelData(xlsPath, "test.xls", 1);
9
+ });
10
+
11
+ it("Verification", async function () {
12
+ const valueExp = [{ Number: "1.1", Name: "MAT7_XBOX_SHORT_7_019", Supplier: "BigBox Retail", "Price (USD)\n5/1/2023 - 5/31/2023": "111.0", "Price (USD)\n6/1/2023 - 6/30/2023": "111.0", "Lead Time": "96 Hr", "Manufacturer Name": "", "Manufacturer Part Id": "", "Supplier Part Id": "V00433" }];
13
+ common.assertion.expectEqual(value, valueExp);
14
+ });
15
+ });
16
+
17
+ describe("file - getExcelData - Retrieve xlsx file data", function () {
18
+ let value;
19
+
20
+ it("Execution", async function () {
21
+ const xlsxPath = path.resolve(__dirname, "./testFiles");
22
+ value = await util.file.getExcelData(xlsxPath, "test1.xlsx", 1);
23
+ });
24
+
25
+ it("Verification", async function () {
26
+ const valueExp = [{ Number: "1.1", Name: "MAT7_XBOX_SHORT_7_019", Supplier: "BigBox Retail", "Price (USD)\n5/1/2023 - 5/31/2023": "111.0", "Price (USD)\n6/1/2023 - 6/30/2023": "111.0", "Lead Time": "96 Hr", "Manufacturer Name": "", "Manufacturer Part Id": "", "Supplier Part Id": "V00433" }];
27
+ common.assertion.expectEqual(value, valueExp);
28
+ });
29
+ });
30
+
31
+ describe("file - getExcelData - test xls to csv file data", function () {
32
+ let value;
33
+
34
+ it("Execution", async function () {
35
+ const xlsxPath = path.resolve(__dirname, "./testFiles");
36
+ value = await util.file.getExcelData(xlsxPath, "test.xls", 1, "csv");
37
+ });
38
+
39
+ it("Verification", async function () {
40
+ const valueExp = `Number,Name,Supplier,"Price (USD)
41
+ 5/1/2023 - 5/31/2023","Price (USD)
42
+ 6/1/2023 - 6/30/2023",Incoterms,Lead Time,Manufacturer Name,Manufacturer Part Id,Supplier Part Id
43
+ 1.1,MAT7_XBOX_SHORT_7_019,BigBox Retail,111.0,111.0,,96 Hr,,,V00433`;
44
+ common.assertion.expectEqual(value, valueExp);
45
+ });
46
+ });
47
+
48
+ describe("file - getExcelData - test xls to txt file data", function () {
49
+ let value;
50
+
51
+ it("Execution", async function () {
52
+ const xlsxPath = path.resolve(__dirname, "./testFiles");
53
+ value = await util.file.getExcelData(xlsxPath, "test.xls", 1, "txt");
54
+ });
55
+
56
+ it("Verification", async function () {
57
+ value = value.replace(/[\n\"]/g, "");
58
+ common.assertion.expectTrue(value.length > 0);
59
+ });
60
+ });
61
+
62
+ describe("file - getExcelData - error case for in correct sheet index", function () {
63
+ it("Execution & Verification", async function () {
64
+ const xlsPath = path.resolve(__dirname, "./testFiles");
65
+ await expect(async () => {
66
+ await util.file.getExcelData(xlsPath, "test.xls", 2);
67
+ }).rejects.toThrow("The specified sheet index '2' is invalid for the Excel file.");
68
+ });
69
+ });
70
+
71
+ describe("file - getExcelData - error case for in wrong file", function () {
72
+ it("Execution & Verification", async function () {
73
+ const xlsPath = path.resolve(__dirname, "./testFiles");
74
+ await expect(async () => {
75
+ await util.file.getExcelData(xlsPath, "test.txt");
76
+ }).rejects.toThrow("The specified file 'test.txt' doesn't exist in the directory:");
77
+ });
78
+ });
@@ -6,10 +6,12 @@ exports.config = merge(profile.config, {
6
6
  maxInstances: 6,
7
7
  specFileRetries: 2,
8
8
 
9
- baseUrl: "https://sapui5.hana.ondemand.com/1.99.0/#/entity/sap.m.UploadCollection/sample/sap.m.sample.UploadCollection",
9
+ baseUrl: "https://sapui5.hana.ondemand.com/1.99.0/#/entity/sap.m.UploadCollection/sample/sap.m.sample.UploadCollection",
10
10
 
11
11
  specs: [
12
- path.resolve(__dirname, "file.spec.js"),
13
- path.resolve(__dirname, "pdfParser.spec.js")
12
+ path.resolve(__dirname, "file.spec.js"),
13
+ path.resolve(__dirname, "pdfParser.spec.js"),
14
+ path.resolve(__dirname, "getExcelData.spec.js"),
15
+ path.resolve(__dirname, "findFilePathRecursively.spec.js")
14
16
  ]
15
- });
17
+ });