@ranger-testing/ranger-cli 1.0.3 ā 1.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/build/commands/addEnv.js
CHANGED
|
@@ -36,12 +36,20 @@ export async function addEnv(envName) {
|
|
|
36
36
|
const authPath = join(envDir, 'auth.json');
|
|
37
37
|
let storageStatePath = undefined;
|
|
38
38
|
if (requiresAuth) {
|
|
39
|
+
// Check if existing auth state exists
|
|
40
|
+
const hasExistingAuth = existsSync(authPath);
|
|
39
41
|
console.log('\nš Authentication Setup');
|
|
40
|
-
|
|
42
|
+
if (hasExistingAuth) {
|
|
43
|
+
console.log(' A browser will open with your existing session.');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log(' A browser will open. Please log in to your application.');
|
|
47
|
+
}
|
|
41
48
|
console.log(' When you are done logging in, close the browser.\n');
|
|
42
|
-
// Launch Playwright browser
|
|
49
|
+
// Launch Playwright browser with existing storage state if available
|
|
43
50
|
const browser = await chromium.launch({ headless: false });
|
|
44
|
-
const
|
|
51
|
+
const contextOptions = hasExistingAuth ? { storageState: authPath } : {};
|
|
52
|
+
const context = await browser.newContext(contextOptions);
|
|
45
53
|
const page = await context.newPage();
|
|
46
54
|
await page.goto('about:blank');
|
|
47
55
|
// Wait for browser to be closed by user
|
|
@@ -89,7 +97,6 @@ export async function addEnv(envName) {
|
|
|
89
97
|
if (!hasRangerServer(mcpConfig)) {
|
|
90
98
|
console.error('\nRanger Tests MCP is not initialized.');
|
|
91
99
|
console.error(' To initialize, run: ranger start <token>');
|
|
92
|
-
process.exit(1);
|
|
93
100
|
}
|
|
94
101
|
// Update ranger-browser with the config path
|
|
95
102
|
setRangerBrowser(mcpConfig, configPath);
|
|
@@ -2,6 +2,7 @@ import { writeFile, readFile } from 'fs/promises';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import { chromium } from 'playwright';
|
|
5
|
+
import { installAgent } from './utils/agents.js';
|
|
5
6
|
export async function updateEnv(envName) {
|
|
6
7
|
const envDir = join(process.cwd(), '.ranger', envName);
|
|
7
8
|
const configPath = join(envDir, 'config.json');
|
|
@@ -56,4 +57,8 @@ export async function updateEnv(envName) {
|
|
|
56
57
|
await writeFile(configPath, JSON.stringify(config, null, 2));
|
|
57
58
|
console.log(`ā Updated config: ${configPath}`);
|
|
58
59
|
console.log(`\nā
Environment "${envName}" authentication updated`);
|
|
60
|
+
// Copy browser-based agents to .claude/agents
|
|
61
|
+
await installAgent('quality-advocate');
|
|
62
|
+
await installAgent('bug-basher');
|
|
63
|
+
await installAgent('ui-verifier');
|
|
59
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ranger-testing/ranger-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ranger": "./build/cli.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc && cp -r src/agents build/ && chmod 755 build/cli.js",
|
|
11
|
-
"dev": "tsx src/cli.ts"
|
|
11
|
+
"dev": "tsx src/cli.ts",
|
|
12
|
+
"postinstall": "npx playwright install chromium"
|
|
12
13
|
},
|
|
13
14
|
"files": ["build"],
|
|
14
15
|
"dependencies": {
|