@thinkwise/testwise 0.1.63 → 0.1.65

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@thinkwise/testwise",
3
- "version": "0.1.63",
3
+ "version": "0.1.64-beta.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@thinkwise/testwise",
9
- "version": "0.1.63",
9
+ "version": "0.1.64-beta.0",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@types/node": "^22.15.29",
package/dist/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@thinkwise/testwise",
3
- "version": "0.1.63",
3
+ "version": "0.1.64-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "bin": {
7
- "testwise": "./scripts/add-config.js",
7
+ "testwise": "./scripts/main.js",
8
8
  "testwise-credentials": "./promptCredentials.js"
9
9
  },
10
10
  "scripts": {
11
11
  "lint": "eslint ./ --cache --ignore-pattern .gitignore",
12
12
  "format:fix": "run-s \"lint --fix\" && biome check --fix --unsafe",
13
- "format:check": "run-s \"lint \" && biome check"
13
+ "format:check": "run-s \"lint \" && biome check",
14
+ "postinstall": "node scripts/main.js install"
14
15
  },
15
16
  "keywords": [],
16
17
  "author": "",
@@ -22,7 +23,8 @@
22
23
  "chalk": "^5.4.1",
23
24
  "csv-parse": "^5.6.0",
24
25
  "dotenv": "^17.2.2",
25
- "prompts": "^2.4.2"
26
+ "prompts": "^2.4.2",
27
+ "ts-node": "^10.9.2"
26
28
  },
27
29
  "peerDependencies": {
28
30
  "@playwright/test": "^1.52.0"
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2016",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+ "typeRoots": ["./node_modules/@types", "./types"],
7
+ "resolveJsonModule": true,
8
+ "esModuleInterop": true,
9
+ "strict": true,
10
+ "skipLibCheck": true
11
+ }
12
+ }
@@ -3,11 +3,12 @@ import path from 'node:path';
3
3
  import dotenv from 'dotenv';
4
4
  class ConfigBuilder {
5
5
  constructor() {
6
- const configFilePath = path.resolve(process.cwd(), 'Testwise.json');
6
+ const baseDir = process.env.INIT_CWD || process.cwd();
7
+ const configFilePath = path.resolve(baseDir, 'Testwise.json');
7
8
  // Find all env files in the consuming project and apply them to process.env
8
- const envFiles = fs.readdirSync(process.cwd()).filter((file) => file.endsWith('.env'));
9
+ const envFiles = fs.readdirSync(baseDir).filter((file) => file.endsWith('.env'));
9
10
  for (const envFile of envFiles) {
10
- const envConfig = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), envFile)));
11
+ const envConfig = dotenv.parse(fs.readFileSync(path.resolve(baseDir, envFile)));
11
12
  Object.assign(process.env, envConfig);
12
13
  }
13
14
  if (!fs.existsSync(configFilePath)) {
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigBuilder.js","sourceRoot":"","sources":["../../services/ConfigBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,aAAa;IAGjB;QACE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;QAEpE,4EAA4E;QAC5E,MAAM,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QAEvF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CA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c,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAI,GAAW;QACvB,MAAM,MAAM,GAAG,GAAG;aACf,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CACL,CAAC,GAAwC,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAA4B,EAChG,IAAI,CAAC,MAAM,CACP,CAAC;QAET,+GAA+G;QAC/G,IAAI,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QAE9B,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAY,CAAC;YAChD,oEAAoE;YACpE,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,QAAkB,CAAM,CAAC;YAC7C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,QAAa,CAAC;YACvB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,IAAI,QAAQ,GAAyB,IAAI,CAAC;AAE1C,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;IACjC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@thinkwise/testwise",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "bin": {
7
- "testwise": "./scripts/add-config.js",
7
+ "testwise": "./scripts/main.js",
8
8
  "testwise-credentials": "./promptCredentials.js"
9
9
  },
10
10
  "scripts": {
@@ -25,7 +25,8 @@
25
25
  "prompts": "^2.4.2"
26
26
  },
27
27
  "peerDependencies": {
28
- "@playwright/test": "^1.52.0"
28
+ "@playwright/test": "^1.52.0",
29
+ "typescript": "^5.8.3"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@biomejs/biome": "^2.1.2",
@@ -1,124 +1,124 @@
1
- #!/usr/bin/env node
2
- import { spawnSync } from 'node:child_process';
3
- import { readFileSync } from 'node:fs';
4
- import process from 'node:process';
5
- import chalk from 'chalk';
6
- import prompts from 'prompts';
7
-
8
- const packageScripts = JSON.parse(readFileSync('./package.json')).scripts;
9
-
10
- function exitWithError(error) {
11
- console.log(chalk.red(error));
12
- process.exit(1);
13
- }
14
-
15
- function startTestSolution() {
16
- console.log('Now starting test solution...');
17
- spawnSync(`yarn --cwd ../ ${args.join(' ')}`, {
18
- shell: true,
19
- stdio: 'inherit'
20
- });
21
- process.exit();
22
- }
23
-
24
- const args = process.argv.slice(2);
25
-
26
- if (!args.length) {
27
- exitWithError('Error: Got too few parameters. Usage: yarn test:credentials test');
28
- }
29
-
30
- const yarnScriptToExec = args[0];
31
-
32
- if (!packageScripts[yarnScriptToExec]) {
33
- exitWithError(`Error: Given script "${yarnScriptToExec}" doesn't exist in package.json.`);
34
- }
35
-
36
- // INCOMING HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
- // temp fix to be reworked when converting this file to TS
38
- import fs from 'node:fs';
39
- import path from 'node:path';
40
-
41
- const indiciumURL = (() => {
42
- try {
43
- const configPath = path.resolve(process.cwd(), './Testwise.json');
44
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
45
- return config.environmentSettings?.serviceUrl || '';
46
- } catch (error) {
47
- console.error('Error reading Testwise.json:', error);
48
- return '';
49
- }
50
- })();
51
-
52
- // END OF HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
53
-
54
- if (process.env.SF_TEST_USERNAME && process.env.SF_TEST_PASSWORD) {
55
- console.log('Using SF_TEST_USERNAME and SF_TEST_PASSWORD environment variables.');
56
- startTestSolution();
57
- }
58
-
59
- const questions = [
60
- {
61
- type: 'text',
62
- name: 'username',
63
- message: 'Username:',
64
- validate: (value) => {
65
- if (!value?.length) {
66
- return 'Username is required';
67
- }
68
-
69
- if (value.toLowerCase() === 'demo') {
70
- return 'Running tests locally with demo is forbidden as it results in dataset concurrency problems';
71
- }
72
-
73
- return true;
74
- }
75
- },
76
- {
77
- type: 'invisible',
78
- name: 'password',
79
- message: 'Password:',
80
- validate: (value) => (!value?.length ? 'Password is required' : true)
81
- }
82
- ];
83
-
84
- (async () => {
85
- const credentialsResponse = await prompts(questions);
86
-
87
- if (!credentialsResponse || !credentialsResponse.username || !credentialsResponse.password) {
88
- exitWithError('Username or password was not given');
89
- }
90
-
91
- const { password, username } = credentialsResponse;
92
- const params = new URLSearchParams();
93
-
94
- params.append('UserName', username);
95
- params.append('Password', password);
96
-
97
- const fetch = (await import('node-fetch')).default;
98
- const authResponse = await fetch(`${indiciumURL}/account/api/login`, {
99
- method: 'POST',
100
- body: params
101
- });
102
-
103
- if (authResponse.status === 204) {
104
- console.log('Confirmed credentials work @', indiciumURL);
105
- } else {
106
- const confirmResponse = await prompts([
107
- {
108
- type: 'confirm',
109
- name: 'value',
110
- message: `Can't login to ${indiciumURL} with the given credentials. Continue anyways?`,
111
- initial: true
112
- }
113
- ]);
114
-
115
- if (!confirmResponse.value) {
116
- return;
117
- }
118
- }
119
-
120
- process.env.SF_TEST_USERNAME = username;
121
- process.env.SF_TEST_PASSWORD = password;
122
-
123
- startTestSolution();
124
- })();
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { readFileSync } from 'node:fs';
4
+ import process from 'node:process';
5
+ import chalk from 'chalk';
6
+ import prompts from 'prompts';
7
+
8
+ const packageScripts = JSON.parse(readFileSync('./package.json')).scripts;
9
+
10
+ function exitWithError(error) {
11
+ console.log(chalk.red(error));
12
+ process.exit(1);
13
+ }
14
+
15
+ function startTestSolution() {
16
+ console.log('Now starting test solution...');
17
+ spawnSync(`yarn --cwd ../ ${args.join(' ')}`, {
18
+ shell: true,
19
+ stdio: 'inherit'
20
+ });
21
+ process.exit();
22
+ }
23
+
24
+ const args = process.argv.slice(2);
25
+
26
+ if (!args.length) {
27
+ exitWithError('Error: Got too few parameters. Usage: yarn test:credentials test');
28
+ }
29
+
30
+ const yarnScriptToExec = args[0];
31
+
32
+ if (!packageScripts[yarnScriptToExec]) {
33
+ exitWithError(`Error: Given script "${yarnScriptToExec}" doesn't exist in package.json.`);
34
+ }
35
+
36
+ // INCOMING HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ // temp fix to be reworked when converting this file to TS
38
+ import fs from 'node:fs';
39
+ import path from 'node:path';
40
+
41
+ const indiciumURL = (() => {
42
+ try {
43
+ const configPath = path.resolve(process.cwd(), './Testwise.json');
44
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
45
+ return config.environmentSettings?.serviceUrl || '';
46
+ } catch (error) {
47
+ console.error('Error reading Testwise.json:', error);
48
+ return '';
49
+ }
50
+ })();
51
+
52
+ // END OF HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
53
+
54
+ if (process.env.SF_TEST_USERNAME && process.env.SF_TEST_PASSWORD) {
55
+ console.log('Using SF_TEST_USERNAME and SF_TEST_PASSWORD environment variables.');
56
+ startTestSolution();
57
+ }
58
+
59
+ const questions = [
60
+ {
61
+ type: 'text',
62
+ name: 'username',
63
+ message: 'Username:',
64
+ validate: (value) => {
65
+ if (!value?.length) {
66
+ return 'Username is required';
67
+ }
68
+
69
+ if (value.toLowerCase() === 'demo') {
70
+ return 'Running tests locally with demo is forbidden as it results in dataset concurrency problems';
71
+ }
72
+
73
+ return true;
74
+ }
75
+ },
76
+ {
77
+ type: 'invisible',
78
+ name: 'password',
79
+ message: 'Password:',
80
+ validate: (value) => (!value?.length ? 'Password is required' : true)
81
+ }
82
+ ];
83
+
84
+ (async () => {
85
+ const credentialsResponse = await prompts(questions);
86
+
87
+ if (!credentialsResponse || !credentialsResponse.username || !credentialsResponse.password) {
88
+ exitWithError('Username or password was not given');
89
+ }
90
+
91
+ const { password, username } = credentialsResponse;
92
+ const params = new URLSearchParams();
93
+
94
+ params.append('UserName', username);
95
+ params.append('Password', password);
96
+
97
+ const fetch = (await import('node-fetch')).default;
98
+ const authResponse = await fetch(`${indiciumURL}/account/api/login`, {
99
+ method: 'POST',
100
+ body: params
101
+ });
102
+
103
+ if (authResponse.status === 204) {
104
+ console.log('Confirmed credentials work @', indiciumURL);
105
+ } else {
106
+ const confirmResponse = await prompts([
107
+ {
108
+ type: 'confirm',
109
+ name: 'value',
110
+ message: `Can't login to ${indiciumURL} with the given credentials. Continue anyways?`,
111
+ initial: true
112
+ }
113
+ ]);
114
+
115
+ if (!confirmResponse.value) {
116
+ return;
117
+ }
118
+ }
119
+
120
+ process.env.SF_TEST_USERNAME = username;
121
+ process.env.SF_TEST_PASSWORD = password;
122
+
123
+ startTestSolution();
124
+ })();
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import process from 'node:process';
3
+ import { setup } from './setup.js';
4
+
5
+ if (process.argv[2] === 'install') {
6
+ setup();
7
+ } else if (process.argv[2] === 'sync') {
8
+ console.log('This feature is coming soon!');
9
+ } else {
10
+ console.warn('Command unknown. Use "install" or "sync".');
11
+ }
@@ -0,0 +1,34 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import process from 'node:process';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ export function setup() {
11
+ try {
12
+ const testwiseConfigFile = path.resolve(process.cwd(), 'Testwise.json');
13
+ const testwiseConfigTemplateFile = path.join(__dirname, 'Testwise.template.json');
14
+ const tsConfigFile = path.resolve(process.cwd(), 'tsconfig.json');
15
+ const tsConfigTemplateFile = path.join(__dirname, 'tsconfig.template.json');
16
+
17
+ if (!fs.existsSync(testwiseConfigFile)) {
18
+ fs.copyFileSync(testwiseConfigTemplateFile, testwiseConfigFile);
19
+ console.info('Testwise.json config file created.');
20
+ } else {
21
+ console.info('Testwise.json already exists, skipping creation.');
22
+ }
23
+
24
+ if (!fs.existsSync(tsConfigFile)) {
25
+ fs.copyFileSync(tsConfigTemplateFile, tsConfigFile);
26
+ console.info('tsconfig.json config file created.');
27
+ } else {
28
+ console.info('tsconfig.json already exists, skipping creation.');
29
+ }
30
+ } catch (error) {
31
+ console.error('Error during installation:', error.message);
32
+ process.exit(1); // Exit with an error code if something goes wrong
33
+ }
34
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2016",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+ "typeRoots": ["./node_modules/@types", "./types"],
7
+ "resolveJsonModule": true,
8
+ "esModuleInterop": true,
9
+ "strict": true,
10
+ "skipLibCheck": true
11
+ }
12
+ }
@@ -6,13 +6,14 @@ class ConfigBuilder {
6
6
  private config: Record<string, unknown>;
7
7
 
8
8
  constructor() {
9
- const configFilePath = path.resolve(process.cwd(), 'Testwise.json');
9
+ const baseDir = process.env.INIT_CWD || process.cwd();
10
+ const configFilePath = path.resolve(baseDir, 'Testwise.json');
10
11
 
11
12
  // Find all env files in the consuming project and apply them to process.env
12
- const envFiles = fs.readdirSync(process.cwd()).filter((file) => file.endsWith('.env'));
13
+ const envFiles = fs.readdirSync(baseDir).filter((file) => file.endsWith('.env'));
13
14
 
14
15
  for (const envFile of envFiles) {
15
- const envConfig = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), envFile)));
16
+ const envConfig = dotenv.parse(fs.readFileSync(path.resolve(baseDir, envFile)));
16
17
  Object.assign(process.env, envConfig);
17
18
  }
18
19
 
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-undef */
3
- /* eslint-disable @typescript-eslint/naming-convention */
4
-
5
- import fs from 'node:fs';
6
- import path from 'node:path';
7
- import { fileURLToPath } from 'node:url';
8
-
9
- if (process.argv[2] === 'install') {
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
- const configFile = path.resolve(process.cwd(), 'Testwise.json');
13
- const templateFile = path.join(__dirname, 'Testwise.template.json');
14
-
15
- if (!fs.existsSync(configFile)) {
16
- fs.copyFileSync(templateFile, configFile);
17
- console.log('Testwise.json config file created.');
18
- } else {
19
- console.log('Testwise.json already exists, skipping creation.');
20
- }
21
- } else {
22
- console.log('Unknown or missing command. Usage: npx testwise install');
23
- }