@qavajs/create 2.0.0 → 2.2.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
@@ -5,9 +5,20 @@ All notable changes to the "@qavajs/create" will be documented in this file.
5
5
  Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6
6
 
7
7
  :rocket: - new feature
8
+
8
9
  :beetle: - bugfix
10
+
9
11
  :x: - deprecation
10
12
 
13
+ ## [2.2.0]
14
+ - :x: removed template and soft assertion
15
+
16
+ ## [2.1.0]
17
+ - :rocket: removed yarn-install dependency
18
+
19
+ ## [2.0.0]
20
+ - :rocket: release v2
21
+
11
22
  ## [1.0.0]
12
23
  - :rocket: release
13
24
 
package/README.md CHANGED
@@ -1,2 +1,6 @@
1
- # create
1
+ # @qavajs/create
2
+ @qavajs/create is a CLI tool that streamlines the initialization of test automation projects using the qavajs framework. It facilitates the setup of a modular, low-code test automation environment tailored for UI and API testing across web and mobile platforms.
3
+
4
+ ```
2
5
  npm init @qavajs
6
+ ```
package/lib/deps.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.additionalModules = exports.modules = exports.format = exports.steps = void 0;
3
+ exports.format = exports.steps = void 0;
4
4
  exports.default = [
5
5
  '@cucumber/cucumber',
6
6
  '@qavajs/core@2'
@@ -11,9 +11,10 @@ exports.steps = [
11
11
  { module: 'api', packageName: '@qavajs/steps-api', version: '2' },
12
12
  { module: 'files', packageName: '@qavajs/steps-files', version: '2' },
13
13
  { module: 'sql', packageName: '@qavajs/steps-sql', version: '2' },
14
- { module: 'accessibility', packageName: '@qavajs/steps-accessibility', version: '2' },
15
14
  { module: 'lighthouse', packageName: '@qavajs/steps-lighthouse', version: '2' },
16
- { module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' }
15
+ { module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' },
16
+ { module: 'accessibility (axe)', packageName: '@qavajs/steps-accessibility' },
17
+ { module: 'accessibility (equal access)', packageName: '@qavajs/steps-accessibility-ea' },
17
18
  ];
18
19
  exports.format = [
19
20
  { module: 'report portal', packageName: '@qavajs/format-report-portal', out: 'report/rp.out' },
@@ -21,11 +22,3 @@ exports.format = [
21
22
  { module: 'html', packageName: '@qavajs/html-formatter', out: 'report/report.html' },
22
23
  { module: 'jira xray', packageName: '@qavajs/xray-formatter', out: 'report/xray.out' },
23
24
  ];
24
- exports.modules = [
25
- { module: 'template', packageName: '@qavajs/template' },
26
- { module: 'soft-assertion', packageName: '@qavajs/soft-assertion' },
27
- ];
28
- exports.additionalModules = [
29
- { module: 'wdio service adapter', packageName: '@qavajs/wdio-service-adapter' },
30
- { module: 'webstorm adapter', packageName: '@qavajs/webstorm-adapter' },
31
- ];
package/lib/install.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -31,15 +41,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
42
  });
33
43
  };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
44
  Object.defineProperty(exports, "__esModule", { value: true });
38
45
  exports.default = install;
39
46
  const promises_1 = require("node:fs/promises");
40
47
  const fs_extra_1 = require("fs-extra");
41
48
  const node_path_1 = require("node:path");
42
- const yarn_install_1 = __importDefault(require("yarn-install"));
49
+ const node_child_process_1 = require("node:child_process");
50
+ function installModules({ deps, cwd }) {
51
+ const modules = deps.join(' ');
52
+ (0, node_child_process_1.execSync)(`npm install ${modules}`, { cwd });
53
+ }
43
54
  const deps_1 = __importStar(require("./deps"));
44
55
  const ejs_1 = require("ejs");
45
56
  const prompts_1 = require("@inquirer/prompts");
@@ -82,20 +93,10 @@ function install() {
82
93
  formats: yield (0, prompts_1.checkbox)({
83
94
  message: 'select formatters (reporters) to install:',
84
95
  choices: packs(deps_1.format)
85
- }),
86
- modules: yield (0, prompts_1.checkbox)({
87
- message: 'select modules to install:',
88
- choices: packs(deps_1.modules)
89
- }),
90
- additionalModules: yield (0, prompts_1.checkbox)({
91
- message: 'select additional modules to install:',
92
- choices: packs(deps_1.additionalModules)
93
96
  })
94
97
  };
95
98
  const stepsPackages = ['@qavajs/steps-memory@2', ...packages(answers.steps, deps_1.steps)];
96
99
  const formatPackages = packages(answers.formats, deps_1.format);
97
- const modulePackages = packages(answers.modules, deps_1.modules);
98
- const additionalPackages = packages(answers.additionalModules, deps_1.additionalModules);
99
100
  const isTypescript = answers.moduleSystem === 'Typescript';
100
101
  const isWdioIncluded = answers.steps.includes('wdio');
101
102
  const isPlaywrightIncluded = answers.steps.includes('playwright');
@@ -105,7 +106,6 @@ function install() {
105
106
  throw new Error('Please select only one browser driver');
106
107
  }
107
108
  const isPOIncluded = isWdioIncluded || isPlaywrightIncluded;
108
- const isTemplateIncluded = answers.modules.includes('template');
109
109
  // add gitignore
110
110
  const gitignoreTemplate = yield (0, promises_1.readFile)((0, node_path_1.resolve)(__dirname, '../templates/gitignore'), 'utf-8');
111
111
  yield (0, promises_1.writeFile)(`./.gitignore`, gitignoreTemplate, 'utf-8');
@@ -127,13 +127,11 @@ function install() {
127
127
  const config = configEjs({
128
128
  steps: JSON.stringify([...stepsPackagesGlobs, stepDefinitionGlob]),
129
129
  moduleSystem: answers.moduleSystem,
130
- modules: JSON.stringify(modulePackages),
131
130
  format: JSON.stringify(deps_1.format
132
131
  .filter(p => formatPackages.includes(p.packageName))
133
132
  .map(p => p.out ? [p.packageName, p.out] : p.packageName)),
134
133
  isWdioIncluded,
135
134
  isPlaywrightIncluded,
136
- isTemplateIncluded
137
135
  });
138
136
  yield (0, fs_extra_1.ensureDir)('./features');
139
137
  yield (0, fs_extra_1.ensureDir)('./memory');
@@ -167,9 +165,6 @@ function install() {
167
165
  const featureFile = featureEjs();
168
166
  yield (0, promises_1.writeFile)('./features/qavajsApi.feature', replaceNewLines(featureFile), 'utf-8');
169
167
  }
170
- if (isTemplateIncluded) {
171
- yield (0, fs_extra_1.ensureDir)('./templates');
172
- }
173
168
  yield (0, promises_1.writeFile)(`config.${isTypescript ? 'ts' : 'js'}`, replaceNewLines(config), 'utf-8');
174
169
  const memoryTemplate = yield (0, promises_1.readFile)((0, node_path_1.resolve)(__dirname, '../templates/memory.ejs'), 'utf-8');
175
170
  const memoryEjs = (0, ejs_1.compile)(memoryTemplate);
@@ -187,15 +182,12 @@ function install() {
187
182
  ...requiredDeps,
188
183
  ...stepsPackages,
189
184
  ...formatPackages,
190
- ...modulePackages,
191
- ...additionalPackages
192
185
  ];
193
186
  console.log('installing packages...');
194
187
  console.log(modulesToInstall);
195
- (0, yarn_install_1.default)({
188
+ installModules({
196
189
  deps: modulesToInstall,
197
- cwd: process.cwd(),
198
- respectNpm5: true
190
+ cwd: process.cwd()
199
191
  });
200
192
  console.log('test script:');
201
193
  console.log(`npx qavajs --config config.${isTypescript ? 'ts' : 'js'}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qavajs/create",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "initializer of @qavajs project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,17 +20,16 @@
20
20
  "author": "Alexandr Galichenko",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@inquirer/prompts": "^7.0.1",
23
+ "@inquirer/prompts": "^7.5.1",
24
24
  "ejs": "^3.1.10",
25
- "fs-extra": "^11.2.0",
26
- "typescript": "^5.6.3",
27
- "yarn-install": "^1.0.0"
25
+ "fs-extra": "^11.3.0",
26
+ "typescript": "^5.8.3"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@types/ejs": "^3.1.5",
31
30
  "@types/fs-extra": "^11.0.4",
32
- "@types/node": "^22.8.2",
33
- "@vitest/coverage-v8": "^2.1.4",
34
- "vitest": "^2.1.4"
31
+ "@types/node": "^22.15.18",
32
+ "@vitest/coverage-v8": "^3.1.3",
33
+ "vitest": "^3.1.3"
35
34
  }
36
35
  }
package/src/deps.ts CHANGED
@@ -16,9 +16,10 @@ export const steps: Array<ModuleDefinition> = [
16
16
  { module: 'api', packageName: '@qavajs/steps-api', version: '2' },
17
17
  { module: 'files', packageName: '@qavajs/steps-files', version: '2' },
18
18
  { module: 'sql', packageName: '@qavajs/steps-sql', version: '2' },
19
- { module: 'accessibility', packageName: '@qavajs/steps-accessibility', version: '2' },
20
19
  { module: 'lighthouse', packageName: '@qavajs/steps-lighthouse', version: '2'},
21
- { module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' }
20
+ { module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' },
21
+ { module: 'accessibility (axe)', packageName: '@qavajs/steps-accessibility' },
22
+ { module: 'accessibility (equal access)', packageName: '@qavajs/steps-accessibility-ea' },
22
23
  ]
23
24
 
24
25
  export const format: Array<ModuleDefinition> = [
@@ -27,14 +28,3 @@ export const format: Array<ModuleDefinition> = [
27
28
  { module: 'html', packageName: '@qavajs/html-formatter', out: 'report/report.html' },
28
29
  { module: 'jira xray', packageName: '@qavajs/xray-formatter', out: 'report/xray.out' },
29
30
  ]
30
-
31
- export const modules: Array<ModuleDefinition> = [
32
- { module: 'template', packageName: '@qavajs/template' },
33
- { module: 'soft-assertion', packageName: '@qavajs/soft-assertion' },
34
- ]
35
-
36
- export const additionalModules: Array<ModuleDefinition> = [
37
- { module: 'wdio service adapter', packageName: '@qavajs/wdio-service-adapter' },
38
- { module: 'webstorm adapter', packageName: '@qavajs/webstorm-adapter' },
39
- ]
40
-
package/src/install.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  import { readFile, writeFile } from 'node:fs/promises';
2
2
  import { ensureDir } from 'fs-extra';
3
3
  import { resolve } from 'node:path';
4
- import yarnInstall from 'yarn-install';
5
- import deps, { steps, format, modules, additionalModules, ModuleDefinition } from './deps';
4
+ import { execSync } from 'node:child_process';
5
+
6
+ function installModules({ deps, cwd }: { deps: any[], cwd: string }) {
7
+ const modules = deps.join(' ');
8
+ execSync(`npm install ${modules}`, { cwd });
9
+ }
10
+
11
+ import deps, { steps, format, ModuleDefinition } from './deps';
6
12
  import { compile } from 'ejs';
7
13
  import { select, checkbox } from '@inquirer/prompts';
8
14
 
@@ -45,21 +51,11 @@ export default async function install(): Promise<void> {
45
51
  formats: await checkbox({
46
52
  message: 'select formatters (reporters) to install:',
47
53
  choices: packs(format)
48
- }),
49
- modules: await checkbox({
50
- message: 'select modules to install:',
51
- choices: packs(modules)
52
- }),
53
- additionalModules: await checkbox({
54
- message: 'select additional modules to install:',
55
- choices: packs(additionalModules)
56
54
  })
57
55
  };
58
56
 
59
57
  const stepsPackages: Array<string> = ['@qavajs/steps-memory@2', ...packages(answers.steps, steps)];
60
58
  const formatPackages: Array<string> = packages(answers.formats, format);
61
- const modulePackages: Array<string> = packages(answers.modules, modules);
62
- const additionalPackages: Array<string> = packages(answers.additionalModules, additionalModules);
63
59
 
64
60
  const isTypescript = answers.moduleSystem === 'Typescript';
65
61
  const isWdioIncluded = answers.steps.includes('wdio');
@@ -70,7 +66,6 @@ export default async function install(): Promise<void> {
70
66
  throw new Error('Please select only one browser driver');
71
67
  }
72
68
  const isPOIncluded: boolean = isWdioIncluded || isPlaywrightIncluded;
73
- const isTemplateIncluded: boolean = answers.modules.includes('template');
74
69
 
75
70
  // add gitignore
76
71
  const gitignoreTemplate = await readFile(
@@ -106,7 +101,6 @@ export default async function install(): Promise<void> {
106
101
  const config = configEjs({
107
102
  steps: JSON.stringify([...stepsPackagesGlobs, stepDefinitionGlob]),
108
103
  moduleSystem: answers.moduleSystem,
109
- modules: JSON.stringify(modulePackages),
110
104
  format: JSON.stringify(
111
105
  format
112
106
  .filter(p => formatPackages.includes(p.packageName))
@@ -114,7 +108,6 @@ export default async function install(): Promise<void> {
114
108
  ),
115
109
  isWdioIncluded,
116
110
  isPlaywrightIncluded,
117
- isTemplateIncluded
118
111
  });
119
112
 
120
113
  await ensureDir('./features');
@@ -159,10 +152,6 @@ export default async function install(): Promise<void> {
159
152
  await writeFile('./features/qavajsApi.feature', replaceNewLines(featureFile), 'utf-8');
160
153
  }
161
154
 
162
- if (isTemplateIncluded) {
163
- await ensureDir('./templates');
164
- }
165
-
166
155
  await writeFile(`config.${isTypescript ? 'ts' : 'js'}`, replaceNewLines(config), 'utf-8');
167
156
 
168
157
  const memoryTemplate: string = await readFile(
@@ -191,16 +180,13 @@ export default async function install(): Promise<void> {
191
180
  ...requiredDeps,
192
181
  ...stepsPackages,
193
182
  ...formatPackages,
194
- ...modulePackages,
195
- ...additionalPackages
196
183
  ];
197
184
  console.log('installing packages...');
198
185
  console.log(modulesToInstall);
199
186
 
200
- yarnInstall({
187
+ installModules({
201
188
  deps: modulesToInstall,
202
- cwd: process.cwd(),
203
- respectNpm5: true
189
+ cwd: process.cwd()
204
190
  });
205
191
 
206
192
  console.log('test script:');
@@ -7,20 +7,16 @@
7
7
  <%-` default: {`%>
8
8
  <%-` paths: ["features/**/*.feature"],`%>
9
9
  <%-` require: `%><%-steps%>,
10
- <%-` requireModule: `%><%-modules%>,
11
10
  <%-` format: `%><%-format%>,
12
11
  <%-` memory: new Memory()`%>,
13
12
  <% if (isPlaywrightIncluded || isWdioIncluded) {%>
14
- <%-` pageObject: App`%>,
13
+ <%-` pageObject: new App()`%>,
15
14
  <%-` browser: {`%>
16
15
  <%-` capabilities: {`%>
17
16
  <%-` browserName: `%><% if (isWdioIncluded) {%><%-'"chrome"'%><%} else {%><%-'"chromium"'%><%}%>
18
17
  <%-` }`%>
19
18
  <%-` },`%>
20
19
  <% }%>
21
- <% if (isTemplateIncluded) {%>
22
- <%-` templates: ["templates/*.feature"]`%>,
23
- <% }%>
24
20
  <%-` }`%>
25
21
  <%-`}`%>
26
22
  <% }-%>
@@ -32,19 +28,15 @@
32
28
  <%-`export default {`%>
33
29
  <%-` paths: ["features/**/*.feature"],`%>
34
30
  <% if (moduleSystem === 'ES Modules') {%><%-` import: `%><% } else { %><%-` require: `%><% }-%><%-steps%>,
35
- <%-` requireModule: `%><%-modules%>,
36
31
  <%-` format: `%><%-format%>,
37
32
  <%-` memory: new Memory()`%>,
38
33
  <% if (isPlaywrightIncluded || isWdioIncluded) {%>
39
- <%-` pageObject: App`%>,
34
+ <%-` pageObject: new App()`%>,
40
35
  <%-` browser: {`%>
41
36
  <%-` capabilities: {`%>
42
37
  <%-` browserName: `%><% if (isWdioIncluded) {%><%-'"chrome"'%><%} else {%><%-'"chromium"'%><%}%>
43
38
  <%-` }`%>
44
39
  <%-` },`%>
45
40
  <% }%>
46
- <% if (isTemplateIncluded) {%>
47
- <%-` templates: ["templates/*.feature"]`%>,
48
- <% }%>
49
41
  <%-`}`%>
50
42
  <% }%>
@@ -1,17 +0,0 @@
1
- declare module 'yarn-install' {
2
- export default function yarnInstall(
3
- params: {
4
- deps: string[]
5
- cwd?: string
6
- registry?: string
7
- dev?: boolean
8
- global?: boolean
9
- remove?: boolean
10
- production?: boolean
11
- respectNpm5?: boolean
12
- }
13
- ): {
14
- stderr: string
15
- status: number
16
- }
17
- }