@openui5/sap.ui.testrecorder 1.103.0 → 1.105.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/.reuse/dep5 CHANGED
@@ -137,6 +137,11 @@ Copyright: jQuery Foundation and other contributors
137
137
  License: MIT
138
138
  Comment: these files belong to: QUnit 2
139
139
 
140
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
141
+ Copyright: jQuery Foundation and other contributors
142
+ License: MIT
143
+ Comment: these files belong to: QUnit 2.18
144
+
140
145
  Files: src/sap.ui.core/src/sap/ui/thirdparty/jquery-compat.js
141
146
  Copyright: OpenJS Foundation and other contributors
142
147
  License: MIT
@@ -154,7 +159,7 @@ Copyright:
154
159
  License: Apache-2.0 and MIT
155
160
  Comment: these files contain content from SAP and jQuery.rtl-scroll-type: _FeatureDetection.js is overall written by SAP, but contains code which is inspired by jQuery.rtl-scroll-type
156
161
 
157
- Files: src/sap.ui.core/src/sap/ui/thirdparty/qunit-composite*
162
+ Files: src/sap.ui.core/src/sap/ui/thirdparty/qunit-composite.*
158
163
  Copyright: jQuery Foundation and other contributors
159
164
  License: MIT
160
165
  Comment: these files belong to: QUnit Composite
@@ -234,6 +239,11 @@ Copyright: 2010-2017, Christian Johansen, christian@cjohansen.no
234
239
  License: BSD-3-Clause
235
240
  Comment: these files belong to: SinonJS
236
241
 
242
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
243
+ Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
244
+ License: BSD-3-Clause
245
+ Comment: these files belong to: SinonJS 14
246
+
237
247
  Files: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
238
248
  Copyright: 2010-2011, Christian Johansen
239
249
  License: BSD-3-Clause
@@ -339,6 +349,13 @@ Copyright:
339
349
  License: Apache-2.0 and ISC
340
350
  Comment: these files contain content from SAP and node-lru-cache: LRUPersistentCache.js is overall written by SAP, but portions ('Least Recently Used' logic) are taken from the node-lru-cache project (see https://github.com/isaacs/node-lru-cache/blob/v2.7.3/README.md) and modified.
341
351
 
352
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
353
+ Copyright:
354
+ 2009-2022 SAP SE or an SAP affiliate company and OpenUI5 contributors
355
+ Arthur David Olson, Paul Eggert and other contributors
356
+ License: Apache-2.0 and LicenseRef-tzdata-PublicDomain
357
+ Comment: these files contain content from SAP and Time Zone Database: _timezones.js is overall written by SAP, but the list of IANA timezone IDs is taken from the Timezone Database
358
+
342
359
 
343
360
  # Library: sap.ui.documentation:
344
361
 
@@ -0,0 +1,5 @@
1
+ Unless specified below, all files in the tz code and data (including
2
+ this LICENSE file) are in the public domain.
3
+
4
+ If the files date.c, newstrftime.3, and strftime.c are present, they
5
+ contain material derived from BSD and use the BSD 3-clause license.
package/THIRDPARTY.txt CHANGED
@@ -76,6 +76,12 @@ License: MIT
76
76
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
77
77
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/qunit-2.*
78
78
 
79
+ Component: QUnit 2.18, version: 2.18.0
80
+ Copyright: jQuery Foundation and other contributors
81
+ License: MIT
82
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
83
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
84
+
79
85
  Component: jQuery-Migrate, version: 3.3.1
80
86
  Copyright: OpenJS Foundation and other contributors
81
87
  License: MIT
@@ -98,7 +104,7 @@ Component: QUnit Composite, version: 1.0.2-pre
98
104
  Copyright: jQuery Foundation and other contributors
99
105
  License: MIT
100
106
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
101
- Contained in: src/sap.ui.core/src/sap/ui/thirdparty/qunit-composite*
107
+ Contained in: src/sap.ui.core/src/sap/ui/thirdparty/qunit-composite.*
102
108
 
103
109
  Component: JUnit Reporter for QUnit, version: 1.1.1
104
110
  Copyright: jQuery Foundation and other contributors
@@ -191,13 +197,19 @@ License: BSD-3-Clause
191
197
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
192
198
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-4.js
193
199
 
200
+ Component: SinonJS 14, version: 14.0.0
201
+ Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
202
+ License: BSD-3-Clause
203
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
204
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
205
+
194
206
  Component: Sinon-qunit, version: 2.0.0
195
207
  Copyright: 2010-2011, Christian Johansen
196
208
  License: BSD-3-Clause
197
209
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
198
210
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
199
211
 
200
- Component: URI.js, version: 1.19.10
212
+ Component: URI.js, version: 1.19.11
201
213
  Copyright: Rodney Rehm
202
214
  License: MIT
203
215
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
@@ -315,6 +327,12 @@ License: ISC
315
327
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/ISC.txt
316
328
  Contained in: src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
317
329
 
330
+ Component: Time Zone Database, version: 2022a
331
+ Copyright: Arthur David Olson, Paul Eggert and other contributors
332
+ License: LicenseRef-tzdata-PublicDomain
333
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/LicenseRef-tzdata-PublicDomain.txt
334
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
335
+
318
336
 
319
337
  Library: sap.ui.documentation:
320
338
 
@@ -450,7 +468,7 @@ License: Apache-2.0
450
468
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
451
469
  Contained in: lib/jsdoc/ui5/plugin.js
452
470
 
453
- Component: SAP Theming Base Content, version: 11.1.39
471
+ Component: SAP Theming Base Content, version: 11.1.40
454
472
  Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
455
473
  License: Apache-2.0
456
474
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
@@ -980,6 +998,21 @@ END of license: LicenseRef-JSONinJSPublicDomain
980
998
  =================================
981
999
 
982
1000
 
1001
+ =================================
1002
+ BEGIN of license: LicenseRef-tzdata-PublicDomain
1003
+ =================================
1004
+
1005
+ Unless specified below, all files in the tz code and data (including
1006
+ this LICENSE file) are in the public domain.
1007
+
1008
+ If the files date.c, newstrftime.3, and strftime.c are present, they
1009
+ contain material derived from BSD and use the BSD 3-clause license.
1010
+
1011
+ =================================
1012
+ END of license: LicenseRef-tzdata-PublicDomain
1013
+ =================================
1014
+
1015
+
983
1016
  =================================
984
1017
  BEGIN of license: MIT
985
1018
  =================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.testrecorder",
3
- "version": "1.103.0",
3
+ "version": "1.105.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.testrecorder",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,10 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.103.0",
18
- "@openui5/sap.ui.codeeditor": "1.103.0",
19
- "@openui5/sap.ui.core": "1.103.0",
20
- "@openui5/sap.ui.layout": "1.103.0",
21
- "@openui5/sap.ui.support": "1.103.0"
17
+ "@openui5/sap.m": "1.105.0",
18
+ "@openui5/sap.ui.codeeditor": "1.105.0",
19
+ "@openui5/sap.ui.core": "1.105.0",
20
+ "@openui5/sap.ui.layout": "1.105.0",
21
+ "@openui5/sap.ui.support": "1.105.0"
22
22
  }
23
23
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.103.0</version>
9
+ <version>1.105.0</version>
10
10
 
11
11
  <documentation>UI5 library: sap.ui.testrecorder</documentation>
12
12
 
@@ -10,7 +10,7 @@ sap.ui.define([
10
10
  ], function (BaseObject, Dialects) {
11
11
  "use strict";
12
12
 
13
- var DEFAULT_DIALECT = Dialects.UIVERI5;
13
+ var DEFAULT_DIALECT = Dialects.OPA5;
14
14
 
15
15
  var oDialectRegistry = null;
16
16
 
@@ -11,6 +11,7 @@ sap.ui.define([
11
11
  return {
12
12
  OPA5: "OPA5",
13
13
  RAW: "RAW",
14
- UIVERI5: "UIVERI5"
14
+ UIVERI5: "UIVERI5",
15
+ WDI5: "WDI5"
15
16
  };
16
17
  });
@@ -9,9 +9,10 @@ sap.ui.define([
9
9
  "sap/ui/testrecorder/codeSnippets/OPA5ControlSnippetGenerator",
10
10
  "sap/ui/testrecorder/codeSnippets/RawControlSnippetGenerator",
11
11
  "sap/ui/testrecorder/codeSnippets/UIVeri5ControlSnippetGenerator",
12
+ "sap/ui/testrecorder/codeSnippets/WDI5ControlSnippetGenerator",
12
13
  "sap/ui/testrecorder/DialectRegistry",
13
14
  "sap/ui/testrecorder/Dialects"
14
- ], function (BaseObject, OPA5ControlSnippetGenerator, RawControlSnippetGenerator, UIVeri5ControlSnippetGenerator, DialectRegistry, Dialects) {
15
+ ], function (BaseObject, OPA5ControlSnippetGenerator, RawControlSnippetGenerator, UIVeri5ControlSnippetGenerator, WDI5ControlSnippetGenerator, DialectRegistry, Dialects) {
15
16
  "use strict";
16
17
 
17
18
  var oControlSnippetProvider = null;
@@ -54,6 +55,7 @@ sap.ui.define([
54
55
  case Dialects.OPA5: return OPA5ControlSnippetGenerator;
55
56
  case Dialects.RAW: return RawControlSnippetGenerator;
56
57
  case Dialects.UIVERI5: return UIVeri5ControlSnippetGenerator;
58
+ case Dialects.WDI5: return WDI5ControlSnippetGenerator;
57
59
  default: return RawControlSnippetGenerator;
58
60
  }
59
61
  };
@@ -33,14 +33,19 @@ sap.ui.define([
33
33
  * @param {boolean} mSettings.formatAsPOMethod true if selectors should be wrapped in a page object method. Default value is true.
34
34
  * @param {boolean} mSettings.multipleSnippets true if the snippets for multiple controls should be combined
35
35
  * @param {string} mSettings.action name of the current (latest) action
36
+ * @param {boolean} bAsync whether the page object method should be async or not
36
37
  * @returns {string} a code snippet with the expected formatting
37
38
  */
38
- POMethodUtil.prototype.getPOMethod = function (aSnippets, mSettings) {
39
+ POMethodUtil.prototype.getPOMethod = function (aSnippets, mSettings, bAsync) {
39
40
  if (mSettings && mSettings.formatAsPOMethod) {
40
41
  var sSnippet = aSnippets.map(function (sSnippet) {
41
42
  return sSnippet.replace(/^/gm, " ");
42
43
  }).join("\n\n");
43
- return this._getMethodName(mSettings) + ": function () {\n" + sSnippet + "\n}";
44
+ if (bAsync) {
45
+ return this._getMethodName(mSettings) + ": async () => {\n" + sSnippet + "\n}";
46
+ } else {
47
+ return this._getMethodName(mSettings) + ": function () {\n" + sSnippet + "\n}";
48
+ }
44
49
  } else {
45
50
  return aSnippets.join("\n\n");
46
51
  }
@@ -0,0 +1,98 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define(
8
+ [
9
+ "sap/ui/testrecorder/codeSnippets/ControlSnippetGenerator",
10
+ "sap/ui/testrecorder/interaction/Commands"
11
+ ],
12
+ function (ControlSnippetGenerator, Commands) {
13
+ "use strict";
14
+
15
+ /**
16
+ * @class generates a code snippet relevant to UIVeri5
17
+ */
18
+ var WDI5ControlSnippetGenerator = ControlSnippetGenerator.extend(
19
+ "sap.ui.testrecorder.codeSnippets.WDI5ControlSnippetGenerator",
20
+ {}
21
+ );
22
+
23
+ /**
24
+ * @param {object} mData data from which to generate a snippet
25
+ * @param {object} mData.controlSelector control selector in string format
26
+ * @param {string} mData.action name of the action to record for the control
27
+ * @param {object} mData.assertion assertion details - property name, type and expected value
28
+ * @returns {string} a stringified code snippet
29
+ */
30
+ WDI5ControlSnippetGenerator.prototype._generate = function (mData) {
31
+ var sBasicSelector =
32
+ "await browser.asControl({\n\tselector: " +
33
+ this._getSelectorAsString(mData.controlSelector) +
34
+ "})";
35
+ var sSelectorWithAssertion = this._getSelectorWithAssertion(
36
+ sBasicSelector,
37
+ mData.assertion
38
+ );
39
+ return (
40
+ sSelectorWithAssertion +
41
+ this._getActionAsString(mData.action) +
42
+ ";"
43
+ );
44
+ };
45
+
46
+ WDI5ControlSnippetGenerator.prototype._getSelectorAsString = function (mControlSelector) {
47
+ var sSelector = JSON.stringify(mControlSelector, undefined, 8);
48
+ // remove quotes from keys. our key names are 'safe'
49
+ return sSelector.replace(/\"([^(\")"]+)\":/g, "$1:");
50
+ };
51
+
52
+ WDI5ControlSnippetGenerator.prototype._getActionAsString = function (
53
+ sAction
54
+ ) {
55
+ switch (sAction) {
56
+ case Commands.PRESS:
57
+ return ".press()";
58
+ case Commands.ENTER_TEXT:
59
+ return '.enterText("test")';
60
+ default:
61
+ return "";
62
+ }
63
+ };
64
+
65
+ WDI5ControlSnippetGenerator.prototype._getSelectorWithAssertion =
66
+ function (sSelector, mAssertion) {
67
+ if (mAssertion) {
68
+ var sMatcher;
69
+ if (
70
+ !mAssertion.expectedValue ||
71
+ mAssertion.expectedValue === "false"
72
+ ) {
73
+ sMatcher = ".toBeFalsy()";
74
+ } else if (mAssertion.propertyType === "boolean") {
75
+ sMatcher = ".toBeTruthy()";
76
+ } else {
77
+ var sExpectedValue = this._escapeQuotes(
78
+ mAssertion.expectedValue
79
+ );
80
+ sMatcher = '.toEqual("' + sExpectedValue + '")';
81
+ }
82
+ // we need the first letter upper case to build our getter
83
+ var sPropertyNameWithFirstLetterUpperCase =
84
+ mAssertion.propertyName[0].toUpperCase() +
85
+ mAssertion.propertyName.slice(1);
86
+ return (
87
+ 'const ' + mAssertion.propertyName + ' = ' + sSelector +
88
+ '.get' + sPropertyNameWithFirstLetterUpperCase
89
+ + '();\nexpect(' + mAssertion.propertyName + ')' + sMatcher
90
+ );
91
+ } else {
92
+ return sSelector;
93
+ }
94
+ };
95
+
96
+ return new WDI5ControlSnippetGenerator();
97
+ }
98
+ );
@@ -129,7 +129,7 @@ sap.ui.define([
129
129
  return POMethodUtil.getPOMethod(aSnippets, $.extend({
130
130
  action: mData.action,
131
131
  assertion: mData.assertion
132
- }, mSelectorSettings));
132
+ }, mSelectorSettings), DialectRegistry.getActiveDialect() === Dialects.WDI5);
133
133
  }
134
134
  }).then(function (sSnippet) {
135
135
  // here sSnippet contains the snippets for one or multiple controls
@@ -5,9 +5,8 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/base/Object",
9
- "sap/ui/thirdparty/jquery"
10
- ], function (BaseObject, $) {
8
+ "sap/ui/base/Object"
9
+ ], function (BaseObject) {
11
10
  "use strict";
12
11
 
13
12
  var oControlInspectorRepo = null;
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @namespace
25
25
  * @alias sap.ui.testrecorder
26
26
  * @author SAP SE
27
- * @version 1.103.0
27
+ * @version 1.105.0
28
28
  * @since 1.74
29
29
  * @public
30
30
  */
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  controls: [],
39
39
  elements: [],
40
40
  noLibraryCSS: true,
41
- version: "1.103.0",
41
+ version: "1.105.0",
42
42
  extensions: {
43
43
  //Configuration used for rule loading of Support Assistant
44
44
  "sap.ui.support": {
@@ -9,6 +9,7 @@ sap.ui.define([
9
9
  "sap/ui/Device",
10
10
  "sap/ui/util/Storage",
11
11
  "sap/ui/core/mvc/Controller",
12
+ "sap/ui/dom/includeStylesheet",
12
13
  "sap/ui/testrecorder/ui/models/SharedModel",
13
14
  "sap/ui/testrecorder/CommunicationBus",
14
15
  "sap/ui/testrecorder/CommunicationChannels",
@@ -22,7 +23,7 @@ sap.ui.define([
22
23
  "sap/m/VBox",
23
24
  "sap/ui/support/supportRules/ui/external/ElementTree",
24
25
  "sap/ui/testrecorder/interaction/ContextMenu"
25
- ], function ($, Device, Storage, Controller, SharedModel, CommunicationBus, CommunicationChannels, JSONModel, ResourceModel,
26
+ ], function ($, Device, Storage, Controller, includeStylesheet, SharedModel, CommunicationBus, CommunicationChannels, JSONModel, ResourceModel,
26
27
  Binding, MessageToast, Dialog, CheckBox, Button, VBox, ElementTree, ContextMenu) {
27
28
  "use strict";
28
29
 
@@ -32,7 +33,7 @@ sap.ui.define([
32
33
  this._selectionId = null;
33
34
  this._localStorage = new Storage(Storage.Type.local, "sap-ui-test-recorder");
34
35
 
35
- $.sap.includeStyleSheet("sap/ui/testrecorder/ui/styles/overlay.css");
36
+ includeStylesheet("sap/ui/testrecorder/ui/styles/overlay.css");
36
37
 
37
38
  this.elementTree = new ElementTree(null, {
38
39
  filter: {
@@ -26,8 +26,11 @@ sap.ui.define([
26
26
  }, {
27
27
  key: Dialects.UIVERI5,
28
28
  label: oI18nModel.getProperty("TestRecorder.Inspect.Snippet.Dialect.UIVeri5")
29
+ }, {
30
+ key: Dialects.WDI5,
31
+ label: oI18nModel.getProperty("TestRecorder.Inspect.Snippet.Dialect.WDI5")
29
32
  }],
30
- selectedDialect: Dialects.UIVERI5,
33
+ selectedDialect: Dialects.OPA5,
31
34
  settings: {
32
35
  preferViewId: false,
33
36
  formatAsPOMethod: true,