Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ All notable changes to the "@qavajs/create" will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

:rocket: - new feature

:beetle: - bugfix

:x: - deprecation

## [2.2.0]
- :x: removed template and soft assertion

## [2.1.0]
- :rocket: removed yarn-install dependency

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# create
# @qavajs/create
@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.

```
npm init @qavajs
```
873 changes: 505 additions & 368 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"author": "Alexandr Galichenko",
"license": "MIT",
"dependencies": {
"@inquirer/prompts": "^7.2.3",
"@inquirer/prompts": "^7.5.1",
"ejs": "^3.1.10",
"fs-extra": "^11.3.0",
"typescript": "^5.7.3"
"typescript": "^5.8.3"
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.10.7",
"@vitest/coverage-v8": "^3.0.1",
"vitest": "^3.0.1"
"@types/node": "^22.15.18",
"@vitest/coverage-v8": "^3.1.3",
"vitest": "^3.1.3"
}
}
16 changes: 3 additions & 13 deletions src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ export const steps: Array<ModuleDefinition> = [
{ module: 'api', packageName: '@qavajs/steps-api', version: '2' },
{ module: 'files', packageName: '@qavajs/steps-files', version: '2' },
{ module: 'sql', packageName: '@qavajs/steps-sql', version: '2' },
{ module: 'accessibility', packageName: '@qavajs/steps-accessibility', version: '2' },
{ module: 'lighthouse', packageName: '@qavajs/steps-lighthouse', version: '2'},
{ module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' }
{ module: 'visual testing', packageName: '@qavajs/steps-visual-testing', version: '2' },
{ module: 'accessibility (axe)', packageName: '@qavajs/steps-accessibility' },
{ module: 'accessibility (equal access)', packageName: '@qavajs/steps-accessibility-ea' },
]

export const format: Array<ModuleDefinition> = [
Expand All @@ -27,14 +28,3 @@ export const format: Array<ModuleDefinition> = [
{ module: 'html', packageName: '@qavajs/html-formatter', out: 'report/report.html' },
{ module: 'jira xray', packageName: '@qavajs/xray-formatter', out: 'report/xray.out' },
]

export const modules: Array<ModuleDefinition> = [
{ module: 'template', packageName: '@qavajs/template' },
{ module: 'soft-assertion', packageName: '@qavajs/soft-assertion' },
]

export const additionalModules: Array<ModuleDefinition> = [
{ module: 'wdio service adapter', packageName: '@qavajs/wdio-service-adapter' },
{ module: 'webstorm adapter', packageName: '@qavajs/webstorm-adapter' },
]

21 changes: 1 addition & 20 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function installModules({ deps, cwd }: { deps: any[], cwd: string }) {
execSync(`npm install ${modules}`, { cwd });
}

import deps, { steps, format, modules, additionalModules, ModuleDefinition } from './deps';
import deps, { steps, format, ModuleDefinition } from './deps';
import { compile } from 'ejs';
import { select, checkbox } from '@inquirer/prompts';

Expand Down Expand Up @@ -51,21 +51,11 @@ export default async function install(): Promise<void> {
formats: await checkbox({
message: 'select formatters (reporters) to install:',
choices: packs(format)
}),
modules: await checkbox({
message: 'select modules to install:',
choices: packs(modules)
}),
additionalModules: await checkbox({
message: 'select additional modules to install:',
choices: packs(additionalModules)
})
};

const stepsPackages: Array<string> = ['@qavajs/steps-memory@2', ...packages(answers.steps, steps)];
const formatPackages: Array<string> = packages(answers.formats, format);
const modulePackages: Array<string> = packages(answers.modules, modules);
const additionalPackages: Array<string> = packages(answers.additionalModules, additionalModules);

const isTypescript = answers.moduleSystem === 'Typescript';
const isWdioIncluded = answers.steps.includes('wdio');
Expand All @@ -76,7 +66,6 @@ export default async function install(): Promise<void> {
throw new Error('Please select only one browser driver');
}
const isPOIncluded: boolean = isWdioIncluded || isPlaywrightIncluded;
const isTemplateIncluded: boolean = answers.modules.includes('template');

// add gitignore
const gitignoreTemplate = await readFile(
Expand Down Expand Up @@ -112,15 +101,13 @@ export default async function install(): Promise<void> {
const config = configEjs({
steps: JSON.stringify([...stepsPackagesGlobs, stepDefinitionGlob]),
moduleSystem: answers.moduleSystem,
modules: JSON.stringify(modulePackages),
format: JSON.stringify(
format
.filter(p => formatPackages.includes(p.packageName))
.map(p => p.out ? [p.packageName, p.out] : p.packageName)
),
isWdioIncluded,
isPlaywrightIncluded,
isTemplateIncluded
});

await ensureDir('./features');
Expand Down Expand Up @@ -165,10 +152,6 @@ export default async function install(): Promise<void> {
await writeFile('./features/qavajsApi.feature', replaceNewLines(featureFile), 'utf-8');
}

if (isTemplateIncluded) {
await ensureDir('./templates');
}

await writeFile(`config.${isTypescript ? 'ts' : 'js'}`, replaceNewLines(config), 'utf-8');

const memoryTemplate: string = await readFile(
Expand Down Expand Up @@ -197,8 +180,6 @@ export default async function install(): Promise<void> {
...requiredDeps,
...stepsPackages,
...formatPackages,
...modulePackages,
...additionalPackages
];
console.log('installing packages...');
console.log(modulesToInstall);
Expand Down
8 changes: 0 additions & 8 deletions templates/config.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<%-` default: {`%>
<%-` paths: ["features/**/*.feature"],`%>
<%-` require: `%><%-steps%>,
<%-` requireModule: `%><%-modules%>,
<%-` format: `%><%-format%>,
<%-` memory: new Memory()`%>,
<% if (isPlaywrightIncluded || isWdioIncluded) {%>
Expand All @@ -18,9 +17,6 @@
<%-` }`%>
<%-` },`%>
<% }%>
<% if (isTemplateIncluded) {%>
<%-` templates: ["templates/*.feature"]`%>,
<% }%>
<%-` }`%>
<%-`}`%>
<% }-%>
Expand All @@ -32,7 +28,6 @@
<%-`export default {`%>
<%-` paths: ["features/**/*.feature"],`%>
<% if (moduleSystem === 'ES Modules') {%><%-` import: `%><% } else { %><%-` require: `%><% }-%><%-steps%>,
<%-` requireModule: `%><%-modules%>,
<%-` format: `%><%-format%>,
<%-` memory: new Memory()`%>,
<% if (isPlaywrightIncluded || isWdioIncluded) {%>
Expand All @@ -43,8 +38,5 @@
<%-` }`%>
<%-` },`%>
<% }%>
<% if (isTemplateIncluded) {%>
<%-` templates: ["templates/*.feature"]`%>,
<% }%>
<%-`}`%>
<% }%>
Loading