@ui5/webcomponents-tools 1.24.14 → 1.24.16

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.24.16](https://github.com/SAP/ui5-webcomponents/compare/v1.24.15...v1.24.16) (2025-02-05)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.24.15](https://github.com/SAP/ui5-webcomponents/compare/v1.24.14...v1.24.15) (2025-01-17)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.24.14](https://github.com/SAP/ui5-webcomponents/compare/v1.24.13...v1.24.14) (2024-12-13)
7
23
 
8
24
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -1,406 +1,406 @@
1
- const dns = require("node:dns");
2
-
3
- exports.config = {
4
- //
5
- // ====================
6
- // Runner Configuration
7
- // ====================
8
- //
9
- // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
10
- // on a remote machine).
11
- runner: 'local',
12
-
13
- //
14
- // ==================
15
- // Specify Test Files
16
- // ==================
17
- // Define which test specs should run. The pattern is relative to the directory
18
- // from which `wdio` was called. Notice that, if you are calling `wdio` from an
19
- // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
20
- // directory is where your package.json resides, so `wdio` will be called from there.
21
- //
22
- specs: [
23
- './test/specs/**/*.js'
24
- ],
25
- // Patterns to exclude.
26
- exclude: [
27
- // 'path/to/excluded/files'
28
- ],
29
- //
30
- // ============
31
- // Capabilities
32
- // ============
33
- // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
34
- // time. Depending on the number of capabilities, WebdriverIO launches several test
35
- // sessions. Within your capabilities you can overwrite the spec and exclude options in
36
- // order to group specific specs to a specific capability.
37
- //
38
- // First, you can define how many instances should be started at the same time. Let's
39
- // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
40
- // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
41
- // files and you set maxInstances to 10, all spec files will get tested at the same time
42
- // and 30 processes will get spawned. The property handles how many capabilities
43
- // from the same test should run tests.
44
- //
45
- maxInstances: 10,
46
- //
47
- // If you have trouble getting all important capabilities together, check out the
48
- // Sauce Labs platform configurator - a great tool to configure your capabilities:
49
- // https://docs.saucelabs.com/reference/platforms-configurator
50
- //
51
- capabilities: [{
52
- // maxInstances can get overwritten per capability. So if you have an in-house Selenium
53
- // grid with only 5 firefox instances available you can make sure that not more than
54
- // 5 instances get started at a time.
55
- maxInstances: 5,
56
- //
57
- browserName: 'chrome',
58
- 'goog:chromeOptions': {
59
- // to run chrome headless the following flags are required
60
- // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
61
- args: [
62
- '--headless=old',
63
- '--disable-search-engine-choice-screen',
64
- '--start-maximized',
65
- '--no-sandbox',
66
- '--disable-gpu',
67
- '--disable-infobars',
68
- '--disable-extensions',
69
- '--disable-dev-shm-usage',
70
- ],
71
- // args: ['--disable-gpu'],
72
- }
73
- }],
74
- //
75
- // port to find chromedriver
76
- port: 9515, // default
77
- // ===================
78
- // Test Configurations
79
- // ===================
80
- // Define all options that are relevant for the WebdriverIO instance here
81
- //
82
- // Level of logging verbosity: trace | debug | info | warn | error
83
- logLevel: 'error',
84
- //
85
- // Warns when a deprecated command is used
86
- deprecationWarnings: true,
87
- //
88
- // If you only want to run your tests until a specific amount of tests have failed use
89
- // bail (default is 0 - don't bail, run all tests).
90
- bail: 0,
91
- //
92
- // Set a base URL in order to shorten url command calls. If your `url` parameter starts
93
- // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
94
- // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
95
- // gets prepended directly.
96
- baseUrl: 'http://localhost:4567', // This is important since WDIO 7+ does not accept an empty string for baseUrl
97
- path: '',
98
- //
99
- // Default timeout for all waitFor* commands.
100
- waitforTimeout: 10000,
101
- //
102
- // Default timeout in milliseconds for request
103
- // if Selenium Grid doesn't send response
104
- connectionRetryTimeout: 90000,
105
- //
106
- // Default request retries count
107
- connectionRetryCount: 3,
108
- //
109
- // Test runner services
110
- // Services take over a specific job you don't want to take care of. They enhance
111
- // your test setup with almost no effort. Unlike plugins, they don't add new
112
- // commands. Instead, they hook themselves up into the test process.
113
- services: ['chromedriver', ['static-server', {
114
- folders: [
115
- { mount: '/', path: './dist' },
116
- ],
117
- port: '4567',
118
- }],
119
- ],
120
- // options
121
- chromeDriverArgs: ['--port=9515'], // default
122
- // Framework you want to run your specs with.
123
- // The following are supported: Mocha, Jasmine, and Cucumber
124
- // see also: https://webdriver.io/docs/frameworks.html
125
- //
126
- // Make sure you have the wdio adapter package for the specific framework installed
127
- // before running any tests.
128
- framework: 'mocha',
129
- //
130
- // Test reporter for stdout.
131
- // The only one supported by default is 'dot'
132
- // see also: https://webdriver.io/docs/dot-reporter.html
133
- reporters: ['dot', 'spec'],
134
-
135
- //
136
- // Options to be passed to Mocha.
137
- // See the full list at http://mochajs.org/
138
- mochaOpts: {
139
- ui: 'bdd',
140
- timeout: 60000
141
- },
142
- //
143
- // =====
144
- // Hooks
145
- // =====
146
- // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
147
- // it and to build services around it. You can either apply a single function or an array of
148
- // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
149
- // resolved to continue.
150
- /**
151
- * Gets executed once before all workers get launched.
152
- * @param {Object} config wdio configuration object
153
- * @param {Array.<Object>} capabilities list of capabilities details
154
- */
155
- // onPrepare: function (config, capabilities) {
156
- // },
157
- /**
158
- * Gets executed just before initialising the webdriver session and test framework. It allows you
159
- * to manipulate configurations depending on the capability or spec.
160
- * @param {Object} config wdio configuration object
161
- * @param {Array.<Object>} capabilities list of capabilities details
162
- * @param {Array.<String>} specs List of spec file paths that are to be run
163
- */
164
- // beforeSession: function (config, capabilities, specs) {
165
- // },
166
- beforeSession: () => {
167
- dns.setDefaultResultOrder('ipv4first');
168
- },
169
- /**
170
- * Gets executed before test execution begins. At this point you can access to all global
171
- * variables like `browser`. It is the perfect place to define custom commands.
172
- * @param {Array.<Object>} capabilities list of capabilities details
173
- * @param {Array.<String>} specs List of spec file paths that are to be run
174
- */
175
- before: async function (capabilities, specs) {
176
- await browser.addCommand("isFocusedDeep", async function () {
177
- return browser.executeAsync(function (elem, done) {
178
- let activeElement = document.activeElement;
179
-
180
- while (activeElement.shadowRoot) {
181
- if (activeElement.shadowRoot.activeElement) {
182
- activeElement = activeElement.shadowRoot.activeElement;
183
- } else {
184
- break;
185
- }
186
- }
187
- done(elem === activeElement);
188
- }, this);
189
- }, true);
190
-
191
- await browser.addCommand("isFocusedDeepElement", async function (element) {
192
- return browser.executeAsync(function (elem, element, done) {
193
- let activeElement = document.activeElement;
194
-
195
- while (activeElement.shadowRoot) {
196
- if (activeElement.shadowRoot.activeElement) {
197
- activeElement = activeElement.shadowRoot.activeElement;
198
- } else {
199
- break;
200
- }
201
- }
202
- done(element === activeElement);
203
- }, this, element);
204
- }, true);
205
-
206
- await browser.addCommand("setProperty", async function(property, value) {
207
- return browser.executeAsync((elem, property, value, done) => {
208
- elem[property] = value;
209
- done();
210
- }, this, property, value);
211
- }, true);
212
-
213
- await browser.addCommand("setAttribute", async function(attribute, value) {
214
- return browser.executeAsync((elem, attribute, value, done) => {
215
- elem.setAttribute(attribute, value);
216
- done();
217
- }, this, attribute, value);
218
- }, true);
219
-
220
- await browser.addCommand("removeAttribute", async function(attribute) {
221
- return browser.executeAsync((elem, attribute, done) => {
222
- elem.removeAttribute(attribute);
223
- done();
224
- }, this, attribute);
225
- }, true);
226
-
227
- await browser.addCommand("hasClass", async function(className) {
228
- return browser.executeAsync((elem, className, done) => {
229
- done(elem.classList.contains(className));
230
- }, this, className);
231
- }, true);
232
-
233
- await browser.addCommand("hasAttribute", async function(attrName) {
234
- return browser.executeAsync((elem, attrName, done) => {
235
- done(elem.hasAttribute(attrName));
236
- }, this, attrName);
237
- }, true);
238
-
239
- await browser.addCommand("getStaticAreaItemClassName", async function(selector) {
240
- return browser.executeAsync(async (selector, done) => {
241
- const staticAreaItem = await document.querySelector(selector).getStaticAreaItemDomRef();
242
- done(staticAreaItem.host.classList[0]);
243
- }, selector);
244
- }, false);
245
-
246
- await browser.addLocatorStrategy('activeElement', (selector) => {
247
- return document.querySelector(selector).shadowRoot.activeElement;
248
- });
249
- },
250
- /**
251
- * Runs before a WebdriverIO command gets executed.
252
- * @param {String} commandName hook command name
253
- * @param {Array} args arguments that command would receive
254
- */
255
- beforeCommand: async function (commandName, args) {
256
- const waitFor = [
257
- "$",
258
- "$$",
259
- "getAttribute",
260
- "hasAttribute", // custom
261
- "getCSSProperty",
262
- "getHTML",
263
- "getProperty",
264
- "getSize",
265
- "getStaticAreaItemClassName", // custom
266
- "getText",
267
- "getValue",
268
- "hasClass", // custom
269
- "isDisplayed",
270
- "isDisplayedInViewport",
271
- "isEnabled",
272
- "isExisting",
273
- "isFocused",
274
- "isFocusedDeep", // custom
275
- "isFocusedDeepElement", // custom
276
- "shadow$",
277
- "shadow$$",
278
- ];
279
- if (waitFor.includes(commandName)) {
280
- await browser.executeAsync(function (done) {
281
- window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
282
- });
283
- }
284
- },
285
-
286
- /**
287
- * Hook that gets executed before the suite starts
288
- * @param {Object} suite suite details
289
- */
290
- // beforeSuite: function (suite) {
291
- // },
292
- /**
293
- * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
294
- * @param {Object} test test details
295
- */
296
- // beforeTest: function (test) {
297
- // },
298
- /**
299
- * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
300
- * beforeEach in Mocha)
301
- */
302
- // beforeHook: function () {
303
- // },
304
- /**
305
- * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
306
- * afterEach in Mocha)
307
- */
308
- // afterHook: function () {
309
- // },
310
- /**
311
- * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
312
- * @param {Object} test test details
313
- */
314
- // afterTest: function (test) {
315
- // },
316
- /**
317
- * Hook that gets executed after the suite has ended
318
- * @param {Object} suite suite details
319
- */
320
- // afterSuite: function (suite) {
321
- // },
322
-
323
- /**
324
- * Runs after a WebdriverIO command gets executed
325
- * @param {String} commandName hook command name
326
- * @param {Array} args arguments that command would receive
327
- * @param {Number} result 0 - command success, 1 - command error
328
- * @param {Object} error error object if any
329
- */
330
- afterCommand: async function (commandName, args, result, error) {
331
-
332
- // url -> set configuration first
333
- if (commandName === "url" && !args[0].includes("do-not-change-configuration")) {
334
- await browser.executeAsync(function(done) {
335
- window["sap-ui-webcomponents-bundle"].configuration.setNoConflict(true);
336
- done();
337
- });
338
- }
339
-
340
- const waitFor = [
341
- "addValue",
342
- "clearValue",
343
- "click",
344
- "doubleClick",
345
- "dragAndDrop",
346
- "pause",
347
- "removeAttribute", // custom
348
- "scrollIntoView",
349
- "setAttribute", // custom
350
- "setProperty", // custom
351
- "setValue",
352
- "setWindowSize",
353
- "touchAction",
354
- "url",
355
- ];
356
-
357
- const waitForWithDelay = [
358
- "keys",
359
- ];
360
-
361
- if (waitFor.includes(commandName)) {
362
- await browser.executeAsync(function (done) {
363
- window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
364
- });
365
- } else if (waitForWithDelay.includes(commandName)) {
366
- await browser.executeAsync(function (done) {
367
- setTimeout(() => {
368
- window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
369
- }, 10);
370
- });
371
- }
372
- },
373
- /**
374
- * Gets executed after all tests are done. You still have access to all global variables from
375
- * the test.
376
- * @param {Number} result 0 - test pass, 1 - test fail
377
- * @param {Array.<Object>} capabilities list of capabilities details
378
- * @param {Array.<String>} specs List of spec file paths that ran
379
- */
380
- // after: function (result, capabilities, specs) {
381
- // },
382
- /**
383
- * Gets executed right after terminating the webdriver session.
384
- * @param {Object} config wdio configuration object
385
- * @param {Array.<Object>} capabilities list of capabilities details
386
- * @param {Array.<String>} specs List of spec file paths that ran
387
- */
388
- // afterSession: function (config, capabilities, specs) {
389
- // },
390
- /**
391
- * Gets executed after all workers got shut down and the process is about to exit.
392
- * @param {Object} exitCode 0 - success, 1 - fail
393
- * @param {Object} config wdio configuration object
394
- * @param {Array.<Object>} capabilities list of capabilities details
395
- * @param {<Object>} results object containing test results
396
- */
397
- // onComplete: function(exitCode, config, capabilities, results) {
398
- // },
399
- /**
400
- * Gets executed when a refresh happens.
401
- * @param {String} oldSessionId session ID of the old session
402
- * @param {String} newSessionId session ID of the new session
403
- */
404
- //onReload: function(oldSessionId, newSessionId) {
405
- //}
406
- }
1
+ const dns = require("node:dns");
2
+
3
+ exports.config = {
4
+ //
5
+ // ====================
6
+ // Runner Configuration
7
+ // ====================
8
+ //
9
+ // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or
10
+ // on a remote machine).
11
+ runner: 'local',
12
+
13
+ //
14
+ // ==================
15
+ // Specify Test Files
16
+ // ==================
17
+ // Define which test specs should run. The pattern is relative to the directory
18
+ // from which `wdio` was called. Notice that, if you are calling `wdio` from an
19
+ // NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
20
+ // directory is where your package.json resides, so `wdio` will be called from there.
21
+ //
22
+ specs: [
23
+ './test/specs/**/*.js'
24
+ ],
25
+ // Patterns to exclude.
26
+ exclude: [
27
+ // 'path/to/excluded/files'
28
+ ],
29
+ //
30
+ // ============
31
+ // Capabilities
32
+ // ============
33
+ // Define your capabilities here. WebdriverIO can run multiple capabilities at the same
34
+ // time. Depending on the number of capabilities, WebdriverIO launches several test
35
+ // sessions. Within your capabilities you can overwrite the spec and exclude options in
36
+ // order to group specific specs to a specific capability.
37
+ //
38
+ // First, you can define how many instances should be started at the same time. Let's
39
+ // say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
40
+ // set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
41
+ // files and you set maxInstances to 10, all spec files will get tested at the same time
42
+ // and 30 processes will get spawned. The property handles how many capabilities
43
+ // from the same test should run tests.
44
+ //
45
+ maxInstances: 10,
46
+ //
47
+ // If you have trouble getting all important capabilities together, check out the
48
+ // Sauce Labs platform configurator - a great tool to configure your capabilities:
49
+ // https://docs.saucelabs.com/reference/platforms-configurator
50
+ //
51
+ capabilities: [{
52
+ // maxInstances can get overwritten per capability. So if you have an in-house Selenium
53
+ // grid with only 5 firefox instances available you can make sure that not more than
54
+ // 5 instances get started at a time.
55
+ maxInstances: 5,
56
+ //
57
+ browserName: 'chrome',
58
+ 'goog:chromeOptions': {
59
+ // to run chrome headless the following flags are required
60
+ // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
61
+ args: [
62
+ '--headless',
63
+ '--disable-search-engine-choice-screen',
64
+ '--start-maximized',
65
+ '--no-sandbox',
66
+ '--disable-gpu',
67
+ '--disable-infobars',
68
+ '--disable-extensions',
69
+ '--disable-dev-shm-usage',
70
+ ],
71
+ // args: ['--disable-gpu'],
72
+ }
73
+ }],
74
+ //
75
+ // port to find chromedriver
76
+ port: 9515, // default
77
+ // ===================
78
+ // Test Configurations
79
+ // ===================
80
+ // Define all options that are relevant for the WebdriverIO instance here
81
+ //
82
+ // Level of logging verbosity: trace | debug | info | warn | error
83
+ logLevel: 'error',
84
+ //
85
+ // Warns when a deprecated command is used
86
+ deprecationWarnings: true,
87
+ //
88
+ // If you only want to run your tests until a specific amount of tests have failed use
89
+ // bail (default is 0 - don't bail, run all tests).
90
+ bail: 0,
91
+ //
92
+ // Set a base URL in order to shorten url command calls. If your `url` parameter starts
93
+ // with `/`, the base url gets prepended, not including the path portion of your baseUrl.
94
+ // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
95
+ // gets prepended directly.
96
+ baseUrl: 'http://localhost:4567', // This is important since WDIO 7+ does not accept an empty string for baseUrl
97
+ path: '',
98
+ //
99
+ // Default timeout for all waitFor* commands.
100
+ waitforTimeout: 10000,
101
+ //
102
+ // Default timeout in milliseconds for request
103
+ // if Selenium Grid doesn't send response
104
+ connectionRetryTimeout: 90000,
105
+ //
106
+ // Default request retries count
107
+ connectionRetryCount: 3,
108
+ //
109
+ // Test runner services
110
+ // Services take over a specific job you don't want to take care of. They enhance
111
+ // your test setup with almost no effort. Unlike plugins, they don't add new
112
+ // commands. Instead, they hook themselves up into the test process.
113
+ services: ['chromedriver', ['static-server', {
114
+ folders: [
115
+ { mount: '/', path: './dist' },
116
+ ],
117
+ port: '4567',
118
+ }],
119
+ ],
120
+ // options
121
+ chromeDriverArgs: ['--port=9515'], // default
122
+ // Framework you want to run your specs with.
123
+ // The following are supported: Mocha, Jasmine, and Cucumber
124
+ // see also: https://webdriver.io/docs/frameworks.html
125
+ //
126
+ // Make sure you have the wdio adapter package for the specific framework installed
127
+ // before running any tests.
128
+ framework: 'mocha',
129
+ //
130
+ // Test reporter for stdout.
131
+ // The only one supported by default is 'dot'
132
+ // see also: https://webdriver.io/docs/dot-reporter.html
133
+ reporters: ['dot', 'spec'],
134
+
135
+ //
136
+ // Options to be passed to Mocha.
137
+ // See the full list at http://mochajs.org/
138
+ mochaOpts: {
139
+ ui: 'bdd',
140
+ timeout: 60000
141
+ },
142
+ //
143
+ // =====
144
+ // Hooks
145
+ // =====
146
+ // WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
147
+ // it and to build services around it. You can either apply a single function or an array of
148
+ // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
149
+ // resolved to continue.
150
+ /**
151
+ * Gets executed once before all workers get launched.
152
+ * @param {Object} config wdio configuration object
153
+ * @param {Array.<Object>} capabilities list of capabilities details
154
+ */
155
+ // onPrepare: function (config, capabilities) {
156
+ // },
157
+ /**
158
+ * Gets executed just before initialising the webdriver session and test framework. It allows you
159
+ * to manipulate configurations depending on the capability or spec.
160
+ * @param {Object} config wdio configuration object
161
+ * @param {Array.<Object>} capabilities list of capabilities details
162
+ * @param {Array.<String>} specs List of spec file paths that are to be run
163
+ */
164
+ // beforeSession: function (config, capabilities, specs) {
165
+ // },
166
+ beforeSession: () => {
167
+ dns.setDefaultResultOrder('ipv4first');
168
+ },
169
+ /**
170
+ * Gets executed before test execution begins. At this point you can access to all global
171
+ * variables like `browser`. It is the perfect place to define custom commands.
172
+ * @param {Array.<Object>} capabilities list of capabilities details
173
+ * @param {Array.<String>} specs List of spec file paths that are to be run
174
+ */
175
+ before: async function (capabilities, specs) {
176
+ await browser.addCommand("isFocusedDeep", async function () {
177
+ return browser.executeAsync(function (elem, done) {
178
+ let activeElement = document.activeElement;
179
+
180
+ while (activeElement.shadowRoot) {
181
+ if (activeElement.shadowRoot.activeElement) {
182
+ activeElement = activeElement.shadowRoot.activeElement;
183
+ } else {
184
+ break;
185
+ }
186
+ }
187
+ done(elem === activeElement);
188
+ }, this);
189
+ }, true);
190
+
191
+ await browser.addCommand("isFocusedDeepElement", async function (element) {
192
+ return browser.executeAsync(function (elem, element, done) {
193
+ let activeElement = document.activeElement;
194
+
195
+ while (activeElement.shadowRoot) {
196
+ if (activeElement.shadowRoot.activeElement) {
197
+ activeElement = activeElement.shadowRoot.activeElement;
198
+ } else {
199
+ break;
200
+ }
201
+ }
202
+ done(element === activeElement);
203
+ }, this, element);
204
+ }, true);
205
+
206
+ await browser.addCommand("setProperty", async function(property, value) {
207
+ return browser.executeAsync((elem, property, value, done) => {
208
+ elem[property] = value;
209
+ done();
210
+ }, this, property, value);
211
+ }, true);
212
+
213
+ await browser.addCommand("setAttribute", async function(attribute, value) {
214
+ return browser.executeAsync((elem, attribute, value, done) => {
215
+ elem.setAttribute(attribute, value);
216
+ done();
217
+ }, this, attribute, value);
218
+ }, true);
219
+
220
+ await browser.addCommand("removeAttribute", async function(attribute) {
221
+ return browser.executeAsync((elem, attribute, done) => {
222
+ elem.removeAttribute(attribute);
223
+ done();
224
+ }, this, attribute);
225
+ }, true);
226
+
227
+ await browser.addCommand("hasClass", async function(className) {
228
+ return browser.executeAsync((elem, className, done) => {
229
+ done(elem.classList.contains(className));
230
+ }, this, className);
231
+ }, true);
232
+
233
+ await browser.addCommand("hasAttribute", async function(attrName) {
234
+ return browser.executeAsync((elem, attrName, done) => {
235
+ done(elem.hasAttribute(attrName));
236
+ }, this, attrName);
237
+ }, true);
238
+
239
+ await browser.addCommand("getStaticAreaItemClassName", async function(selector) {
240
+ return browser.executeAsync(async (selector, done) => {
241
+ const staticAreaItem = await document.querySelector(selector).getStaticAreaItemDomRef();
242
+ done(staticAreaItem.host.classList[0]);
243
+ }, selector);
244
+ }, false);
245
+
246
+ await browser.addLocatorStrategy('activeElement', (selector) => {
247
+ return document.querySelector(selector).shadowRoot.activeElement;
248
+ });
249
+ },
250
+ /**
251
+ * Runs before a WebdriverIO command gets executed.
252
+ * @param {String} commandName hook command name
253
+ * @param {Array} args arguments that command would receive
254
+ */
255
+ beforeCommand: async function (commandName, args) {
256
+ const waitFor = [
257
+ "$",
258
+ "$$",
259
+ "getAttribute",
260
+ "hasAttribute", // custom
261
+ "getCSSProperty",
262
+ "getHTML",
263
+ "getProperty",
264
+ "getSize",
265
+ "getStaticAreaItemClassName", // custom
266
+ "getText",
267
+ "getValue",
268
+ "hasClass", // custom
269
+ "isDisplayed",
270
+ "isDisplayedInViewport",
271
+ "isEnabled",
272
+ "isExisting",
273
+ "isFocused",
274
+ "isFocusedDeep", // custom
275
+ "isFocusedDeepElement", // custom
276
+ "shadow$",
277
+ "shadow$$",
278
+ ];
279
+ if (waitFor.includes(commandName)) {
280
+ await browser.executeAsync(function (done) {
281
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
282
+ });
283
+ }
284
+ },
285
+
286
+ /**
287
+ * Hook that gets executed before the suite starts
288
+ * @param {Object} suite suite details
289
+ */
290
+ // beforeSuite: function (suite) {
291
+ // },
292
+ /**
293
+ * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
294
+ * @param {Object} test test details
295
+ */
296
+ // beforeTest: function (test) {
297
+ // },
298
+ /**
299
+ * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
300
+ * beforeEach in Mocha)
301
+ */
302
+ // beforeHook: function () {
303
+ // },
304
+ /**
305
+ * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling
306
+ * afterEach in Mocha)
307
+ */
308
+ // afterHook: function () {
309
+ // },
310
+ /**
311
+ * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
312
+ * @param {Object} test test details
313
+ */
314
+ // afterTest: function (test) {
315
+ // },
316
+ /**
317
+ * Hook that gets executed after the suite has ended
318
+ * @param {Object} suite suite details
319
+ */
320
+ // afterSuite: function (suite) {
321
+ // },
322
+
323
+ /**
324
+ * Runs after a WebdriverIO command gets executed
325
+ * @param {String} commandName hook command name
326
+ * @param {Array} args arguments that command would receive
327
+ * @param {Number} result 0 - command success, 1 - command error
328
+ * @param {Object} error error object if any
329
+ */
330
+ afterCommand: async function (commandName, args, result, error) {
331
+
332
+ // url -> set configuration first
333
+ if (commandName === "url" && !args[0].includes("do-not-change-configuration")) {
334
+ await browser.executeAsync(function(done) {
335
+ window["sap-ui-webcomponents-bundle"].configuration.setNoConflict(true);
336
+ done();
337
+ });
338
+ }
339
+
340
+ const waitFor = [
341
+ "addValue",
342
+ "clearValue",
343
+ "click",
344
+ "doubleClick",
345
+ "dragAndDrop",
346
+ "pause",
347
+ "removeAttribute", // custom
348
+ "scrollIntoView",
349
+ "setAttribute", // custom
350
+ "setProperty", // custom
351
+ "setValue",
352
+ "setWindowSize",
353
+ "touchAction",
354
+ "url",
355
+ ];
356
+
357
+ const waitForWithDelay = [
358
+ "keys",
359
+ ];
360
+
361
+ if (waitFor.includes(commandName)) {
362
+ await browser.executeAsync(function (done) {
363
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
364
+ });
365
+ } else if (waitForWithDelay.includes(commandName)) {
366
+ await browser.executeAsync(function (done) {
367
+ setTimeout(() => {
368
+ window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
369
+ }, 10);
370
+ });
371
+ }
372
+ },
373
+ /**
374
+ * Gets executed after all tests are done. You still have access to all global variables from
375
+ * the test.
376
+ * @param {Number} result 0 - test pass, 1 - test fail
377
+ * @param {Array.<Object>} capabilities list of capabilities details
378
+ * @param {Array.<String>} specs List of spec file paths that ran
379
+ */
380
+ // after: function (result, capabilities, specs) {
381
+ // },
382
+ /**
383
+ * Gets executed right after terminating the webdriver session.
384
+ * @param {Object} config wdio configuration object
385
+ * @param {Array.<Object>} capabilities list of capabilities details
386
+ * @param {Array.<String>} specs List of spec file paths that ran
387
+ */
388
+ // afterSession: function (config, capabilities, specs) {
389
+ // },
390
+ /**
391
+ * Gets executed after all workers got shut down and the process is about to exit.
392
+ * @param {Object} exitCode 0 - success, 1 - fail
393
+ * @param {Object} config wdio configuration object
394
+ * @param {Array.<Object>} capabilities list of capabilities details
395
+ * @param {<Object>} results object containing test results
396
+ */
397
+ // onComplete: function(exitCode, config, capabilities, results) {
398
+ // },
399
+ /**
400
+ * Gets executed when a refresh happens.
401
+ * @param {String} oldSessionId session ID of the old session
402
+ * @param {String} newSessionId session ID of the new session
403
+ */
404
+ //onReload: function(oldSessionId, newSessionId) {
405
+ //}
406
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "1.24.14",
3
+ "version": "1.24.16",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -81,5 +81,5 @@
81
81
  "esbuild": "^0.19.9",
82
82
  "yargs": "^17.5.1"
83
83
  },
84
- "gitHead": "daa060cd1fef57d639aee0e60cdc750dc1b648b8"
84
+ "gitHead": "cc63db28ffc71bf5a25b118b08cbaad0443e6e46"
85
85
  }