endorphin-ai 0.6.1 โ 0.7.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/README.md +44 -36
- package/dist/bin/cli-handlers.js +0 -0
- package/dist/endorphin-ai-0.6.1.tgz +0 -0
- package/dist/framework/cli/init-command.js +7 -7
- package/dist/framework/cli/init-command.js.map +1 -1
- package/examples/README-ENDORPHIN.md +22 -22
- package/package.json +9 -6
- package/scripts/fix-imports.js +13 -2
- package/scripts/postinstall.js +18 -9
- package/scripts/test-npm-install.sh +60 -0
package/README.md
CHANGED
|
@@ -42,8 +42,15 @@ comprehensive test management.
|
|
|
42
42
|
|
|
43
43
|
### ๐ฆ Installation & Setup
|
|
44
44
|
|
|
45
|
-
Get started in under
|
|
45
|
+
Get started in under 30 seconds:
|
|
46
46
|
|
|
47
|
+
```bash
|
|
48
|
+
# โก Quick setup (recommended)
|
|
49
|
+
npx create-endorphin-ai my-ai-tests
|
|
50
|
+
cd my-ai-tests
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Or manual setup:**
|
|
47
54
|
```bash
|
|
48
55
|
# 1. Create your project
|
|
49
56
|
mkdir my-ai-tests && cd my-ai-tests
|
|
@@ -52,7 +59,7 @@ mkdir my-ai-tests && cd my-ai-tests
|
|
|
52
59
|
npm install endorphin-ai
|
|
53
60
|
|
|
54
61
|
# 3. Initialize with everything you need
|
|
55
|
-
npx endorphin init
|
|
62
|
+
npx endorphin-ai init
|
|
56
63
|
```
|
|
57
64
|
|
|
58
65
|
**What you get:**
|
|
@@ -74,10 +81,10 @@ echo "OPENAI_API_KEY=your-openai-api-key-here" > .env
|
|
|
74
81
|
|
|
75
82
|
```bash
|
|
76
83
|
# Run the sample health check test
|
|
77
|
-
npx endorphin run test HEALTH-001
|
|
84
|
+
npx endorphin-ai run test HEALTH-001
|
|
78
85
|
|
|
79
86
|
# Generate a beautiful HTML report
|
|
80
|
-
npx endorphin generate report && npx endorphin open report
|
|
87
|
+
npx endorphin-ai generate report && npx endorphin-ai open report
|
|
81
88
|
```
|
|
82
89
|
|
|
83
90
|
**๐ That's it!** You now have:
|
|
@@ -87,7 +94,7 @@ npx endorphin generate report && npx endorphin open report
|
|
|
87
94
|
|
|
88
95
|
### ๐ง Troubleshooting Installation
|
|
89
96
|
|
|
90
|
-
If `npx endorphin` doesn't work, try these **guaranteed solutions**:
|
|
97
|
+
If `npx endorphin-ai` doesn't work, try these **guaranteed solutions**:
|
|
91
98
|
|
|
92
99
|
```bash
|
|
93
100
|
# Option 1: Use npm scripts (always works)
|
|
@@ -97,14 +104,14 @@ npm run endorphin:help # Get help
|
|
|
97
104
|
|
|
98
105
|
# Option 2: Clear npx cache and retry
|
|
99
106
|
npx --clear-cache
|
|
100
|
-
npx endorphin init
|
|
107
|
+
npx endorphin-ai init
|
|
101
108
|
|
|
102
109
|
# Option 3: Use direct path
|
|
103
|
-
./node_modules/.bin/endorphin init
|
|
110
|
+
./node_modules/.bin/endorphin-ai init
|
|
104
111
|
|
|
105
112
|
# Option 4: Global installation
|
|
106
113
|
npm install -g endorphin-ai
|
|
107
|
-
endorphin init
|
|
114
|
+
endorphin-ai init
|
|
108
115
|
```
|
|
109
116
|
|
|
110
117
|
**Why this happens:** This is a known npm/npx issue with local binary resolution, not a problem with Endorphin AI. The npm scripts above always work regardless of npx behavior.
|
|
@@ -173,12 +180,12 @@ If you prefer manual setup:
|
|
|
173
180
|
```json
|
|
174
181
|
{
|
|
175
182
|
"scripts": {
|
|
176
|
-
"test": "endorphin run test all",
|
|
177
|
-
"test:smoke": "endorphin run test --tag smoke",
|
|
178
|
-
"test:auth": "endorphin run test --tag authentication",
|
|
179
|
-
"test:single": "endorphin run test",
|
|
180
|
-
"test:record": "endorphin run test-recorder",
|
|
181
|
-
"endorphin:init": "./node_modules/.bin/endorphin init",
|
|
183
|
+
"test": "endorphin-ai run test all",
|
|
184
|
+
"test:smoke": "endorphin-ai run test --tag smoke",
|
|
185
|
+
"test:auth": "endorphin-ai run test --tag authentication",
|
|
186
|
+
"test:single": "endorphin-ai run test",
|
|
187
|
+
"test:record": "endorphin-ai run test-recorder",
|
|
188
|
+
"endorphin:init": "./node_modules/.bin/endorphin-ai init",
|
|
182
189
|
"endorphin:version": "./node_modules/.bin/endorphin --version"
|
|
183
190
|
}
|
|
184
191
|
}
|
|
@@ -215,25 +222,25 @@ If you prefer manual setup:
|
|
|
215
222
|
|
|
216
223
|
## ๐ Staying Updated
|
|
217
224
|
|
|
218
|
-
### Current Version: v0.6.
|
|
225
|
+
### Current Version: v0.6.1
|
|
219
226
|
|
|
220
227
|
```bash
|
|
221
228
|
# Check your current version
|
|
222
|
-
npx endorphin --version
|
|
229
|
+
npx endorphin-ai --version
|
|
223
230
|
|
|
224
231
|
# Update to the latest version
|
|
225
232
|
npm update endorphin-ai
|
|
226
233
|
|
|
227
234
|
# Get help and see new features
|
|
228
|
-
npx endorphin --help
|
|
235
|
+
npx endorphin-ai --help
|
|
229
236
|
```
|
|
230
237
|
|
|
231
|
-
### What's New in v0.6.
|
|
232
|
-
- โ
**
|
|
233
|
-
- โ
**
|
|
234
|
-
- โ
**
|
|
235
|
-
- โ
**
|
|
236
|
-
- โ
**
|
|
238
|
+
### What's New in v0.6.1
|
|
239
|
+
- โ
**Fixed npx Resolution Issues** with post-install script and npm script alternatives
|
|
240
|
+
- โ
**Enhanced User Experience** with clear troubleshooting guidance
|
|
241
|
+
- โ
**Reliable Installation** that works regardless of npm/npx behavior
|
|
242
|
+
- โ
**Multiple Access Methods** including guaranteed npm scripts
|
|
243
|
+
- โ
**Better Documentation** with comprehensive troubleshooting section
|
|
237
244
|
|
|
238
245
|
## ๐ Project Initialization
|
|
239
246
|
|
|
@@ -242,7 +249,7 @@ npx endorphin --help
|
|
|
242
249
|
```bash
|
|
243
250
|
# Quick setup for new projects
|
|
244
251
|
mkdir my-test-project && cd my-test-project
|
|
245
|
-
npx endorphin init
|
|
252
|
+
npx endorphin-ai init
|
|
246
253
|
```
|
|
247
254
|
|
|
248
255
|
The `init` command creates:
|
|
@@ -266,7 +273,7 @@ For existing Endorphin projects, the `init` command is optional and safe:
|
|
|
266
273
|
|
|
267
274
|
```bash
|
|
268
275
|
# Safe to run in existing projects
|
|
269
|
-
npx endorphin init
|
|
276
|
+
npx endorphin-ai init
|
|
270
277
|
```
|
|
271
278
|
|
|
272
279
|
### Usage Commands
|
|
@@ -275,10 +282,10 @@ npx endorphin init
|
|
|
275
282
|
|
|
276
283
|
```bash
|
|
277
284
|
# Check current version
|
|
278
|
-
npx endorphin --version
|
|
285
|
+
npx endorphin-ai --version
|
|
279
286
|
|
|
280
287
|
# Get help and see all commands
|
|
281
|
-
npx endorphin --help
|
|
288
|
+
npx endorphin-ai --help
|
|
282
289
|
|
|
283
290
|
# Update to latest version
|
|
284
291
|
npm update endorphin-ai
|
|
@@ -288,7 +295,7 @@ npm update endorphin-ai
|
|
|
288
295
|
|
|
289
296
|
```bash
|
|
290
297
|
# Create a new Endorphin AI project with all necessary files
|
|
291
|
-
npx endorphin init
|
|
298
|
+
npx endorphin-ai init
|
|
292
299
|
|
|
293
300
|
# What gets created:
|
|
294
301
|
# โโโ tests/sample-test.ts # Ready-to-run TypeScript test
|
|
@@ -725,14 +732,14 @@ npx endorphin list
|
|
|
725
732
|
|
|
726
733
|
```bash
|
|
727
734
|
# Initialize new project (recommended for new projects)
|
|
728
|
-
npx endorphin init
|
|
735
|
+
npx endorphin-ai init
|
|
729
736
|
|
|
730
737
|
# Show help and available commands
|
|
731
|
-
npx endorphin --help
|
|
738
|
+
npx endorphin-ai --help
|
|
732
739
|
npx endorphin help
|
|
733
740
|
|
|
734
741
|
# Check current version
|
|
735
|
-
npx endorphin --version
|
|
742
|
+
npx endorphin-ai --version
|
|
736
743
|
```
|
|
737
744
|
|
|
738
745
|
### HTML Reports & Analytics
|
|
@@ -824,7 +831,7 @@ Add these to your `package.json`:
|
|
|
824
831
|
"test:summary": "endorphin generate report --summary",
|
|
825
832
|
"test:open": "endorphin open report",
|
|
826
833
|
"test:cleanup": "endorphin cleanup results",
|
|
827
|
-
"endorphin:init": "./node_modules/.bin/endorphin init",
|
|
834
|
+
"endorphin:init": "./node_modules/.bin/endorphin-ai init",
|
|
828
835
|
"endorphin:version": "./node_modules/.bin/endorphin --version",
|
|
829
836
|
"endorphin:help": "./node_modules/.bin/endorphin --help"
|
|
830
837
|
}
|
|
@@ -851,7 +858,7 @@ npm run endorphin:help # Get help
|
|
|
851
858
|
|
|
852
859
|
```bash
|
|
853
860
|
# Check current installed version
|
|
854
|
-
npx endorphin --version
|
|
861
|
+
npx endorphin-ai --version
|
|
855
862
|
|
|
856
863
|
# Check latest available version on npm
|
|
857
864
|
npm view endorphin-ai version
|
|
@@ -870,15 +877,16 @@ npm update endorphin-ai
|
|
|
870
877
|
npm install endorphin-ai@latest
|
|
871
878
|
|
|
872
879
|
# Verify the update
|
|
873
|
-
npx endorphin --version
|
|
880
|
+
npx endorphin-ai --version
|
|
874
881
|
```
|
|
875
882
|
|
|
876
883
|
### Version History & Features
|
|
877
884
|
|
|
878
|
-
- **v0.6.
|
|
885
|
+
- **v0.6.1** *(Latest)*: Fixed npx resolution issues, enhanced user experience
|
|
886
|
+
- **v0.6.0**: Enhanced CLI, security-first publishing, cross-platform CI/CD
|
|
879
887
|
- **v0.5.0**: Advanced HTML reporting with interactive features
|
|
880
888
|
- **v0.4.0**: TypeScript-first experience with full type definitions
|
|
881
|
-
- **v0.3.0**: Added `endorphin init` command for instant project setup
|
|
889
|
+
- **v0.3.0**: Added `endorphin-ai init` command for instant project setup
|
|
882
890
|
- **v0.2.x**: Core framework with AI-powered testing
|
|
883
891
|
- **v0.1.x**: Initial release with basic functionality
|
|
884
892
|
|
package/dist/bin/cli-handlers.js
CHANGED
|
File without changes
|
|
Binary file
|
|
@@ -33,7 +33,7 @@ export async function initProject(targetDir = process.cwd()) {
|
|
|
33
33
|
(await fileExists(path.join(targetDir, 'endorphin.config.ts')));
|
|
34
34
|
if (configExists) {
|
|
35
35
|
console.log('โ ๏ธ Endorphin AI already initialized in this directory');
|
|
36
|
-
console.log('๐ก Run: npx endorphin run test HEALTH-001');
|
|
36
|
+
console.log('๐ก Run: npx endorphin-ai run test HEALTH-001');
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
// Create directories
|
|
@@ -44,8 +44,8 @@ export async function initProject(targetDir = process.cwd()) {
|
|
|
44
44
|
console.log('');
|
|
45
45
|
console.log('๐ Next steps:');
|
|
46
46
|
console.log(' 1. Edit .env and add your OpenAI API key');
|
|
47
|
-
console.log(' 2. Run: npx endorphin run test HEALTH-001');
|
|
48
|
-
console.log(' 3. Try: npx endorphin run test-recorder');
|
|
47
|
+
console.log(' 2. Run: npx endorphin-ai run test HEALTH-001');
|
|
48
|
+
console.log(' 3. Try: npx endorphin-ai run test-recorder');
|
|
49
49
|
console.log('');
|
|
50
50
|
console.log('๐ Learn more: https://github.com/andrewnovykov/endorphin-ai');
|
|
51
51
|
}
|
|
@@ -115,7 +115,7 @@ function processEnvFile(content) {
|
|
|
115
115
|
# 2. Create new secret key
|
|
116
116
|
# 3. Replace "your_openai_api_key_here" above with your actual key
|
|
117
117
|
# 4. Save this file
|
|
118
|
-
# 5. Run: npx endorphin run test HEALTH-001`;
|
|
118
|
+
# 5. Run: npx endorphin-ai run test HEALTH-001`;
|
|
119
119
|
}
|
|
120
120
|
function processConfigFile(content) {
|
|
121
121
|
// Add helpful comments for beginners
|
|
@@ -149,7 +149,7 @@ async function createBasicFiles(targetDir) {
|
|
|
149
149
|
# 2. Create new secret key
|
|
150
150
|
# 3. Replace "your_openai_api_key_here" above with your actual key
|
|
151
151
|
# 4. Save this file
|
|
152
|
-
# 5. Run: npx endorphin run test HEALTH-001`;
|
|
152
|
+
# 5. Run: npx endorphin-ai run test HEALTH-001`;
|
|
153
153
|
await fs.writeFile(path.join(targetDir, '.env'), envContent);
|
|
154
154
|
console.log('๐ Created: .env');
|
|
155
155
|
// Create basic config file
|
|
@@ -261,7 +261,7 @@ Welcome to your new Endorphin AI testing project! ๐ฏ
|
|
|
261
261
|
|
|
262
262
|
2. **Run your first test:**
|
|
263
263
|
\`\`\`bash
|
|
264
|
-
npx endorphin run test HEALTH-001
|
|
264
|
+
npx endorphin-ai run test HEALTH-001
|
|
265
265
|
\`\`\`
|
|
266
266
|
|
|
267
267
|
3. **View test results:**
|
|
@@ -278,7 +278,7 @@ Welcome to your new Endorphin AI testing project! ๐ฏ
|
|
|
278
278
|
|
|
279
279
|
- Add more tests in the \`tests/\` directory
|
|
280
280
|
- Customize your configuration in \`endorphin.config.js\`
|
|
281
|
-
- Explore the interactive test recorder: \`npx endorphin run test-recorder\`
|
|
281
|
+
- Explore the interactive test recorder: \`npx endorphin-ai run test-recorder\`
|
|
282
282
|
|
|
283
283
|
Happy testing! ๐`;
|
|
284
284
|
await fs.writeFile(path.join(targetDir, 'README-ENDORPHIN.md'), readmeContent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-command.js","sourceRoot":"","sources":["../../../framework/cli/init-command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,yEAAyE;AACzE,oDAAoD;AACpD,MAAM,gBAAgB,GAAG,GAAW,EAAE;IACpC,8DAA8D;IAC9D,MAAM,aAAa,GAAG;QACpB,+DAA+D;QAC/D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,2BAA2B,CAAC;QACxD,6CAA6C;QAC7C,OAAO,CAAC,GAAG,EAAE;QACb,oEAAoE;QACpE,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QAC3E,8BAA8B;QAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC;KACrC,CAAC,MA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AC,SAAS,EAAE,sBAAsB,CAAC,EAAE,WAAW,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAEhD,0BAA0B;IAC1B,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmCjB,CAAC;IAET,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEtC,sBAAsB;IACtB,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BN,CAAC;IAEjB,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,EAAE,aAAa,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -17,27 +17,27 @@ Get your API key from: https://platform.openai.com/api-keys
|
|
|
17
17
|
### 2. Run Example Test
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npx endorphin run test HEALTH-001
|
|
20
|
+
npx endorphin-ai run test HEALTH-001
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### 3. Generate reporter
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npx endorphin generate report
|
|
27
|
-
npx endorphin open report
|
|
26
|
+
npx endorphin-ai generate report
|
|
27
|
+
npx endorphin-ai open report
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### 4. Record Your Own Test
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
npx endorphin run test-recorder
|
|
34
|
+
npx endorphin-ai run test-recorder
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### 5. List All Tests
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npx endorphin list
|
|
40
|
+
npx endorphin-ai list
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## ๐ Project Structure
|
|
@@ -58,7 +58,7 @@ npx endorphin list
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
# Check your current version
|
|
61
|
-
npx endorphin --version
|
|
61
|
+
npx endorphin-ai --version
|
|
62
62
|
|
|
63
63
|
# Check latest available version
|
|
64
64
|
npm view endorphin-ai version
|
|
@@ -77,7 +77,7 @@ npm update endorphin-ai
|
|
|
77
77
|
npm install endorphin-ai@latest
|
|
78
78
|
|
|
79
79
|
# Verify the update worked
|
|
80
|
-
npx endorphin --version
|
|
80
|
+
npx endorphin-ai --version
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
## ๐ Common Commands
|
|
@@ -86,43 +86,43 @@ npx endorphin --version
|
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
88
|
# Run specific test
|
|
89
|
-
npx endorphin run test HEALTH-001
|
|
89
|
+
npx endorphin-ai run test HEALTH-001
|
|
90
90
|
|
|
91
91
|
# Run all tests
|
|
92
|
-
npx endorphin run test all
|
|
92
|
+
npx endorphin-ai run test all
|
|
93
93
|
|
|
94
94
|
# Run tests by tag
|
|
95
|
-
npx endorphin run test --tag smoke
|
|
96
|
-
npx endorphin run test --tag authentication
|
|
95
|
+
npx endorphin-ai run test --tag smoke
|
|
96
|
+
npx endorphin-ai run test --tag authentication
|
|
97
97
|
|
|
98
98
|
# Run tests by priority
|
|
99
|
-
npx endorphin run test --priority High
|
|
99
|
+
npx endorphin-ai run test --priority High
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
### Test Management
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
105
|
# List all available tests
|
|
106
|
-
npx endorphin list
|
|
106
|
+
npx endorphin-ai list
|
|
107
107
|
|
|
108
108
|
# Start test recorder for creating new tests
|
|
109
|
-
npx endorphin run test-recorder
|
|
109
|
+
npx endorphin-ai run test-recorder
|
|
110
110
|
|
|
111
111
|
# Get help and see all commands
|
|
112
|
-
npx endorphin --help
|
|
112
|
+
npx endorphin-ai --help
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
### Browser Options
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
118
|
# Run with visible browser (default)
|
|
119
|
-
npx endorphin run test HEALTH-001 --no-headless
|
|
119
|
+
npx endorphin-ai run test HEALTH-001 --no-headless
|
|
120
120
|
|
|
121
121
|
# Run in headless mode (faster)
|
|
122
|
-
npx endorphin run test HEALTH-001 --headless
|
|
122
|
+
npx endorphin-ai run test HEALTH-001 --headless
|
|
123
123
|
|
|
124
124
|
# Set custom viewport size
|
|
125
|
-
npx endorphin run test HEALTH-001 --viewport 1920x1080
|
|
125
|
+
npx endorphin-ai run test HEALTH-001 --viewport 1920x1080
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
## โ๏ธ Configuration
|
|
@@ -184,7 +184,7 @@ export const MY_TEST = {
|
|
|
184
184
|
cat .env
|
|
185
185
|
|
|
186
186
|
# Test API key works
|
|
187
|
-
npx endorphin run test HEALTH-001
|
|
187
|
+
npx endorphin-ai run test HEALTH-001
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
### Version Issues
|
|
@@ -202,7 +202,7 @@ node --version
|
|
|
202
202
|
|
|
203
203
|
```bash
|
|
204
204
|
# Check test file format
|
|
205
|
-
npx endorphin list
|
|
205
|
+
npx endorphin-ai list
|
|
206
206
|
|
|
207
207
|
# Verify exports are correct
|
|
208
208
|
node -e "import('./tests/sample-test.js').then(console.log)"
|
|
@@ -210,8 +210,8 @@ node -e "import('./tests/sample-test.js').then(console.log)"
|
|
|
210
210
|
|
|
211
211
|
## ๐ฏ Next Steps
|
|
212
212
|
|
|
213
|
-
1. **Run the sample test**: `npx endorphin run test HEALTH-001`
|
|
214
|
-
2. **Record your first test**: `npx endorphin run test-recorder`
|
|
213
|
+
1. **Run the sample test**: `npx endorphin-ai run test HEALTH-001`
|
|
214
|
+
2. **Record your first test**: `npx endorphin-ai run test-recorder`
|
|
215
215
|
3. **Write custom tests**: Add new files to `tests/` directory
|
|
216
216
|
4. **Configure settings**: Edit `endorphin.config.js` for your needs
|
|
217
217
|
5. **Set up CI/CD**: Add Endorphin tests to your pipeline
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "endorphin-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "E2E Testing Reinvented with AI - A powerful TypeScript browser automation framework using AI-powered testing with LangChain, OpenAI GPT-4o, and Playwright",
|
|
5
5
|
"main": "dist/framework/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
"test:dev": "jest --selectProjects='Development Tests'",
|
|
19
19
|
"test:all": "jest --selectProjects='Development Tests'",
|
|
20
20
|
"test:package": "cd tests/package-tests && ./run-all-tests.sh",
|
|
21
|
-
"build": "tsc && node scripts/fix-imports.js && cp framework/templates/reporter/*.html framework/templates/reporter/*.css framework/templates/reporter/*.js dist/framework/templates/reporter/ && chmod +x dist/bin/endorphin.js",
|
|
21
|
+
"build": "tsc && node scripts/fix-imports.js && cp framework/templates/reporter/*.html framework/templates/reporter/*.css framework/templates/reporter/*.js dist/framework/templates/reporter/ && chmod +x dist/bin/endorphin.js && chmod +x dist/bin/cli-handlers.js",
|
|
22
22
|
"build:watch": "tsc --watch",
|
|
23
23
|
"pack:local": "npm run build && npm pack --pack-destination dist",
|
|
24
24
|
"test:local": "npm run pack:local && ./tests/package-tests/run-all-tests.sh",
|
|
25
|
+
"test:install": "npm run build && ./scripts/test-npm-install.sh",
|
|
25
26
|
"type-check": "tsc --noEmit",
|
|
26
27
|
"framework:test": "tsx framework/index.ts --test",
|
|
27
28
|
"framework:demo": "tsx framework/index.ts",
|
|
@@ -42,11 +43,13 @@
|
|
|
42
43
|
"cleanup": "./scripts/cleanup-test-artifacts.sh",
|
|
43
44
|
"postinstall": "node scripts/postinstall.js",
|
|
44
45
|
"endorphin": "./node_modules/.bin/endorphin",
|
|
45
|
-
"endorphin
|
|
46
|
-
"endorphin:
|
|
47
|
-
"endorphin:
|
|
46
|
+
"endorphin-ai": "./node_modules/.bin/endorphin",
|
|
47
|
+
"endorphin-ai:init": "./node_modules/.bin/endorphin init",
|
|
48
|
+
"endorphin-ai:version": "./node_modules/.bin/endorphin --version",
|
|
49
|
+
"endorphin-ai:help": "./node_modules/.bin/endorphin --help",
|
|
48
50
|
"prepare": "echo 'Husky disabled temporarily'",
|
|
49
|
-
"precommit": "echo 'Pre-commit hooks disabled temporarily'"
|
|
51
|
+
"precommit": "echo 'Pre-commit hooks disabled temporarily'",
|
|
52
|
+
"prepublishOnly": "npm run build && npm run test:unit"
|
|
50
53
|
},
|
|
51
54
|
"keywords": [
|
|
52
55
|
"ai",
|
package/scripts/fix-imports.js
CHANGED
|
@@ -11,7 +11,8 @@ import { fileURLToPath } from 'url';
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = path.dirname(__filename);
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const distFrameworkDir = path.join(__dirname, '..', 'dist', 'framework');
|
|
15
|
+
const distBinDir = path.join(__dirname, '..', 'dist', 'bin');
|
|
15
16
|
|
|
16
17
|
// Path alias mappings
|
|
17
18
|
const pathMappings = {
|
|
@@ -80,5 +81,15 @@ function processDirectory(dir) {
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
console.log('๐ง Fixing TypeScript path aliases in compiled JavaScript...');
|
|
83
|
-
|
|
84
|
+
|
|
85
|
+
// Process framework directory
|
|
86
|
+
if (fs.existsSync(distFrameworkDir)) {
|
|
87
|
+
processDirectory(distFrameworkDir);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Process bin directory
|
|
91
|
+
if (fs.existsSync(distBinDir)) {
|
|
92
|
+
processDirectory(distBinDir);
|
|
93
|
+
}
|
|
94
|
+
|
|
84
95
|
console.log('โ
Import paths fixed!');
|
package/scripts/postinstall.js
CHANGED
|
@@ -46,19 +46,28 @@ function printUsageInstructions() {
|
|
|
46
46
|
โ
Endorphin AI installed successfully!
|
|
47
47
|
|
|
48
48
|
๐ Quick start:
|
|
49
|
-
npx endorphin init # Initialize new project
|
|
50
|
-
|
|
49
|
+
npx endorphin-ai init # Initialize new project (recommended)
|
|
50
|
+
./node_modules/.bin/endorphin init # Direct method
|
|
51
51
|
|
|
52
52
|
๐ More commands:
|
|
53
|
-
npx endorphin --version # Check version
|
|
54
|
-
|
|
53
|
+
npx endorphin-ai --version # Check version
|
|
54
|
+
./node_modules/.bin/endorphin --version # Direct method
|
|
55
55
|
|
|
56
|
-
npx endorphin --help # Get help
|
|
57
|
-
|
|
56
|
+
npx endorphin-ai --help # Get help
|
|
57
|
+
./node_modules/.bin/endorphin --help # Direct method
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
โ ๏ธ Note: Use 'endorphin-ai' with npx to avoid conflicts with other packages
|
|
60
|
+
|
|
61
|
+
๐ง Alternative: Add these scripts to your package.json:
|
|
62
|
+
{
|
|
63
|
+
"scripts": {
|
|
64
|
+
"endorphin-ai:init": "./node_modules/.bin/endorphin init",
|
|
65
|
+
"endorphin-ai:version": "./node_modules/.bin/endorphin --version",
|
|
66
|
+
"endorphin-ai:help": "./node_modules/.bin/endorphin --help"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
Then use: npm run endorphin-ai:init
|
|
62
71
|
|
|
63
72
|
๐ Documentation: https://github.com/andrewnovykov/endorphin-ai#readme
|
|
64
73
|
`);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Test script to verify npm installation works properly
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "๐งช Testing npm installation..."
|
|
8
|
+
|
|
9
|
+
# Clean up any previous test
|
|
10
|
+
rm -rf /tmp/endorphin-test-install
|
|
11
|
+
mkdir -p /tmp/endorphin-test-install
|
|
12
|
+
cd /tmp/endorphin-test-install
|
|
13
|
+
|
|
14
|
+
echo "๐ฆ Creating test package..."
|
|
15
|
+
npm pack /Users/papapin777/Documents/CODE/AI/endorphin-ai
|
|
16
|
+
|
|
17
|
+
# Find the generated .tgz file
|
|
18
|
+
PACKAGE_FILE=$(ls endorphin-ai-*.tgz | head -1)
|
|
19
|
+
|
|
20
|
+
if [ -z "$PACKAGE_FILE" ]; then
|
|
21
|
+
echo "โ Failed: No package file generated"
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "๐ฅ Installing package locally..."
|
|
26
|
+
npm init -y > /dev/null 2>&1
|
|
27
|
+
npm install "./$PACKAGE_FILE" > /dev/null 2>&1
|
|
28
|
+
|
|
29
|
+
echo "๐งช Testing npx endorphin-ai command..."
|
|
30
|
+
if npx endorphin-ai --version > /dev/null 2>&1; then
|
|
31
|
+
echo "โ
npx endorphin-ai --version works!"
|
|
32
|
+
else
|
|
33
|
+
echo "โ npx endorphin-ai --version failed"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo "๐งช Testing direct binary execution..."
|
|
38
|
+
if ./node_modules/.bin/endorphin-ai --version > /dev/null 2>&1; then
|
|
39
|
+
echo "โ
Direct binary execution works!"
|
|
40
|
+
else
|
|
41
|
+
echo "โ Direct binary execution failed"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "๐งช Testing global installation..."
|
|
46
|
+
npm install -g "./$PACKAGE_FILE" > /dev/null 2>&1
|
|
47
|
+
|
|
48
|
+
if endorphin-ai --version > /dev/null 2>&1; then
|
|
49
|
+
echo "โ
Global installation works!"
|
|
50
|
+
else
|
|
51
|
+
echo "โ Global installation failed"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# Clean up global install
|
|
56
|
+
npm uninstall -g endorphin-ai > /dev/null 2>&1
|
|
57
|
+
|
|
58
|
+
echo "๐ All installation tests passed!"
|
|
59
|
+
cd /
|
|
60
|
+
rm -rf /tmp/endorphin-test-install
|