@qavajs/create 2.1.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 +5 -0
- package/README.md +5 -1
- package/lib/deps.js +4 -11
- package/lib/install.js +0 -18
- package/package.json +6 -6
- package/src/deps.ts +3 -13
- package/src/install.ts +1 -20
- package/templates/config.ejs +0 -8
package/CHANGELOG.MD
CHANGED
|
@@ -5,9 +5,14 @@ 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
|
+
|
|
11
16
|
## [2.1.0]
|
|
12
17
|
- :rocket: removed yarn-install dependency
|
|
13
18
|
|
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.
|
|
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
|
@@ -93,20 +93,10 @@ function install() {
|
|
|
93
93
|
formats: yield (0, prompts_1.checkbox)({
|
|
94
94
|
message: 'select formatters (reporters) to install:',
|
|
95
95
|
choices: packs(deps_1.format)
|
|
96
|
-
}),
|
|
97
|
-
modules: yield (0, prompts_1.checkbox)({
|
|
98
|
-
message: 'select modules to install:',
|
|
99
|
-
choices: packs(deps_1.modules)
|
|
100
|
-
}),
|
|
101
|
-
additionalModules: yield (0, prompts_1.checkbox)({
|
|
102
|
-
message: 'select additional modules to install:',
|
|
103
|
-
choices: packs(deps_1.additionalModules)
|
|
104
96
|
})
|
|
105
97
|
};
|
|
106
98
|
const stepsPackages = ['@qavajs/steps-memory@2', ...packages(answers.steps, deps_1.steps)];
|
|
107
99
|
const formatPackages = packages(answers.formats, deps_1.format);
|
|
108
|
-
const modulePackages = packages(answers.modules, deps_1.modules);
|
|
109
|
-
const additionalPackages = packages(answers.additionalModules, deps_1.additionalModules);
|
|
110
100
|
const isTypescript = answers.moduleSystem === 'Typescript';
|
|
111
101
|
const isWdioIncluded = answers.steps.includes('wdio');
|
|
112
102
|
const isPlaywrightIncluded = answers.steps.includes('playwright');
|
|
@@ -116,7 +106,6 @@ function install() {
|
|
|
116
106
|
throw new Error('Please select only one browser driver');
|
|
117
107
|
}
|
|
118
108
|
const isPOIncluded = isWdioIncluded || isPlaywrightIncluded;
|
|
119
|
-
const isTemplateIncluded = answers.modules.includes('template');
|
|
120
109
|
// add gitignore
|
|
121
110
|
const gitignoreTemplate = yield (0, promises_1.readFile)((0, node_path_1.resolve)(__dirname, '../templates/gitignore'), 'utf-8');
|
|
122
111
|
yield (0, promises_1.writeFile)(`./.gitignore`, gitignoreTemplate, 'utf-8');
|
|
@@ -138,13 +127,11 @@ function install() {
|
|
|
138
127
|
const config = configEjs({
|
|
139
128
|
steps: JSON.stringify([...stepsPackagesGlobs, stepDefinitionGlob]),
|
|
140
129
|
moduleSystem: answers.moduleSystem,
|
|
141
|
-
modules: JSON.stringify(modulePackages),
|
|
142
130
|
format: JSON.stringify(deps_1.format
|
|
143
131
|
.filter(p => formatPackages.includes(p.packageName))
|
|
144
132
|
.map(p => p.out ? [p.packageName, p.out] : p.packageName)),
|
|
145
133
|
isWdioIncluded,
|
|
146
134
|
isPlaywrightIncluded,
|
|
147
|
-
isTemplateIncluded
|
|
148
135
|
});
|
|
149
136
|
yield (0, fs_extra_1.ensureDir)('./features');
|
|
150
137
|
yield (0, fs_extra_1.ensureDir)('./memory');
|
|
@@ -178,9 +165,6 @@ function install() {
|
|
|
178
165
|
const featureFile = featureEjs();
|
|
179
166
|
yield (0, promises_1.writeFile)('./features/qavajsApi.feature', replaceNewLines(featureFile), 'utf-8');
|
|
180
167
|
}
|
|
181
|
-
if (isTemplateIncluded) {
|
|
182
|
-
yield (0, fs_extra_1.ensureDir)('./templates');
|
|
183
|
-
}
|
|
184
168
|
yield (0, promises_1.writeFile)(`config.${isTypescript ? 'ts' : 'js'}`, replaceNewLines(config), 'utf-8');
|
|
185
169
|
const memoryTemplate = yield (0, promises_1.readFile)((0, node_path_1.resolve)(__dirname, '../templates/memory.ejs'), 'utf-8');
|
|
186
170
|
const memoryEjs = (0, ejs_1.compile)(memoryTemplate);
|
|
@@ -198,8 +182,6 @@ function install() {
|
|
|
198
182
|
...requiredDeps,
|
|
199
183
|
...stepsPackages,
|
|
200
184
|
...formatPackages,
|
|
201
|
-
...modulePackages,
|
|
202
|
-
...additionalPackages
|
|
203
185
|
];
|
|
204
186
|
console.log('installing packages...');
|
|
205
187
|
console.log(modulesToInstall);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qavajs/create",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "initializer of @qavajs project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"author": "Alexandr Galichenko",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@inquirer/prompts": "^7.
|
|
23
|
+
"@inquirer/prompts": "^7.5.1",
|
|
24
24
|
"ejs": "^3.1.10",
|
|
25
25
|
"fs-extra": "^11.3.0",
|
|
26
|
-
"typescript": "^5.
|
|
26
|
+
"typescript": "^5.8.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/ejs": "^3.1.5",
|
|
30
30
|
"@types/fs-extra": "^11.0.4",
|
|
31
|
-
"@types/node": "^22.
|
|
32
|
-
"@vitest/coverage-v8": "^3.
|
|
33
|
-
"vitest": "^3.
|
|
31
|
+
"@types/node": "^22.15.18",
|
|
32
|
+
"@vitest/coverage-v8": "^3.1.3",
|
|
33
|
+
"vitest": "^3.1.3"
|
|
34
34
|
}
|
|
35
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
|
@@ -8,7 +8,7 @@ function installModules({ deps, cwd }: { deps: any[], cwd: string }) {
|
|
|
8
8
|
execSync(`npm install ${modules}`, { cwd });
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
import deps, { steps, format,
|
|
11
|
+
import deps, { steps, format, ModuleDefinition } from './deps';
|
|
12
12
|
import { compile } from 'ejs';
|
|
13
13
|
import { select, checkbox } from '@inquirer/prompts';
|
|
14
14
|
|
|
@@ -51,21 +51,11 @@ export default async function install(): Promise<void> {
|
|
|
51
51
|
formats: await checkbox({
|
|
52
52
|
message: 'select formatters (reporters) to install:',
|
|
53
53
|
choices: packs(format)
|
|
54
|
-
}),
|
|
55
|
-
modules: await checkbox({
|
|
56
|
-
message: 'select modules to install:',
|
|
57
|
-
choices: packs(modules)
|
|
58
|
-
}),
|
|
59
|
-
additionalModules: await checkbox({
|
|
60
|
-
message: 'select additional modules to install:',
|
|
61
|
-
choices: packs(additionalModules)
|
|
62
54
|
})
|
|
63
55
|
};
|
|
64
56
|
|
|
65
57
|
const stepsPackages: Array<string> = ['@qavajs/steps-memory@2', ...packages(answers.steps, steps)];
|
|
66
58
|
const formatPackages: Array<string> = packages(answers.formats, format);
|
|
67
|
-
const modulePackages: Array<string> = packages(answers.modules, modules);
|
|
68
|
-
const additionalPackages: Array<string> = packages(answers.additionalModules, additionalModules);
|
|
69
59
|
|
|
70
60
|
const isTypescript = answers.moduleSystem === 'Typescript';
|
|
71
61
|
const isWdioIncluded = answers.steps.includes('wdio');
|
|
@@ -76,7 +66,6 @@ export default async function install(): Promise<void> {
|
|
|
76
66
|
throw new Error('Please select only one browser driver');
|
|
77
67
|
}
|
|
78
68
|
const isPOIncluded: boolean = isWdioIncluded || isPlaywrightIncluded;
|
|
79
|
-
const isTemplateIncluded: boolean = answers.modules.includes('template');
|
|
80
69
|
|
|
81
70
|
// add gitignore
|
|
82
71
|
const gitignoreTemplate = await readFile(
|
|
@@ -112,7 +101,6 @@ export default async function install(): Promise<void> {
|
|
|
112
101
|
const config = configEjs({
|
|
113
102
|
steps: JSON.stringify([...stepsPackagesGlobs, stepDefinitionGlob]),
|
|
114
103
|
moduleSystem: answers.moduleSystem,
|
|
115
|
-
modules: JSON.stringify(modulePackages),
|
|
116
104
|
format: JSON.stringify(
|
|
117
105
|
format
|
|
118
106
|
.filter(p => formatPackages.includes(p.packageName))
|
|
@@ -120,7 +108,6 @@ export default async function install(): Promise<void> {
|
|
|
120
108
|
),
|
|
121
109
|
isWdioIncluded,
|
|
122
110
|
isPlaywrightIncluded,
|
|
123
|
-
isTemplateIncluded
|
|
124
111
|
});
|
|
125
112
|
|
|
126
113
|
await ensureDir('./features');
|
|
@@ -165,10 +152,6 @@ export default async function install(): Promise<void> {
|
|
|
165
152
|
await writeFile('./features/qavajsApi.feature', replaceNewLines(featureFile), 'utf-8');
|
|
166
153
|
}
|
|
167
154
|
|
|
168
|
-
if (isTemplateIncluded) {
|
|
169
|
-
await ensureDir('./templates');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
155
|
await writeFile(`config.${isTypescript ? 'ts' : 'js'}`, replaceNewLines(config), 'utf-8');
|
|
173
156
|
|
|
174
157
|
const memoryTemplate: string = await readFile(
|
|
@@ -197,8 +180,6 @@ export default async function install(): Promise<void> {
|
|
|
197
180
|
...requiredDeps,
|
|
198
181
|
...stepsPackages,
|
|
199
182
|
...formatPackages,
|
|
200
|
-
...modulePackages,
|
|
201
|
-
...additionalPackages
|
|
202
183
|
];
|
|
203
184
|
console.log('installing packages...');
|
|
204
185
|
console.log(modulesToInstall);
|
package/templates/config.ejs
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
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) {%>
|
|
@@ -18,9 +17,6 @@
|
|
|
18
17
|
<%-` }`%>
|
|
19
18
|
<%-` },`%>
|
|
20
19
|
<% }%>
|
|
21
|
-
<% if (isTemplateIncluded) {%>
|
|
22
|
-
<%-` templates: ["templates/*.feature"]`%>,
|
|
23
|
-
<% }%>
|
|
24
20
|
<%-` }`%>
|
|
25
21
|
<%-`}`%>
|
|
26
22
|
<% }-%>
|
|
@@ -32,7 +28,6 @@
|
|
|
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) {%>
|
|
@@ -43,8 +38,5 @@
|
|
|
43
38
|
<%-` }`%>
|
|
44
39
|
<%-` },`%>
|
|
45
40
|
<% }%>
|
|
46
|
-
<% if (isTemplateIncluded) {%>
|
|
47
|
-
<%-` templates: ["templates/*.feature"]`%>,
|
|
48
|
-
<% }%>
|
|
49
41
|
<%-`}`%>
|
|
50
42
|
<% }%>
|