@zohodesk/testinglibrary 0.0.3 → 0.0.5
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/README.md +17 -17
- package/bin/cli.js +1 -1
- package/bin/postinstall.js +15 -15
- package/changelog.md +25 -15
- package/jest.config.js +63 -63
- package/npm-shrinkwrap.json +5772 -5772
- package/package.json +30 -30
- package/playwright.config.js +112 -112
- package/src/core/jest/preprocessor/jsPreprocessor.js +9 -9
- package/src/core/jest/runner/jest-runner.js +44 -44
- package/src/core/jest/setup/index.js +165 -165
- package/src/core/playwright/codegen.js +60 -60
- package/src/core/playwright/custom-commands.js +2 -2
- package/src/core/playwright/env-initializer.js +23 -23
- package/src/core/playwright/index.js +81 -81
- package/src/core/playwright/readConfigFile.js +62 -29
- package/src/core/playwright/report-generator.js +44 -42
- package/src/core/playwright/setup/config-creator.js +77 -79
- package/src/core/playwright/test-runner.js +67 -64
- package/src/index.js +8 -8
- package/src/lib/cli.js +41 -34
- package/src/setup-folder-structure/env-config-sample.json +17 -0
- package/src/setup-folder-structure/setupProject.js +99 -0
- package/src/setup-folder-structure/uat-config-sample.js +22 -0
- package/src/setup-folder-structure/user-example.json +3 -0
- package/src/utils/cliArgsToObject.js +62 -34
- package/src/utils/getFilePath.js +8 -8
- package/src/utils/logger.js +27 -27
- package/src/utils/rootPath.js +50 -50
|
@@ -1,30 +1,63 @@
|
|
|
1
|
-
const { existsSync } = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
const { existsSync } = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { Logger } = require('../../utils/logger');
|
|
4
|
+
|
|
5
|
+
const fileName = 'uat.config.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents the user configuration object.
|
|
9
|
+
* @typedef {Object} UserConfig
|
|
10
|
+
* @property {string} headless - Headless Browsers mode.
|
|
11
|
+
* @property {number} trace - trace for test cases.
|
|
12
|
+
* @property {boolean} video - video for test cases,
|
|
13
|
+
* @property {boolean} debug - debug mode
|
|
14
|
+
* @property {string} mode: mode in which the test cases needs to run
|
|
15
|
+
* @property {boolean} isAuthMode - Auth Mode
|
|
16
|
+
* @property {any} browsers: List of browsers
|
|
17
|
+
* @property {string} openReportOn: default Option value (never, on-failure and always)
|
|
18
|
+
* @property {any} reportPath : directory where report is generate
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generates a configuration object from a file, if it exists.
|
|
24
|
+
*
|
|
25
|
+
* @returns {UserConfig}
|
|
26
|
+
*/
|
|
27
|
+
function generateConfigFromFile() {
|
|
28
|
+
const filePath = path.resolve(process.cwd(), fileName);
|
|
29
|
+
|
|
30
|
+
if (existsSync(filePath)) {
|
|
31
|
+
/** @type {UserConfig} */
|
|
32
|
+
const config = require(filePath);
|
|
33
|
+
return config;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isUserConfigFileAvailable() {
|
|
40
|
+
const filePath = path.resolve(process.cwd(), fileName);
|
|
41
|
+
if (existsSync(filePath)) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getAuthFilePath(filePath){
|
|
48
|
+
try{
|
|
49
|
+
if(existsSync(filePath)){
|
|
50
|
+
return filePath
|
|
51
|
+
}
|
|
52
|
+
}catch(err){
|
|
53
|
+
Logger.log(Logger.FAILURE_TYPE,`Founded Path - ${filePath} Authetication file not Exist ...`)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
fileName,
|
|
60
|
+
isUserConfigFileAvailable,
|
|
61
|
+
generateConfigFromFile,
|
|
62
|
+
getAuthFilePath
|
|
30
63
|
};
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
const { spawn } = require('child_process');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { Logger } = require('../../utils/logger');
|
|
4
|
-
const { getExecutableBinaryPath } = require('../../utils/rootPath');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
const { spawn } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { Logger } = require('../../utils/logger');
|
|
4
|
+
const { getExecutableBinaryPath } = require('../../utils/rootPath');
|
|
5
|
+
const { generateConfigFromFile } = require('./readConfigFile');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const userArgs = process.argv.slice(3);
|
|
9
|
+
|
|
10
|
+
const playwrightPath = path.resolve(getExecutableBinaryPath('playwright'));;
|
|
11
|
+
const command = playwrightPath;
|
|
12
|
+
const { reportPath : htmlPath = path.resolve(process.cwd(), './playwright-report') } = generateConfigFromFile()
|
|
13
|
+
const reportPath = htmlPath
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const args = ['show-report', htmlPath].concat(userArgs);
|
|
17
|
+
|
|
18
|
+
function generateReport() {
|
|
19
|
+
const childProcess = spawn(command, args, { stdio: 'inherit' });
|
|
20
|
+
childProcess.on('error', (error) => {
|
|
21
|
+
Logger.log(Logger.FAILURE_TYPE, error);
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
childProcess.on('exit', (code, signal) => {
|
|
25
|
+
Logger.log(Logger.FAILURE_TYPE, `Child Process Exited with Code ${code} and Signal ${signal}`);
|
|
26
|
+
|
|
27
|
+
process.exit();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
process.on('exit', () => {
|
|
31
|
+
Logger.log(Logger.INFO_TYPE, 'Terminating Playwright Process...');
|
|
32
|
+
childProcess.kill();
|
|
33
|
+
return;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
process.on('SIGINT', () => {
|
|
37
|
+
Logger.log(Logger.INFO_TYPE, 'Cleaning up...');
|
|
38
|
+
childProcess.kill();
|
|
39
|
+
process.exit();
|
|
40
|
+
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
43
45
|
module.exports = generateReport;
|
|
@@ -1,79 +1,77 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
const { defineConfig, devices } = require('@playwright/test');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { generateConfigFromFile } = require('../readConfigFile');
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let projects = browsers.map(browser => {
|
|
13
|
-
if (browser === 'Chrome') {
|
|
14
|
-
return {
|
|
15
|
-
name: 'chromium',
|
|
16
|
-
use: {
|
|
17
|
-
...devices['Desktop Chrome'],
|
|
18
|
-
storageState: isAuthMode ? path.resolve(process.cwd(), 'playwright/.auth/user.json') :
|
|
19
|
-
},
|
|
20
|
-
dependencies: isAuthMode ? ['setup'] : [],
|
|
21
|
-
};
|
|
22
|
-
} else if (browser === 'Firefox') {
|
|
23
|
-
return {
|
|
24
|
-
name: 'firefox',
|
|
25
|
-
timeout: 4 * 60 * 1000,
|
|
26
|
-
expect: {
|
|
27
|
-
timeout: 80 * 1000,
|
|
28
|
-
},
|
|
29
|
-
use: {
|
|
30
|
-
...devices['Desktop Firefox'],
|
|
31
|
-
storageState: isAuthMode ? path.resolve(process.cwd(), 'playwright/.auth/user.json') :
|
|
32
|
-
},
|
|
33
|
-
dependencies: isAuthMode ? ['setup'] : [],
|
|
34
|
-
};
|
|
35
|
-
} else if (browser === 'safari') {
|
|
36
|
-
return {
|
|
37
|
-
name: 'webkit',
|
|
38
|
-
timeout: 2 * 60 * 1000,
|
|
39
|
-
expect: {
|
|
40
|
-
timeout: 80 * 1000,
|
|
41
|
-
},
|
|
42
|
-
use: {
|
|
43
|
-
...devices['Desktop Safari'],
|
|
44
|
-
storageState: isAuthMode ? path.resolve(process.cwd(), 'playwright/.auth/user.json') :
|
|
45
|
-
},
|
|
46
|
-
dependencies: isAuthMode ? ['setup'] : null,
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}).filter(Boolean);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
|
|
1
|
+
// @ts-check
|
|
2
|
+
const { defineConfig, devices } = require('@playwright/test');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { generateConfigFromFile, getAuthFilePath } = require('../readConfigFile');
|
|
5
|
+
const { existsSync } = require('fs');
|
|
6
|
+
const numCPUs = require('os').cpus().length;
|
|
7
|
+
|
|
8
|
+
const defaultBrowser = ['Chrome']
|
|
9
|
+
|
|
10
|
+
const { browsers = defaultBrowser, trace = false, video = false, isAuthMode, openReportOn, reportPath = path.join(process.cwd(), 'playwright-report') } = generateConfigFromFile();
|
|
11
|
+
|
|
12
|
+
let projects = browsers.map(browser => {
|
|
13
|
+
if (browser === 'Chrome') {
|
|
14
|
+
return {
|
|
15
|
+
name: 'chromium',
|
|
16
|
+
use: {
|
|
17
|
+
...devices['Desktop Chrome'],
|
|
18
|
+
storageState: isAuthMode ? getAuthFilePath(path.resolve(process.cwd(), 'playwright/.auth/user.json')) : {}
|
|
19
|
+
},
|
|
20
|
+
dependencies: isAuthMode ? ['setup'] : [],
|
|
21
|
+
};
|
|
22
|
+
} else if (browser === 'Firefox') {
|
|
23
|
+
return {
|
|
24
|
+
name: 'firefox',
|
|
25
|
+
timeout: 4 * 60 * 1000,
|
|
26
|
+
expect: {
|
|
27
|
+
timeout: 80 * 1000,
|
|
28
|
+
},
|
|
29
|
+
use: {
|
|
30
|
+
...devices['Desktop Firefox'],
|
|
31
|
+
storageState: isAuthMode ? getAuthFilePath(path.resolve(process.cwd(), 'playwright/.auth/user.json')) : {}
|
|
32
|
+
},
|
|
33
|
+
dependencies: isAuthMode ? ['setup'] : [],
|
|
34
|
+
};
|
|
35
|
+
} else if (browser === 'safari') {
|
|
36
|
+
return {
|
|
37
|
+
name: 'webkit',
|
|
38
|
+
timeout: 2 * 60 * 1000,
|
|
39
|
+
expect: {
|
|
40
|
+
timeout: 80 * 1000,
|
|
41
|
+
},
|
|
42
|
+
use: {
|
|
43
|
+
...devices['Desktop Safari'],
|
|
44
|
+
storageState: isAuthMode ? getAuthFilePath(path.resolve(process.cwd(), 'playwright/.auth/user.json')) : {}
|
|
45
|
+
},
|
|
46
|
+
dependencies: isAuthMode ? ['setup'] : null,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}).filter(Boolean);
|
|
50
|
+
|
|
51
|
+
module.exports = defineConfig({
|
|
52
|
+
testDir: path.join(path.resolve(process.cwd()), 'uat'),
|
|
53
|
+
outputDir: path.join(process.cwd(), 'test-results'),
|
|
54
|
+
fullyParallel: true,
|
|
55
|
+
forbidOnly: !!process.env.CI,
|
|
56
|
+
retries: process.env.CI ? 2 : 0,
|
|
57
|
+
workers: process.env.CI ? 1 : 1,
|
|
58
|
+
reporter: [['html', { outputFolder: reportPath, open: openReportOn }]],
|
|
59
|
+
timeout: 60 * 1000,
|
|
60
|
+
expect: {
|
|
61
|
+
timeout: 5 * 1000,
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
use: {
|
|
65
|
+
trace: trace ? 'on' : 'off',
|
|
66
|
+
video: video ? {
|
|
67
|
+
mode: 'on',
|
|
68
|
+
size: { width: 640, height: 480 }
|
|
69
|
+
} : 'off'
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
projects: isAuthMode ? [
|
|
73
|
+
{ name: 'setup', testMatch: /.*\.setup\.js/ },
|
|
74
|
+
...projects
|
|
75
|
+
] : [...projects]
|
|
76
|
+
});
|
|
77
|
+
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
const { spawn } = require('child_process');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { CUSTOM_COMMANDS } = require('./custom-commands');
|
|
4
|
-
const { cliArgsToObject, objectToCliArgs } = require('../../utils/cliArgsToObject');
|
|
5
|
-
const { initializeEnvConfig } = require('./env-initializer');
|
|
6
|
-
const { Logger } = require('../../utils/logger');
|
|
7
|
-
const { isUserConfigFileAvailable } = require('./readConfigFile');
|
|
8
|
-
const { getExecutableBinaryPath } = require('../../utils/rootPath');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// Access the command line arguments
|
|
13
|
-
const userArgs = process.argv.slice(2);
|
|
14
|
-
|
|
15
|
-
const userArgsObject = cliArgsToObject(userArgs);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
const { spawn } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { CUSTOM_COMMANDS } = require('./custom-commands');
|
|
4
|
+
const { cliArgsToObject, objectToCliArgs } = require('../../utils/cliArgsToObject');
|
|
5
|
+
const { initializeEnvConfig } = require('./env-initializer');
|
|
6
|
+
const { Logger } = require('../../utils/logger');
|
|
7
|
+
const { isUserConfigFileAvailable, generateConfigFromFile } = require('./readConfigFile');
|
|
8
|
+
const { getExecutableBinaryPath } = require('../../utils/rootPath');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function createTestRunner() {
|
|
12
|
+
// Access the command line arguments
|
|
13
|
+
const userArgs = process.argv.slice(2);
|
|
14
|
+
|
|
15
|
+
const userArgsObject = cliArgsToObject(userArgs);
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const { debug, mode = 'dev' } = generateConfigFromFile();
|
|
19
|
+
|
|
20
|
+
// Environment variables Initialization
|
|
21
|
+
initializeEnvConfig(userArgsObject.mode ? userArgsObject.mode : mode);
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const playwrightArgs = objectToCliArgs(userArgsObject, (key) => !CUSTOM_COMMANDS.includes(key));
|
|
25
|
+
|
|
26
|
+
if (debug) {
|
|
27
|
+
playwrightArgs.push('--debug')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Command and arguments for npx playwright test
|
|
31
|
+
const playwrightPath = path.resolve(getExecutableBinaryPath('playwright'));
|
|
32
|
+
|
|
33
|
+
const command = playwrightPath;
|
|
34
|
+
|
|
35
|
+
const configPath = isUserConfigFileAvailable() ? require.resolve('./setup/config-creator.js') : require.resolve('../../../playwright.config.js');
|
|
36
|
+
|
|
37
|
+
const args = ['test', '--config', configPath].concat(playwrightArgs);
|
|
38
|
+
// Spawn the child process
|
|
39
|
+
|
|
40
|
+
const childProcess = spawn(command, args, { stdio: 'inherit' });
|
|
41
|
+
|
|
42
|
+
childProcess.on('error', (error) => {
|
|
43
|
+
Logger.log(Logger.FAILURE_TYPE, error);
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
childProcess.on('exit', (code, signal) => {
|
|
47
|
+
Logger.log(Logger.FAILURE_TYPE, `Child Process Exited with Code ${code} and Signal ${signal}`);
|
|
48
|
+
|
|
49
|
+
process.exit();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
process.on('exit', () => {
|
|
53
|
+
Logger.log(Logger.INFO_TYPE, 'Terminating Playwright Process...');
|
|
54
|
+
//childProcess.kill();
|
|
55
|
+
return;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
process.on('SIGINT', () => {
|
|
59
|
+
Logger.log(Logger.INFO_TYPE, 'Cleaning up...');
|
|
60
|
+
//childProcess.kill();
|
|
61
|
+
process.exit();
|
|
62
|
+
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
module.exports = createTestRunner;
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const { expect, test } = require('./core/playwright/index');
|
|
2
|
-
const { fireEvent, render } = require('@testing-library/react');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
expect,
|
|
6
|
-
test,
|
|
7
|
-
fireEvent,
|
|
8
|
-
render
|
|
1
|
+
const { expect, test } = require('./core/playwright/index');
|
|
2
|
+
const { fireEvent, render } = require('@testing-library/react');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
expect,
|
|
6
|
+
test,
|
|
7
|
+
fireEvent,
|
|
8
|
+
render
|
|
9
9
|
}
|
package/src/lib/cli.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
const createTestRunner = require("../core/playwright/test-runner");
|
|
2
|
-
const createJestRunner = require('../core/jest/runner/jest-runner');
|
|
3
|
-
const generateReport = require("../core/playwright/report-generator");
|
|
4
|
-
const generateCodegen = require('../core/playwright/codegen')
|
|
5
|
-
const { Logger } = require("../utils/logger");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
const createTestRunner = require("../core/playwright/test-runner");
|
|
2
|
+
const createJestRunner = require('../core/jest/runner/jest-runner');
|
|
3
|
+
const generateReport = require("../core/playwright/report-generator");
|
|
4
|
+
const generateCodegen = require('../core/playwright/codegen')
|
|
5
|
+
const { Logger } = require("../utils/logger");
|
|
6
|
+
const setupProject = require("../setup-folder-structure/setupProject");
|
|
7
|
+
|
|
8
|
+
const [, , option] = process.argv;
|
|
9
|
+
const args = process.argv.slice(3);
|
|
10
|
+
const appPath = process.cwd();
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
switch (option) {
|
|
14
|
+
case 'test': {
|
|
15
|
+
Logger.log(Logger.SUCCESS_TYPE, 'Running Tests..');
|
|
16
|
+
createTestRunner();
|
|
17
|
+
//createJestRunner();
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case 'report': {
|
|
21
|
+
// console.log('\x1b[36mGenerating Reports...\x1b[0m');
|
|
22
|
+
Logger.log(Logger.SUCCESS_TYPE, 'Generating Reports...');
|
|
23
|
+
generateReport();
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case 'codegen': {
|
|
27
|
+
Logger.log(Logger.INFO_TYPE, 'The purpose of codegen is to assist developer .....')
|
|
28
|
+
generateCodegen();
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
case 'init': {
|
|
33
|
+
Logger.log(Logger.SUCCESS_TYPE, 'Initializing projects...');
|
|
34
|
+
setupProject();
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
default: {
|
|
39
|
+
console.log('Supported Commands test and report')
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
35
42
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dev": {
|
|
3
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
4
|
+
"username": "your-username",
|
|
5
|
+
"password": "your-password"
|
|
6
|
+
},
|
|
7
|
+
"prod": {
|
|
8
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
9
|
+
"username": "your-username",
|
|
10
|
+
"password": "your-password"
|
|
11
|
+
},
|
|
12
|
+
"k8test": {
|
|
13
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
14
|
+
"username": "your-username",
|
|
15
|
+
"password": "your-password"
|
|
16
|
+
}
|
|
17
|
+
}
|