@sap_oss/wdio-qmate-service 2.6.4 → 2.6.5

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 (117) hide show
  1. package/lib/reuse/helper/clientsideUI5scripts.js +2 -1
  2. package/lib/reuse/helper/clientsideUI5scripts.js.map +1 -1
  3. package/lib/reuse/helper/errorHandler.d.ts +5 -5
  4. package/lib/reuse/helper/errorHandler.js +56 -18
  5. package/lib/reuse/helper/errorHandler.js.map +1 -1
  6. package/lib/reuse/helper/errorMessages.d.ts +0 -2
  7. package/lib/reuse/helper/errorMessages.js +3 -9
  8. package/lib/reuse/helper/errorMessages.js.map +1 -1
  9. package/lib/reuse/modules/common/navigation.d.ts +1 -0
  10. package/lib/reuse/modules/common/navigation.js +13 -3
  11. package/lib/reuse/modules/common/navigation.js.map +1 -1
  12. package/lib/reuse/modules/common/userInteraction.d.ts +1 -0
  13. package/lib/reuse/modules/common/userInteraction.js +22 -7
  14. package/lib/reuse/modules/common/userInteraction.js.map +1 -1
  15. package/lib/reuse/modules/nonUi5/element.d.ts +1 -0
  16. package/lib/reuse/modules/nonUi5/element.js +27 -20
  17. package/lib/reuse/modules/nonUi5/element.js.map +1 -1
  18. package/lib/reuse/modules/nonUi5/navigation.d.ts +1 -0
  19. package/lib/reuse/modules/nonUi5/navigation.js +6 -1
  20. package/lib/reuse/modules/nonUi5/navigation.js.map +1 -1
  21. package/lib/reuse/modules/nonUi5/userInteraction.d.ts +2 -1
  22. package/lib/reuse/modules/nonUi5/userInteraction.js +22 -20
  23. package/lib/reuse/modules/nonUi5/userInteraction.js.map +1 -1
  24. package/lib/reuse/{helper → modules}/types.js.map +1 -1
  25. package/lib/reuse/modules/ui5/assertion.d.ts +3 -2
  26. package/lib/reuse/modules/ui5/assertion.js +17 -12
  27. package/lib/reuse/modules/ui5/assertion.js.map +1 -1
  28. package/lib/reuse/modules/ui5/element.d.ts +1 -0
  29. package/lib/reuse/modules/ui5/element.js +21 -15
  30. package/lib/reuse/modules/ui5/element.js.map +1 -1
  31. package/lib/reuse/modules/ui5/navigation.d.ts +1 -0
  32. package/lib/reuse/modules/ui5/navigation.js +13 -7
  33. package/lib/reuse/modules/ui5/navigation.js.map +1 -1
  34. package/lib/reuse/modules/ui5/navigationBar.d.ts +1 -0
  35. package/lib/reuse/modules/ui5/navigationBar.js +10 -5
  36. package/lib/reuse/modules/ui5/navigationBar.js.map +1 -1
  37. package/lib/reuse/modules/ui5/session.d.ts +1 -0
  38. package/lib/reuse/modules/ui5/session.js +18 -13
  39. package/lib/reuse/modules/ui5/session.js.map +1 -1
  40. package/lib/reuse/modules/ui5/userInteraction.d.ts +3 -2
  41. package/lib/reuse/modules/ui5/userInteraction.js +16 -17
  42. package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
  43. package/lib/reuse/modules/util/browser.d.ts +8 -0
  44. package/lib/reuse/modules/util/browser.js +16 -1
  45. package/lib/reuse/modules/util/browser.js.map +1 -1
  46. package/lib/reuse/modules/util/data.d.ts +1 -0
  47. package/lib/reuse/modules/util/data.js +10 -8
  48. package/lib/reuse/modules/util/data.js.map +1 -1
  49. package/lib/reuse/modules/util/file.d.ts +1 -0
  50. package/lib/reuse/modules/util/file.js +14 -12
  51. package/lib/reuse/modules/util/file.js.map +1 -1
  52. package/lib/reuse/modules/util/formatter.d.ts +1 -0
  53. package/lib/reuse/modules/util/formatter.js +14 -7
  54. package/lib/reuse/modules/util/formatter.js.map +1 -1
  55. package/lib/reuse/modules/util/function.d.ts +1 -0
  56. package/lib/reuse/modules/util/function.js +12 -1
  57. package/lib/reuse/modules/util/function.js.map +1 -1
  58. package/package.json +1 -1
  59. package/test/reuse/common/navigation/navigateToUrl.spec.js +3 -8
  60. package/test/reuse/common/navigation/navigateToUrlAndRetry.spec.js +7 -5
  61. package/test/reuse/common/userInteraction/clearAndFillActive.spec.js +29 -32
  62. package/test/reuse/common/userInteraction/clearAndFillActiveAndRetry.spec.js +31 -33
  63. package/test/reuse/common/userInteraction/fillActive.spec.js +30 -38
  64. package/test/reuse/common/userInteraction/fillActiveAndRetry.spec.js +24 -30
  65. package/test/reuse/helper/errorHandler/logException.spec.js +23 -17
  66. package/test/reuse/nonUi5/element/getAllDisplayed.spec.js +2 -2
  67. package/test/reuse/nonUi5/element/getByChild.spec.js +2 -2
  68. package/test/reuse/nonUi5/element/getByCssContainingText.spec.js +8 -25
  69. package/test/reuse/nonUi5/element/getByParent.spec.js +17 -12
  70. package/test/reuse/nonUi5/element/test.element.conf.js +0 -2
  71. package/test/reuse/nonUi5/element/test.element.sauceLabs.conf.js +0 -2
  72. package/test/reuse/nonUi5/userInteraction/clearAndFill.spec.js +1 -1
  73. package/test/reuse/nonUi5/userInteraction/clearAndFillAndRetry.spec.js +3 -1
  74. package/test/reuse/nonUi5/userInteraction/clearAndRetry.spec.js +6 -6
  75. package/test/reuse/nonUi5/userInteraction/click.spec.js +3 -1
  76. package/test/reuse/nonUi5/userInteraction/clickAndRetry.spec.js +7 -3
  77. package/test/reuse/nonUi5/userInteraction/fillAndRetry.spec.js +3 -1
  78. package/test/reuse/ui5/assertion/expectAttributeToContain.spec.js +36 -27
  79. package/test/reuse/ui5/assertion/expectBindingContextPathToBe.spec.js +6 -7
  80. package/test/reuse/ui5/assertion/expectBindingPathToBe.spec.js +5 -5
  81. package/test/reuse/ui5/assertion/expectTextToBe.spec.js +1 -1
  82. package/test/reuse/ui5/assertion/expectToBeEnabled.spec.js +39 -35
  83. package/test/reuse/ui5/assertion/expectToBeNotVisible.spec.js +1 -1
  84. package/test/reuse/ui5/assertion/expectValueToBe.spec.js +1 -1
  85. package/test/reuse/ui5/element/getAllDisplayed.spec.js +28 -29
  86. package/test/reuse/ui5/element/getByText.spec.js +2 -3
  87. package/test/reuse/ui5/element/waitForAll.spec.js +1 -1
  88. package/test/reuse/ui5/navigationBar/clickBack.spec.js +1 -1
  89. package/test/reuse/ui5/navigationBar/clickUserIcon.spec.js +1 -1
  90. package/test/reuse/ui5/navigationBar/expectPageTitle.spec.js +1 -1
  91. package/test/reuse/ui5/navigationBar/expectShellHeader.spec.js +3 -3
  92. package/test/reuse/ui5/session/loginFiori.spec.js +1 -0
  93. package/test/reuse/ui5/userInteraction/clearAndFillAndRetry.spec.js +41 -37
  94. package/test/reuse/ui5/userInteraction/clearAndRetry.spec.js +30 -30
  95. package/test/reuse/ui5/userInteraction/clickAndRetry.spec.js +12 -13
  96. package/test/reuse/ui5/userInteraction/clickSelectArrowAndRetry.spec.js +49 -52
  97. package/test/reuse/ui5/userInteraction/fill.spec.js +1 -1
  98. package/test/reuse/ui5/userInteraction/fillAndRetry.spec.js +21 -23
  99. package/test/reuse/ui5/userInteraction/mouseOverElement.spec.js +21 -25
  100. package/test/reuse/util/browser/back.spec.js +1 -1
  101. package/test/reuse/util/browser/forward.spec.js +33 -0
  102. package/test/reuse/util/browser/switchToIframe.spec.js +1 -1
  103. package/test/reuse/util/browser/switchToNewWindow.spec.js +1 -1
  104. package/test/reuse/util/browser/test.browser.conf.js +4 -3
  105. package/test/reuse/util/component/loadEntryPoint.spec.js +1 -1
  106. package/test/reuse/util/component/storeEntryPoint.spec.js +1 -1
  107. package/test/reuse/util/data/readDataFromFile.spec.js +2 -6
  108. package/test/reuse/util/data/writeDataToFile.spec.js +2 -6
  109. package/test/reuse/util/file/expectTextDataToContain.spec.js +1 -1
  110. package/test/reuse/util/file/getTextData.spec.js +1 -1
  111. package/test/reuse/util/file/getXmlData.spec.js +1 -1
  112. package/test/reuse/util/formatter/extractNumberFromString.spec.js +2 -2
  113. package/test/reuse/util/formatter/sliceStringAfter.spec.js +2 -2
  114. package/test/reuse/util/formatter/sliceStringAt.spec.js +2 -2
  115. package/test/reuse/util/formatter/trimString.spec.js +2 -2
  116. /package/lib/reuse/{helper → modules}/types.d.ts +0 -0
  117. /package/lib/reuse/{helper → modules}/types.js +0 -0
@@ -1,9 +1,6 @@
1
- const {
2
- handleCookiesConsent
3
- } = require("../../../helper/utils");
1
+ const { handleCookiesConsent } = require("../../../helper/utils");
4
2
 
5
3
  describe("userInteraction - fillActiveAndRetry", function () {
6
-
7
4
  let value;
8
5
  let actualValue;
9
6
 
@@ -14,10 +11,10 @@ describe("userInteraction - fillActiveAndRetry", function () {
14
11
 
15
12
  it("Execution", async function () {
16
13
  const selector = {
17
- "elementProperties": {
18
- "viewName": "sap.ui.demo.cart.view.Home",
19
- "metadata": "sap.m.SearchField",
20
- "id": "*searchField"
14
+ elementProperties: {
15
+ viewName: "sap.ui.demo.cart.view.Home",
16
+ metadata: "sap.m.SearchField",
17
+ id: "*searchField"
21
18
  }
22
19
  };
23
20
 
@@ -37,7 +34,6 @@ describe("userInteraction - fillActiveAndRetry", function () {
37
34
  });
38
35
 
39
36
  describe("userInteraction - fillActiveAndRetry - invalid selector", function () {
40
-
41
37
  it("Preparation", async function () {
42
38
  await browser.navigateTo("https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3");
43
39
  await handleCookiesConsent();
@@ -45,19 +41,17 @@ describe("userInteraction - fillActiveAndRetry - invalid selector", function ()
45
41
 
46
42
  it("Execution & Verification", async function () {
47
43
  const selector = {
48
- "elementProperties": {
49
- "viewName": "sap.ui.demo.cart.view.Home",
50
- "metadata": "sap.eld"
44
+ elementProperties: {
45
+ viewName: "sap.ui.demo.cart.view.Home",
46
+ metadata: "sap.eld"
51
47
  }
52
48
  };
53
49
 
54
- await expect(ui5.userInteraction.click(selector))
55
- .rejects.toThrow(/uiControlExecuteLocator\(\): No visible elements found/);
50
+ await expect(ui5.userInteraction.click(selector)).rejects.toThrow(/uiControlExecuteLocator\(\): No visible elements found/);
56
51
  });
57
52
  });
58
53
 
59
54
  describe("userInteraction - fillActiveAndRetry - element with number", function () {
60
-
61
55
  let value;
62
56
  let actualValue;
63
57
 
@@ -68,10 +62,10 @@ describe("userInteraction - fillActiveAndRetry - element with number", function
68
62
 
69
63
  it("Execution", async function () {
70
64
  const selector = {
71
- "elementProperties": {
72
- "viewName": "sap.ui.demo.cart.view.Home",
73
- "metadata": "sap.m.SearchField",
74
- "id": "*searchField"
65
+ elementProperties: {
66
+ viewName: "sap.ui.demo.cart.view.Home",
67
+ metadata: "sap.m.SearchField",
68
+ id: "*searchField"
75
69
  }
76
70
  };
77
71
  value = 12;
@@ -90,7 +84,6 @@ describe("userInteraction - fillActiveAndRetry - element with number", function
90
84
  });
91
85
 
92
86
  describe("userInteraction - fillActiveAndRetry - empty value", function () {
93
-
94
87
  let value;
95
88
 
96
89
  it("Preparation", async function () {
@@ -100,10 +93,10 @@ describe("userInteraction - fillActiveAndRetry - empty value", function () {
100
93
 
101
94
  it("Execution & Verification", async function () {
102
95
  const selector = {
103
- "elementProperties": {
104
- "viewName": "sap.ui.demo.cart.view.Home",
105
- "metadata": "sap.m.SearchField",
106
- "id": "*searchField"
96
+ elementProperties: {
97
+ viewName: "sap.ui.demo.cart.view.Home",
98
+ metadata: "sap.m.SearchField",
99
+ id: "*searchField"
107
100
  }
108
101
  };
109
102
  const index = 0;
@@ -111,12 +104,12 @@ describe("userInteraction - fillActiveAndRetry - empty value", function () {
111
104
  const retries = 1;
112
105
  const interval = 3000;
113
106
  await ui5.userInteraction.click(selector);
114
- await expect(common.userInteraction.fillActiveAndRetry(value))
115
- .rejects.toThrow("Retries done. Failed to execute the function: Error: Function 'fillActive' failed: Please provide a value(datatype - number/string) as argument.");
107
+ await expect(common.userInteraction.fillActiveAndRetry(value)).rejects.toThrow(
108
+ "Function 'fillActiveAndRetry' failed with: Retries done. Failed to execute the function: Please provide a value(datatype - number/string) as argument."
109
+ );
116
110
  });
117
111
  });
118
112
 
119
-
120
113
  describe("userInteraction - fillActiveAndRetry - form field", function () {
121
114
  let element;
122
115
  it("Preparation", async function () {
@@ -158,7 +151,8 @@ describe("userInteraction - fillActiveAndRetry - empty value", function () {
158
151
  it("Execution & Verification", async function () {
159
152
  // Make the form field active
160
153
  await nonUi5.userInteraction.click(element);
161
- await expect(common.userInteraction.fillActiveAndRetry())
162
- .rejects.toThrow("Retries done. Failed to execute the function: Error: Function 'fillActive' failed: Please provide a value(datatype - number/string) as argument.");
154
+ await expect(common.userInteraction.fillActiveAndRetry()).rejects.toThrow(
155
+ "Function 'fillActiveAndRetry' failed with: Retries done. Failed to execute the function: Please provide a value(datatype - number/string) as argument."
156
+ );
163
157
  });
164
- });
158
+ });
@@ -1,49 +1,55 @@
1
1
  "use strict";
2
2
 
3
+ const { assert } = require("chai");
4
+
3
5
  const ErrorHandler = require("../../../../lib/reuse/helper/errorHandler").default;
4
6
 
5
7
  describe("errorHandler - logException - error message without stacktrace", async function () {
6
8
  it("Execution & Verification", async function () {
7
- const errorHandler = new ErrorHandler(false);
9
+ const errorHandler = new ErrorHandler();
8
10
  await expect(async function display() {
9
- errorHandler.logException(new Error("Divide by zero error."));
10
- }).rejects.toThrow("Function 'display' failed with : Divide by zero error.");
11
+ errorHandler.logException(new Error("Divide by zero error."), undefined, false);
12
+ }).rejects.toThrow("Function 'display' failed with: Divide by zero error.");
11
13
  });
12
14
  });
13
15
 
14
- describe("errorHandler - logException - error message with stacktrace by passing constructor value true", async function () {
15
- const errorHandler = new ErrorHandler(true);
16
+ describe("errorHandler - logException - error message with stacktrace by passing stacktrace parameter value true", async function () {
17
+ const errorHandler = new ErrorHandler();
16
18
  it("Execution & Verification", async function () {
17
- await expect(async function display() {
18
- errorHandler.logException(new Error("File not found exception"));
19
- }).rejects.toThrow(/Function 'display' failed with : File not found exception/);
19
+ try {
20
+ (function display() {
21
+ errorHandler.logException(new Error("File not found exception"), undefined, true);
22
+ })();
23
+ } catch (error) {
24
+ assert.isTrue(error.stack.toString().trim().includes(`QmateError: Function 'display' failed with: File not found exception`));
25
+ }
20
26
  });
21
27
  });
22
28
 
23
- describe("errorHandler - logException - error message with stacktrace by default constructor value", async function () {
29
+ describe("errorHandler - logException - error message with stacktrace default value", async function () {
24
30
  const errorHandler = new ErrorHandler();
25
31
  it("Execution & Verification", async function () {
26
32
  await expect(async function display() {
27
33
  errorHandler.logException(new Error("Array index out of bound exception"));
28
- }).rejects.toThrow(/Function 'display' failed with : Array index out of bound exception/);
34
+ }).rejects.toThrow(/Function 'display' failed with: Array index out of bound exception/);
29
35
  });
30
36
  });
31
37
 
32
38
  describe("errorHandler - logException - generic error message", async function () {
33
39
  it("Execution & Verification", async function () {
34
- const errorHandler = new ErrorHandler(false);
40
+ const errorHandler = new ErrorHandler();
35
41
  await expect(async () => {
36
- errorHandler.logException();
37
- }).rejects.toThrow("Failed due to exception in block");
42
+ errorHandler.logException(undefined, undefined, false);
43
+ }).rejects.toThrow("Failed due to an exception in the code block");
38
44
  });
39
45
  });
40
46
 
41
47
  describe("errorHandler - logException - Without message", async function () {
42
48
  it("Execution & Verification", async function () {
43
- const errorHandler = new ErrorHandler(false);
49
+ const errorHandler = new ErrorHandler();
44
50
  await expect(async function display() {
45
- errorHandler.logException(new Error());
46
- }).rejects.toThrow("Function 'display' failed with unknown error");
51
+ errorHandler.logException(new Error(), undefined, false);
52
+ }).rejects.toThrow("Function 'display' failed with: unknown error");
47
53
  });
48
54
  });
49
55
 
@@ -52,6 +58,6 @@ describe("errorHandler - logException - customized error message with stacktrace
52
58
  it("Execution & Verification", async function () {
53
59
  await expect(async function display() {
54
60
  errorHandler.logException(new Error(), "File not found in given path please pass the correct path");
55
- }).rejects.toThrow(/Function 'display' failed with : File not found in given path please pass the correct path/);
61
+ }).rejects.toThrow(/Function 'display' failed with: File not found in given path please pass the correct path/);
56
62
  });
57
63
  });
@@ -6,7 +6,7 @@ describe("element - getAllDisplayed - error case", function () {
6
6
  });
7
7
 
8
8
  it("Execution & Verification", async function () {
9
- await expect(nonUi5.element.getAllDisplayed("BUTTON[id='invalid']", 4000)).rejects.toThrow("Function 'waitForAll' failed");
9
+ await expect(nonUi5.element.getAllDisplayed("BUTTON[id='invalid']", 4000)).rejects.toThrow(`Function 'getAllDisplayed' failed with: No visible element(s) found for selector 'BUTTON[id='invalid']' after 4s.`);
10
10
  });
11
11
  });
12
12
 
@@ -34,6 +34,6 @@ describe("element - getAllDisplayed - invisible element (present in DOM)", funct
34
34
  });
35
35
 
36
36
  it("Execution & Verification", async function () {
37
- await expect(nonUi5.element.getAllDisplayed("P[id='hiddenParagraph']")).rejects.toThrow(`Function 'getAllDisplayed' failed. No visible element(s) found for selector`);
37
+ await expect(nonUi5.element.getAllDisplayed("P[id='hiddenParagraph']")).rejects.toThrow(`Function 'getAllDisplayed' failed with: No visible element(s) found for selector 'P[id='hiddenParagraph']' after 30s.`);
38
38
  });
39
39
  });
@@ -52,7 +52,7 @@ describe("element - getByChild - error case with wrong element", function () {
52
52
  const elementSelector = ".wrongParent";
53
53
  const childSelector = ".wrongChild";
54
54
  await expect(nonUi5.element.getByChild(elementSelector, childSelector))
55
- .rejects.toThrow("Function 'getByChild' failed. No element found for selector:");
55
+ .rejects.toThrow("Function 'getByChild' failed with: No element found for selector:");
56
56
  });
57
57
  });
58
58
 
@@ -65,6 +65,6 @@ describe("element - getByChild - error case with wrong order of parent and child
65
65
  const elementSelector = "[id='container-cart---homeView--searchField-I']";
66
66
  const childSelector = "[id='container-cart---homeView--searchField-F']";
67
67
  await expect(nonUi5.element.getByChild(elementSelector, childSelector))
68
- .rejects.toThrow("Function 'getByChild' failed. The found element(s) with the given selector do(es) not have any child with selector");
68
+ .rejects.toThrow(`Function 'getByChild' failed with: The found element(s) with the given selector do(es) not have any child with selector [id='container-cart---homeView--searchField-F']`);
69
69
  });
70
70
  });
@@ -10,10 +10,7 @@ describe("element - getByCssContainingText - non strict", function () {
10
10
  });
11
11
 
12
12
  it("Execution", async function () {
13
- downloadBtn = await nonUi5.element.getByCssContainingText(
14
- "[id='sdk---welcome--readMoreButton-BDI-content']",
15
- "Down"
16
- );
13
+ downloadBtn = await nonUi5.element.getByCssContainingText("[id='sdk---welcome--readMoreButton-BDI-content']", "Down");
17
14
  });
18
15
 
19
16
  it("Verification", async function () {
@@ -32,14 +29,7 @@ describe("element - getByCssContainingText - strict", function () {
32
29
  });
33
30
 
34
31
  it("Execution", async function () {
35
- downloadBtn = await nonUi5.element.getByCssContainingText(
36
- "[id='sdk---welcome--readMoreButton-BDI-content']",
37
- "Download",
38
- 0,
39
- 30000,
40
- false,
41
- true
42
- );
32
+ downloadBtn = await nonUi5.element.getByCssContainingText("[id='sdk---welcome--readMoreButton-BDI-content']", "Download", 0, 30000, false, true);
43
33
  });
44
34
 
45
35
  it("Verification", async function () {
@@ -56,16 +46,9 @@ describe("element - getByCssContainingText - strict error case", function () {
56
46
  });
57
47
 
58
48
  it("Execution", async function () {
59
- expect(
60
- nonUi5.element.getByCssContainingText(
61
- "[id='sdk---welcome--readMoreButton-BDI-content']",
62
- "Down",
63
- 0,
64
- 30000,
65
- false,
66
- true
67
- )
68
- ).rejects.toThrow(/getByCssContainingText(): Element \w*|\d* not found/);
49
+ expect(nonUi5.element.getByCssContainingText("[id='sdk---welcome--readMoreButton-BDI-content']", "Down", 0, 30000, false, true)).rejects.toThrow(
50
+ /getByCssContainingText(): Element \w*|\d* not found/
51
+ );
69
52
  });
70
53
  });
71
54
 
@@ -76,8 +59,8 @@ describe("element - getByCssContainingText - error case", function () {
76
59
  });
77
60
 
78
61
  it("Execution & Verification", async function () {
79
- await expect(
80
- nonUi5.element.getByCssContainingText("[id='sdk---welcome--readMoreButton-BDI-content']", "Some Junk Text")
81
- ).rejects.toThrow(/getByCssContainingText(): Element \w*|\d* not found/);
62
+ await expect(nonUi5.element.getByCssContainingText("[id='sdk---welcome--readMoreButton-BDI-content']", "Some Junk Text")).rejects.toThrow(
63
+ `Function 'getByCssContainingText' failed with: Element with CSS '[id='sdk---welcome--readMoreButton-BDI-content']' and text 'Some Junk Text' not found.`
64
+ );
82
65
  });
83
66
  });
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- const {
3
- handleCookiesConsent
4
- } = require("../../../helper/utils");
2
+ const { handleCookiesConsent } = require("../../../helper/utils");
5
3
 
6
4
  describe("element - getByParent", function () {
7
5
  let finalElement;
8
6
 
9
7
  it("Preparation", async function () {
10
- await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories");
8
+ await common.navigation.navigateToUrl(
9
+ "https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories"
10
+ );
11
11
  await handleCookiesConsent();
12
12
  });
13
13
 
@@ -15,7 +15,6 @@ describe("element - getByParent", function () {
15
15
  const elementSelector = "[id='container-cart---homeView--searchField-I']";
16
16
  const parentSelector = "[id='container-cart---homeView--searchField-F']";
17
17
  finalElement = await nonUi5.element.getByParent(elementSelector, parentSelector);
18
-
19
18
  });
20
19
 
21
20
  it("Verification", async function () {
@@ -46,26 +45,32 @@ describe("element - getByParent - with index", function () {
46
45
 
47
46
  describe("element - getByParent - error case with wrong element", function () {
48
47
  it("Preparation", async function () {
49
- await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories");
48
+ await common.navigation.navigateToUrl(
49
+ "https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories"
50
+ );
50
51
  });
51
52
 
52
53
  it("Execution & Verification", async function () {
53
54
  const elementSelector = ".wrongParent";
54
55
  const parentSelector = ".wrongChild";
55
- await expect(nonUi5.element.getByParent(elementSelector, parentSelector))
56
- .rejects.toThrow("Function 'getByParent' failed. No parent element found for selector:");
56
+ await expect(nonUi5.element.getByParent(elementSelector, parentSelector)).rejects.toThrow(
57
+ "Function 'getByParent' failed with: No parent element found for selector:"
58
+ );
57
59
  });
58
60
  });
59
61
 
60
62
  describe("element - getByParent - error case with wrong order of parent and child", function () {
61
63
  it("Preparation", async function () {
62
- await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories");
64
+ await common.navigation.navigateToUrl(
65
+ "https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html?sap-ui-theme=sap_fiori_3#/categories"
66
+ );
63
67
  });
64
68
 
65
69
  it("Execution & Verification", async function () {
66
70
  const elementSelector = "[id='container-cart---homeView--searchField-F']";
67
71
  const parentSelector = "[id='container-cart---homeView--searchField-I']";
68
- await expect(nonUi5.element.getByParent(elementSelector, parentSelector))
69
- .rejects.toThrow("Function 'getByParent' failed. No visible elements found for selector");
72
+ await expect(nonUi5.element.getByParent(elementSelector, parentSelector)).rejects.toThrow(
73
+ `Function 'getByParent' failed with: No visible elements found for selector '[id='container-cart---homeView--searchField-F']' and parent selector '[id='container-cart---homeView--searchField-I']`
74
+ );
70
75
  });
71
- });
76
+ });
@@ -23,12 +23,10 @@ exports.config = merge(profile.config, {
23
23
  path.resolve(__dirname, "getByChild.spec.js"),
24
24
  path.resolve(__dirname, "getByParent.spec.js"),
25
25
  path.resolve(__dirname, "highlight.spec.js"),
26
- path.resolve(__dirname, "switchToIframe.spec.js"),
27
26
  path.resolve(__dirname, "getByName.spec.js"),
28
27
  path.resolve(__dirname, "getByCssContainingText.spec.js"),
29
28
  path.resolve(__dirname, "isVisible.spec.js"),
30
29
  path.resolve(__dirname, "isPresent.spec.js"),
31
- path.resolve(__dirname, "isPresent.spec.js"),
32
30
  path.resolve(__dirname, "isPresentByCss.spec.js"),
33
31
  path.resolve(__dirname, "isPresentByXPath.spec.js"),
34
32
  path.resolve(__dirname, "setInnerHTML.spec.js")
@@ -25,12 +25,10 @@ exports.config = merge(profile.config, {
25
25
  path.resolve(__dirname, "getByChild.spec.js"),
26
26
  path.resolve(__dirname, "getByParent.spec.js"),
27
27
  path.resolve(__dirname, "highlight.spec.js"),
28
- path.resolve(__dirname, "switchToIframe.spec.js"),
29
28
  path.resolve(__dirname, "getByName.spec.js"),
30
29
  path.resolve(__dirname, "getByCssContainingText.spec.js"),
31
30
  path.resolve(__dirname, "isVisible.spec.js"),
32
31
  path.resolve(__dirname, "isPresent.spec.js"),
33
- path.resolve(__dirname, "isPresent.spec.js"),
34
32
  path.resolve(__dirname, "isPresentByCss.spec.js"),
35
33
  path.resolve(__dirname, "isPresentByXPath.spec.js")
36
34
  ],
@@ -50,6 +50,6 @@ describe("userInteraction - clearAndFill - a button (error case)", function () {
50
50
 
51
51
  it("Execution & Verification", async function () {
52
52
  const elem = await nonUi5.element.getById("Default", 10000);
53
- await expect(nonUi5.userInteraction.clearAndFill(elem, "New test value")).rejects.toThrow(/invalid element state/);
53
+ await expect(nonUi5.userInteraction.clearAndFill(elem, "New test value")).rejects.toThrow(/Function 'clearAndFill' failed with: invalid element state/);
54
54
  });
55
55
  });
@@ -50,6 +50,8 @@ describe("userInteraction - clearAndFillAndRetry - button (error case)", functio
50
50
 
51
51
  it("Execution & Verification", async function () {
52
52
  const elem = await nonUi5.element.getById("Default", 10000);
53
- await expect(nonUi5.userInteraction.clearAndFillAndRetry(elem, "New test value", 1)).rejects.toThrow("Retries done. Failed to execute the function: Error: Function 'clearAndFill' failed with: invalid element state");
53
+ await expect(nonUi5.userInteraction.clearAndFillAndRetry(elem, "New test value", 1)).rejects.toThrow(
54
+ "Function 'clearAndFillAndRetry' failed with: Retries done. Failed to execute the function: invalid element state"
55
+ );
54
56
  });
55
57
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  describe("userInteraction - clearAndRetry - form field", function () {
4
4
  let element;
5
-
5
+
6
6
  it("Preparation", async function () {
7
7
  await common.navigation.navigateToUrl("http://localhost:34005/forms.html");
8
8
  element = await nonUi5.element.getById("ExampleValue1", 10000);
@@ -26,8 +26,9 @@ describe("userInteraction - clearAndRetry - no element (unhappy case)", function
26
26
  });
27
27
 
28
28
  it("Execution & Verification", async function () {
29
- await expect(nonUi5.userInteraction.clearAndRetry())
30
- .rejects.toThrow("Function 'clearAndRetry' failed with: Please provide an element as first argument.");
29
+ await expect(nonUi5.userInteraction.clearAndRetry()).rejects.toThrow(
30
+ "Function 'clearAndRetry' failed with: Please provide an element as first argument."
31
+ );
31
32
  });
32
33
  });
33
34
 
@@ -38,7 +39,6 @@ describe("userInteraction - clearAndRetry - button (unhappy case)", function ()
38
39
 
39
40
  it("Execution & Verification", async function () {
40
41
  const elem = await nonUi5.element.getById("Default", 10000);
41
- await expect(nonUi5.userInteraction.clearAndRetry(elem, 1))
42
- .rejects.toThrow("Retries done. Failed to execute the function: invalid element state");
42
+ await expect(nonUi5.userInteraction.clearAndRetry(elem, 1)).rejects.toThrow("Function 'clearAndRetry' failed with: Retries done. Failed to execute the function:");
43
43
  });
44
- });
44
+ });
@@ -23,7 +23,9 @@ describe("userInteraction - click - disabled button (unhappy case)", function ()
23
23
 
24
24
  it("Execution & Verification", async function () {
25
25
  const elem = await nonUi5.element.getById("Not-clickable", 10000);
26
- await expect(nonUi5.userInteraction.click(elem)).rejects.toThrow(/Timeout \w*|\d* by waiting for element is clickable/); // \w*|\d* - placeholder for timeout value
26
+ await expect(nonUi5.userInteraction.click(elem)).rejects.toThrow(
27
+ /Function 'click' failed with: Timeout \w*|\d* by waiting for element is clickable/
28
+ ); // \w*|\d* - placeholder for timeout value
27
29
  });
28
30
  });
29
31
 
@@ -23,7 +23,9 @@ describe("userInteraction - clickAndRetry - disabled button (unhappy case)", fun
23
23
 
24
24
  it("Execution & Verification", async function () {
25
25
  const elem = await nonUi5.element.getById("Not-clickable", 10000);
26
- await expect(nonUi5.userInteraction.clickAndRetry(elem, 1)).rejects.toThrow("Retries done. Failed to execute the function: ");
26
+ await expect(nonUi5.userInteraction.clickAndRetry(elem, 1)).rejects.toThrow(
27
+ "Function 'clickAndRetry' failed with: Retries done. Failed to execute the function: Timeout '0.001s' by waiting for element is enabled."
28
+ );
27
29
  });
28
30
  });
29
31
 
@@ -33,13 +35,15 @@ describe("userInteraction - clickAndRetry - empty value", function () {
33
35
  });
34
36
 
35
37
  it("Execution & Verification", async function () {
36
- await expect(nonUi5.userInteraction.clickAndRetry()).rejects.toThrow("Function 'clickAndRetry' failed with: Please provide an element as first argument.");
38
+ await expect(nonUi5.userInteraction.clickAndRetry()).rejects.toThrow(
39
+ "Function 'clickAndRetry' failed with: Please provide an element as first argument."
40
+ );
37
41
  });
38
42
  });
39
43
 
40
44
  describe("userInteraction - clickAndRetry - field (make it active)", function () {
41
45
  let element;
42
-
46
+
43
47
  it("Preparation", async function () {
44
48
  await common.navigation.navigateToUrl("http://localhost:34005/forms.html");
45
49
  element = await nonUi5.element.getById("ExampleValue1", 10000);
@@ -33,6 +33,8 @@ describe("userInteraction - fillAndRetry - button (error case)", function () {
33
33
 
34
34
  it("Execution & Verification", async function () {
35
35
  const elem = await nonUi5.element.getById("Default", 10000);
36
- await expect(nonUi5.userInteraction.fillAndRetry(elem, "New test value", 1)).rejects.toThrow("Retries done. Failed to execute the function:");
36
+ await expect(nonUi5.userInteraction.fillAndRetry(elem, "New test value", 1)).rejects.toThrow(
37
+ "Function 'retry' failed with: Retries done. Failed to execute the function"
38
+ );
37
39
  });
38
40
  });
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  const selector = {
4
- "elementProperties": {
5
- "viewName": "sap.ui.demo.cart.view.Welcome",
6
- "metadata": "sap.m.Title",
7
- "text": [{
8
- "path": "i18n>welcomeHeadline"
9
- }]
4
+ elementProperties: {
5
+ viewName: "sap.ui.demo.cart.view.Welcome",
6
+ metadata: "sap.m.Title",
7
+ text: [
8
+ {
9
+ path: "i18n>welcomeHeadline"
10
+ }
11
+ ]
10
12
  }
11
13
  };
12
14
 
@@ -28,20 +30,24 @@ describe("assertion - expectAttributeToContain with wrong selector (unhappy case
28
30
  it("Execution & Verification", async function () {
29
31
  // Selector for a list of elements?
30
32
  const selectorWithATypo = {
31
- "elementProperties": {
32
- "viewName": "sap.ui.demo.cart.view.Welcome",
33
- "metadata": "sap.m.Title",
34
- "text": [{
35
- "path": "i18n>welcomeHeadlineWithError" // "i18n>welcomeHeadlineWithError" instead of "i18n>welcomeHeadline"
36
- }]
33
+ elementProperties: {
34
+ viewName: "sap.ui.demo.cart.view.Welcome",
35
+ metadata: "sap.m.Title",
36
+ text: [
37
+ {
38
+ path: "i18n>welcomeHeadlineWithError" // "i18n>welcomeHeadlineWithError" instead of "i18n>welcomeHeadline"
39
+ }
40
+ ]
37
41
  }
38
42
  };
39
- await expect(ui5.assertion.expectAttributeToContain(selectorWithATypo, "text", "to the Shopping Cart", 0, 5000))
40
- .rejects.toThrow(/uiControlExecuteLocator\(\): No visible elements found/);
43
+ await expect(ui5.assertion.expectAttributeToContain(selectorWithATypo, "text", "to the Shopping Cart", 0, 5000)).rejects.toThrow(
44
+ /uiControlExecuteLocator\(\): No visible elements found/
45
+ );
41
46
 
42
47
  // skip selector
43
- await expect(ui5.assertion.expectAttributeToContain("text", "to the Shopping Cart", 0, 5000))
44
- .rejects.toThrow("Function 'expectAttributeToContain' failed:");
48
+ await expect(ui5.assertion.expectAttributeToContain("text", "to the Shopping Cart", 0, 5000)).rejects.toThrow(
49
+ "Function 'expectAttributeToContain' failed with: Please provide a valid selector as argument."
50
+ );
45
51
  });
46
52
  });
47
53
 
@@ -55,14 +61,18 @@ describe("assertion - expectAttributeToContain with wrong attribute (unhappy cas
55
61
  // In Chrome: javascript error: done is not a function
56
62
  // In Firefox: TypeError: done is not a function
57
63
  // In Safari: JavaScript exception occured: done is not a function. (In 'done(val)', 'done' is undefined)
58
- await expect(ui5.assertion.expectAttributeToContain(selector, 123, "to the Shopping Cart", 0, 5000))
59
- .rejects.toThrow("Function expectAttributeToContain failed: Please check your attribute argument.");
60
- await expect(ui5.assertion.expectAttributeToContain(selector, false, "to the Shopping Cart", 0, 5000))
61
- .rejects.toThrow("Function expectAttributeToContain failed: Please check your attribute argument.");
62
- await expect(ui5.assertion.expectAttributeToContain(selector, null, "to the Shopping Cart", 0, 5000))
63
- .rejects.toThrow("Function expectAttributeToContain failed: Please check your attribute argument.");
64
- await expect(ui5.assertion.expectAttributeToContain(selector, undefined, "to the Shopping Cart", 0, 5000))
65
- .rejects.toThrow("Function expectAttributeToContain failed: Please check your attribute argument.");
64
+ await expect(ui5.assertion.expectAttributeToContain(selector, 123, "to the Shopping Cart", 0, 5000)).rejects.toThrow(
65
+ "Function 'expectAttributeToContain' failed with: Please check your attribute argument."
66
+ );
67
+ await expect(ui5.assertion.expectAttributeToContain(selector, false, "to the Shopping Cart", 0, 5000)).rejects.toThrow(
68
+ "Function 'expectAttributeToContain' failed with: Please check your attribute argument."
69
+ );
70
+ await expect(ui5.assertion.expectAttributeToContain(selector, null, "to the Shopping Cart", 0, 5000)).rejects.toThrow(
71
+ "Function 'expectAttributeToContain' failed with: Please check your attribute argument."
72
+ );
73
+ await expect(ui5.assertion.expectAttributeToContain(selector, undefined, "to the Shopping Cart", 0, 5000)).rejects.toThrow(
74
+ "Function 'expectAttributeToContain' failed with: Please check your attribute argument."
75
+ );
66
76
  });
67
77
  });
68
78
 
@@ -72,7 +82,6 @@ describe("assertion - expectAttributeToContain with wrong compareValue (unhappy
72
82
  });
73
83
 
74
84
  it("Execution & Verification", async function () {
75
- await expect(ui5.assertion.expectAttributeToContain(selector, "text", 123))
76
- .rejects.toThrow("Welcome to the Shopping Cart");
85
+ await expect(ui5.assertion.expectAttributeToContain(selector, "text", 123)).rejects.toThrow("Welcome to the Shopping Cart");
77
86
  });
78
- });
87
+ });
@@ -71,23 +71,22 @@ describe("assertion - expectBindingContextPathToBe with wrong selector (unhappy
71
71
  };
72
72
 
73
73
  await expect(ui5.assertion.expectBindingContextPathToBe(totallyWrongSelector, "/ProductCategories('AC')", 0, 2500))
74
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: uiControlExecuteLocator(): No visible elements found with selector:");
75
-
74
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: uiControlExecuteLocator(): No visible elements found with selector: {\"wrongData\":\"123\"} in 2.5s");
76
75
 
77
76
  await expect(ui5.assertion.expectBindingContextPathToBe(wrongSelector, "/ProductCategories('AC')", 0, 2500))
78
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: uiControlExecuteLocator(): No visible elements found with selector:");
77
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: uiControlExecuteLocator(): No visible elements found with selector:");
79
78
 
80
79
  await expect(ui5.assertion.expectBindingContextPathToBe(123, "/ProductCategories('AC')", 0, 2500))
81
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: Function 'getDisplayed' failed: Please provide a valid selector as argument.");
80
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: Please provide a valid selector as argument.");
82
81
 
83
82
  await expect(ui5.assertion.expectBindingContextPathToBe(false, "/ProductCategories('AC')", 0, 2500))
84
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: Function 'getDisplayed' failed: Please provide a valid selector as argument.");
83
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: Please provide a valid selector as argument.");
85
84
 
86
85
  await expect(ui5.assertion.expectBindingContextPathToBe(null, "/ProductCategories('AC')", 0, 2500))
87
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: Function 'getDisplayed' failed: Please provide a valid selector as argument.");
86
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: Please provide a valid selector as argument.");
88
87
 
89
88
  await expect(ui5.assertion.expectBindingContextPathToBe(undefined, "/ProductCategories('AC')", 0, 2500))
90
- .rejects.toThrow("Function 'expectBindingContextPathToBe' failed:Error: Function 'getDisplayed' failed: Please provide a valid selector as argument.");
89
+ .rejects.toThrow("Function 'expectBindingContextPathToBe' failed with: Please provide a valid selector as argument.");
91
90
  });
92
91
  });
93
92