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