@wdio/cli 8.0.6 → 8.0.8
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/build/commands/config.d.ts.map +1 -1
- package/build/commands/config.js +4 -3
- package/build/interface.js +1 -1
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +19 -17
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIrE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,QAAQ,aAAa,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIrE,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,eAAO,MAAM,IAAI,4EAA4E,CAAA;AAE7F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBV,CAAA;AAEV,eAAO,MAAM,OAAO,UAAW,IAAI;;;;;;;;;;;;;;;;;;GAKlC,CAAA;AAED,eAAO,MAAM,YAAY,QAAwB,OAAO,KAAG,QAAQ,aAAa,CAiF/E,CAAA;AAED,wBAAsB,gBAAgB,CAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAkBrG;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,sBAAsB,EAAE,YAAY,0BAAmB;;;;GAQ1F;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,UAAQ,EAAE,YAAY,0BAAmB,8BA2BlI"}
|
package/build/commands/config.js
CHANGED
|
@@ -67,7 +67,7 @@ export const parseAnswers = async function (yes) {
|
|
|
67
67
|
/**
|
|
68
68
|
* if we have autogenerated spec files, put the tsconfig one above the spec file dir
|
|
69
69
|
*/
|
|
70
|
-
? path.resolve(path.dirname(answers.specs.split(
|
|
70
|
+
? path.resolve(path.dirname(answers.specs.split(path.sep).filter((s) => !s.includes('*')).join(path.sep)), 'tsconfig.json')
|
|
71
71
|
/**
|
|
72
72
|
* if no spec files are auto generated, create a wdio tsconfig and let the user deal with it
|
|
73
73
|
*/
|
|
@@ -90,7 +90,8 @@ export const parseAnswers = async function (yes) {
|
|
|
90
90
|
reporters: reporterPackages.map(({ short }) => short),
|
|
91
91
|
plugins: pluginPackages.map(({ short }) => short),
|
|
92
92
|
services: servicePackages.map(({ short }) => short),
|
|
93
|
-
specs: answers.specs &&
|
|
93
|
+
specs: answers.specs && `./${path.relative(projectRootDir, answers.specs).replaceAll(path.sep, '/')}`,
|
|
94
|
+
stepDefinitions: answers.stepDefinitions && `./${path.relative(projectRootDir, answers.stepDefinitions).replaceAll(path.sep, '/')}`,
|
|
94
95
|
packagesToInstall,
|
|
95
96
|
isUsingTypeScript,
|
|
96
97
|
isUsingBabel: answers.isUsingCompiler === COMPILER_OPTIONS.babel,
|
|
@@ -103,7 +104,7 @@ export const parseAnswers = async function (yes) {
|
|
|
103
104
|
destPageObjectRootPath: parsedPaths.destPageObjectRootPath,
|
|
104
105
|
relativePath: parsedPaths.relativePath,
|
|
105
106
|
tsConfigFilePath,
|
|
106
|
-
tsProject:
|
|
107
|
+
tsProject: `./${path.relative(projectRootDir, tsConfigFilePath).replaceAll(path.sep, '/')}`,
|
|
107
108
|
wdioConfigPath
|
|
108
109
|
};
|
|
109
110
|
};
|
package/build/interface.js
CHANGED
|
@@ -3,7 +3,7 @@ import chalk, { supportsColor } from 'chalk';
|
|
|
3
3
|
import logger from '@wdio/logger';
|
|
4
4
|
import { getRunnerName } from './utils.js';
|
|
5
5
|
const log = logger('@wdio/cli');
|
|
6
|
-
const EVENT_FILTER = ['sessionStarted', 'sessionEnded', '
|
|
6
|
+
const EVENT_FILTER = ['sessionStarted', 'sessionEnded', 'finishedCommand'];
|
|
7
7
|
export default class WDIOCLInterface extends EventEmitter {
|
|
8
8
|
_config;
|
|
9
9
|
totalWorkerCnt;
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,EAAmB,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAalE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAMlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,EAAmB,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAalE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAMlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,E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E,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QA6CzF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAE,aAAa,EAAE,aAAa,iBAuClE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAE,aAAa,EAAE,aAAa,iBA4C7D;AAED,wBAAsB,gBAAgB,CAAE,aAAa,EAAE,aAAa,iBAgBnE;AAED,wBAAsB,gBAAgB,CAAE,aAAa,EAAE,aAAa,iBAWnE"}
|
package/build/utils.js
CHANGED
|
@@ -20,6 +20,7 @@ import { CAPABILITY_KEYS } from '@wdio/protocols';
|
|
|
20
20
|
import { EXCLUSIVE_SERVICES, ANDROID_CONFIG, IOS_CONFIG, QUESTIONNAIRE, COMMUNITY_PACKAGES_WITH_V8_SUPPORT, pkg, COMPILER_OPTIONS, TESTING_LIBRARY_PACKAGES, DEPENDENCIES_INSTALLATION_MESSAGE } from './constants.js';
|
|
21
21
|
const log = logger('@wdio/cli:utils');
|
|
22
22
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
const NPM_COMMAND = /^win/.test(process.platform) ? 'npm.cmd' : 'npm';
|
|
23
24
|
const VERSION_REGEXP = /(\d+)\.(\d+)\.(\d+)-(alpha|beta|)\.(\d+)\+(.+)/g;
|
|
24
25
|
const TEMPLATE_ROOT_DIR = path.join(__dirname, 'templates', 'exampleFiles');
|
|
25
26
|
export const renderFile = promisify(ejs.renderFile);
|
|
@@ -161,15 +162,22 @@ export function replaceConfig(config, type, name) {
|
|
|
161
162
|
}
|
|
162
163
|
export function addServiceDeps(names, packages, update = false) {
|
|
163
164
|
/**
|
|
164
|
-
* automatically install latest Chromedriver if `wdio-chromedriver-service`
|
|
165
|
-
* was selected for install
|
|
165
|
+
* automatically install latest Chromedriver if `wdio-chromedriver-service` was selected for install
|
|
166
166
|
*/
|
|
167
167
|
if (names.some(({ short }) => short === 'chromedriver')) {
|
|
168
168
|
packages.push('chromedriver');
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* automatically install latest Geckodriver if `wdio-geckodriver-service` was selected for install
|
|
172
|
+
*/
|
|
173
|
+
if (names.some(({ short }) => short === 'geckodriver')) {
|
|
174
|
+
packages.push('geckodriver');
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* automatically install latest EdgeDriver if `wdio-edgedriver-service` was selected for install
|
|
178
|
+
*/
|
|
179
|
+
if (names.some(({ short }) => short === 'edgedriver')) {
|
|
180
|
+
packages.push('msedgedriver');
|
|
173
181
|
}
|
|
174
182
|
/**
|
|
175
183
|
* install Appium if it is not installed globally if `@wdio/appium-service`
|
|
@@ -327,10 +335,10 @@ export async function generateTestFiles(answers) {
|
|
|
327
335
|
const isJSX = answers.preset && ['preact', 'react'].includes(answers.preset);
|
|
328
336
|
const fileEnding = (answers.isUsingTypeScript ? '.ts' : '.js') + (isJSX ? 'x' : '');
|
|
329
337
|
let destPath = (file.endsWith('page.js.ejs')
|
|
330
|
-
?
|
|
338
|
+
? path.join(answers.destPageObjectRootPath, path.basename(file))
|
|
331
339
|
: file.includes('step_definition')
|
|
332
|
-
?
|
|
333
|
-
:
|
|
340
|
+
? answers.stepDefinitions
|
|
341
|
+
: path.join(answers.destSpecRootPath, path.basename(file))).replace(/\.ejs$/, '').replace(/\.js$/, fileEnding);
|
|
334
342
|
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
335
343
|
await fs.writeFile(destPath, renderedTpl);
|
|
336
344
|
}
|
|
@@ -417,17 +425,11 @@ export function getPathForFileGeneration(answers, projectRootDir) {
|
|
|
417
425
|
? path.relative(destSpecRootPath, destPageObjectRootPath)
|
|
418
426
|
: path.relative(destStepRootPath, destPageObjectRootPath)
|
|
419
427
|
: '';
|
|
420
|
-
/**
|
|
421
|
-
* On Windows, path.relative can return backslashes that could be interpreted as espace sequences in strings
|
|
422
|
-
*/
|
|
423
|
-
if (process.platform === 'win32') {
|
|
424
|
-
relativePath = relativePath.replace(/\\/g, '/');
|
|
425
|
-
}
|
|
426
428
|
return {
|
|
427
429
|
destSpecRootPath: destSpecRootPath,
|
|
428
430
|
destStepRootPath: destStepRootPath,
|
|
429
431
|
destPageObjectRootPath: destPageObjectRootPath,
|
|
430
|
-
relativePath: relativePath
|
|
432
|
+
relativePath: relativePath.replaceAll(path.sep, '/')
|
|
431
433
|
};
|
|
432
434
|
}
|
|
433
435
|
export async function getDefaultFiles(answers, pattern) {
|
|
@@ -656,7 +658,7 @@ export async function createWDIOScript(parsedAnswers) {
|
|
|
656
658
|
try {
|
|
657
659
|
console.log(`Adding ${chalk.bold('"wdio"')} script to package.json.`);
|
|
658
660
|
const script = `wdio run ./${path.join('.', parsedAnswers.wdioConfigPath.replace(projectProps?.path || process.cwd(), ''))}`;
|
|
659
|
-
await runProgram(
|
|
661
|
+
await runProgram(NPM_COMMAND, ['pkg', 'set', `scripts.wdio=${script}`], { cwd: parsedAnswers.projectRootDir });
|
|
660
662
|
console.log(chalk.green.bold('✔ Success!'));
|
|
661
663
|
}
|
|
662
664
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.8",
|
|
4
4
|
"description": "WebdriverIO testrunner command line interface",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/lodash.union": "^4.6.7",
|
|
41
41
|
"@types/recursive-readdir": "^2.2.1",
|
|
42
42
|
"@types/yargs": "^17.0.10",
|
|
43
|
-
"@wdio/config": "8.0.
|
|
44
|
-
"@wdio/globals": "8.0.
|
|
43
|
+
"@wdio/config": "8.0.8",
|
|
44
|
+
"@wdio/globals": "8.0.8",
|
|
45
45
|
"@wdio/logger": "8.0.0",
|
|
46
46
|
"@wdio/protocols": "8.0.0",
|
|
47
|
-
"@wdio/types": "8.0.
|
|
48
|
-
"@wdio/utils": "8.0.
|
|
47
|
+
"@wdio/types": "8.0.8",
|
|
48
|
+
"@wdio/utils": "8.0.8",
|
|
49
49
|
"async-exit-hook": "^2.0.1",
|
|
50
50
|
"chalk": "^5.0.1",
|
|
51
51
|
"chokidar": "^3.5.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"mkdirp": "^1.0.4",
|
|
60
60
|
"read-pkg-up": "9.1.0",
|
|
61
61
|
"recursive-readdir": "^2.2.2",
|
|
62
|
-
"webdriverio": "8.0.
|
|
62
|
+
"webdriverio": "8.0.8",
|
|
63
63
|
"yargs": "^17.5.1",
|
|
64
64
|
"yarn-install": "^1.0.0"
|
|
65
65
|
},
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "^18.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c07255fefc67137fd27f23da5f0792c10157f8c0"
|
|
73
73
|
}
|