@desplega.ai/qa-use 2.8.7 → 2.9.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/qa-use",
3
- "version": "2.8.7",
3
+ "version": "2.9.0",
4
4
  "packageManager": "bun@^1.3.4",
5
5
  "description": "QA automation tool for browser testing with MCP server support",
6
6
  "type": "module",
@@ -37,10 +37,12 @@
37
37
  "test:unit": "node scripts/test-unit.js",
38
38
  "test:integration": "node scripts/test-integration.js",
39
39
  "test:coverage": "bun test --coverage --preload ./test-setup.ts",
40
+ "generate:docs": "tsx scripts/generate-docs.ts",
40
41
  "generate:readme": "node scripts/generate-readme-tools.js",
41
42
  "generate:types": "tsx scripts/generate-types.ts",
43
+ "check:docs": "tsx scripts/generate-docs.ts && git diff --exit-code src/cli/generated/docs-content.ts || (echo '❌ Docs content is stale — run bun run generate:docs and commit the result' && exit 1)",
42
44
  "release": "bun scripts/release.ts",
43
- "prepublishOnly": "bun run build && bun lint && bun typecheck",
45
+ "prepublishOnly": "bun run generate:docs && bun run check:docs && bun run build && bun lint && bun typecheck",
44
46
  "cc:validate": "claude plugin validate ."
45
47
  },
46
48
  "keywords": [
@@ -0,0 +1,6 @@
1
+ /**
2
+ * qa-use docs - Access bundled documentation and reference guides
3
+ */
4
+ import { Command } from 'commander';
5
+ export declare const docsCommand: Command;
6
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,eAAO,MAAM,WAAW,SAgDpB,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * qa-use docs - Access bundled documentation and reference guides
3
+ */
4
+ import { Command } from 'commander';
5
+ import { MAIN_DOC, REFERENCE_DOCS, TEMPLATES } from '../generated/docs-content.js';
6
+ import { error, info } from '../lib/output.js';
7
+ const TOPIC_KEYS = Object.keys(REFERENCE_DOCS);
8
+ const TEMPLATE_KEYS = Object.keys(TEMPLATES);
9
+ function printList() {
10
+ console.log(info('Available documentation topics:\n'));
11
+ console.log(' Reference Guides:');
12
+ for (const key of TOPIC_KEYS) {
13
+ console.log(` ${key.padEnd(22)} ${REFERENCE_DOCS[key].title}`);
14
+ }
15
+ console.log('\n Templates:');
16
+ console.log(` ${'templates'.padEnd(22)} List all test templates`);
17
+ for (const key of TEMPLATE_KEYS) {
18
+ console.log(` template:${key.padEnd(14)} ${TEMPLATES[key].title}`);
19
+ }
20
+ console.log(`
21
+ Usage:
22
+ qa-use docs Main documentation
23
+ qa-use docs browser-commands Browser commands reference
24
+ qa-use docs templates List all templates
25
+ qa-use docs template:auth-flow Show auth flow template`);
26
+ }
27
+ export const docsCommand = new Command('docs')
28
+ .description('Show documentation and reference guides')
29
+ .argument('[topic]', 'Topic to display (use --list to see available topics)')
30
+ .option('--list', 'List available documentation topics')
31
+ .action(async (topic, options) => {
32
+ if (options.list) {
33
+ printList();
34
+ return;
35
+ }
36
+ // No topic: show main doc
37
+ if (!topic) {
38
+ process.stdout.write(`${MAIN_DOC}\n`);
39
+ return;
40
+ }
41
+ // Check reference docs
42
+ if (topic in REFERENCE_DOCS) {
43
+ process.stdout.write(`${REFERENCE_DOCS[topic].content}\n`);
44
+ return;
45
+ }
46
+ // "templates" lists available templates
47
+ if (topic === 'templates') {
48
+ console.log(info('Available test templates:\n'));
49
+ for (const key of TEMPLATE_KEYS) {
50
+ console.log(` ${key.padEnd(16)} ${TEMPLATES[key].title}`);
51
+ }
52
+ console.log('\nUsage: qa-use docs template:<name>');
53
+ return;
54
+ }
55
+ // "template:<name>" shows a specific template
56
+ if (topic.startsWith('template:')) {
57
+ const name = topic.slice('template:'.length);
58
+ if (name in TEMPLATES) {
59
+ process.stdout.write(`${TEMPLATES[name].content}\n`);
60
+ return;
61
+ }
62
+ console.log(error(`Unknown template: "${name}"`));
63
+ console.log(`Available: ${TEMPLATE_KEYS.join(', ')}`);
64
+ process.exit(1);
65
+ }
66
+ // Unknown topic
67
+ console.log(error(`Unknown topic: "${topic}"`));
68
+ console.log("Run 'qa-use docs --list' to see available topics.");
69
+ process.exit(1);
70
+ });
71
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../../src/cli/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC/C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAE7C,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAEvD,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACnC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9B,OAAO,CAAC,GAAG,CAAC,OAAO,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC;IACrE,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG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ACpD,OAAO;IACT,CAAC;IAED,8CAA8C;IAC9C,IAAI,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;YACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,IAAI,GAAG,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,cAAc,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,gBAAgB;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * qa-use setup - Interactive API key configuration
2
+ * qa-use setup - API key configuration (interactive and headless)
3
3
  */
4
4
  import { Command } from 'commander';
5
5
  export declare const setupCommand: Command;
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,SA2DrB,CAAC"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,SAmIrB,CAAC"}
@@ -1,48 +1,108 @@
1
1
  /**
2
- * qa-use setup - Interactive API key configuration
2
+ * qa-use setup - API key configuration (interactive and headless)
3
3
  */
4
4
  import * as readline from 'node:readline/promises';
5
5
  import { Command } from 'commander';
6
6
  import { ApiClient } from '../../../lib/api/index.js';
7
- import { loadConfig, saveConfig } from '../lib/config.js';
8
- import { error, formatError, success } from '../lib/output.js';
7
+ import { configExists, loadConfig, saveConfig } from '../lib/config.js';
8
+ import { error, formatError, info, success, warning } from '../lib/output.js';
9
9
  export const setupCommand = new Command('setup')
10
10
  .description('Configure API key and default settings')
11
- .action(async () => {
12
- const rl = readline.createInterface({
13
- input: process.stdin,
14
- output: process.stdout,
15
- });
11
+ .option('--api-key <key>', 'API key for authentication')
12
+ .option('--test-dir <path>', 'Test directory path (default: ./qa-tests)')
13
+ .option('--api-url <url>', 'Override API base URL')
14
+ .option('--skip-validation', 'Skip API key validation (offline/CI)')
15
+ .option('-y, --yes', 'Auto-confirm with current/default values')
16
+ .action(async (options) => {
16
17
  try {
17
- console.log('🔧 QA-Use Setup\n');
18
- // Load existing config
19
18
  const config = await loadConfig();
20
- // Ask for API key
21
- const apiKey = await rl.question(`API Key${config.api_key ? ` (current: ${config.api_key.slice(0, 8)}...)` : ''}: `);
22
- if (apiKey.trim()) {
23
- // Validate API key
24
- const client = new ApiClient();
25
- client.setApiKey(apiKey.trim());
26
- console.log('\n Validating API key...');
27
- const validation = await client.validateApiKey();
28
- if (validation.success) {
29
- config.api_key = apiKey.trim();
30
- console.log(success('API key validated'));
31
- // Get default app config if available
32
- if (validation.data?.app_config?.id) {
33
- config.default_app_config_id = validation.data.app_config.id;
34
- console.log(success(`Default app config: ${validation.data.app_config.id}`));
19
+ const hasExistingConfig = await configExists();
20
+ const hasAnyOption = !!(options.apiKey ||
21
+ options.testDir ||
22
+ options.apiUrl ||
23
+ options.skipValidation ||
24
+ options.yes);
25
+ // No-op: already configured and no options provided
26
+ if (hasExistingConfig && config.api_key && !hasAnyOption) {
27
+ console.log(success('Already configured (.qa-use-tests.json)'));
28
+ console.log(` API key: ${config.api_key.slice(0, 8)}...`);
29
+ console.log(` Test dir: ${config.test_directory || './qa-tests'}`);
30
+ if (config.default_app_config_id) {
31
+ console.log(` App config: ${config.default_app_config_id}`);
32
+ }
33
+ console.log(`\n Run ${info("'qa-use info'")} for full details, or pass options to update.`);
34
+ return;
35
+ }
36
+ // Determine mode
37
+ const isHeadless = !!options.apiKey;
38
+ const isAutoConfirm = !!options.yes;
39
+ let apiKey;
40
+ let testDir;
41
+ if (isHeadless) {
42
+ // Headless mode: all values from CLI options
43
+ apiKey = options.apiKey;
44
+ testDir = options.testDir || config.test_directory || './qa-tests';
45
+ }
46
+ else if (isAutoConfirm) {
47
+ // Auto-confirm mode: use existing/default values
48
+ apiKey = config.api_key;
49
+ testDir = options.testDir || config.test_directory || './qa-tests';
50
+ if (!apiKey) {
51
+ console.log(error('No existing API key found. Use --api-key <key> or run interactive setup.'));
52
+ process.exit(1);
53
+ }
54
+ }
55
+ else {
56
+ // Interactive mode
57
+ console.log('🔧 QA-Use Setup\n');
58
+ const rl = readline.createInterface({
59
+ input: process.stdin,
60
+ output: process.stdout,
61
+ });
62
+ try {
63
+ apiKey = (await rl.question(`API Key${config.api_key ? ` (current: ${config.api_key.slice(0, 8)}...)` : ''}: `)).trim();
64
+ if (!apiKey) {
65
+ apiKey = config.api_key;
35
66
  }
67
+ const testDirAnswer = (await rl.question(`Test directory (default: ${config.test_directory || './qa-tests'}): `)).trim();
68
+ testDir = testDirAnswer || config.test_directory || './qa-tests';
69
+ }
70
+ finally {
71
+ rl.close();
72
+ }
73
+ }
74
+ // Apply API URL override if provided
75
+ if (options.apiUrl) {
76
+ config.api_url = options.apiUrl;
77
+ }
78
+ // Validate and store API key
79
+ if (apiKey) {
80
+ if (options.skipValidation) {
81
+ config.api_key = apiKey;
82
+ console.log(warning("API key validation skipped. Run 'qa-use info' to verify."));
36
83
  }
37
84
  else {
38
- console.log(error(`Invalid API key: ${validation.message}`));
39
- process.exit(1);
85
+ const client = new ApiClient(config.api_url);
86
+ client.setApiKey(apiKey);
87
+ console.log(' Validating API key...');
88
+ const validation = await client.validateApiKey();
89
+ if (validation.success) {
90
+ config.api_key = apiKey;
91
+ console.log(success('API key validated'));
92
+ if (validation.data?.app_config?.id) {
93
+ config.default_app_config_id = validation.data.app_config.id;
94
+ console.log(success(`Default app config: ${validation.data.app_config.id}`));
95
+ }
96
+ }
97
+ else {
98
+ console.log(error(`Invalid API key: ${validation.message}`));
99
+ process.exit(1);
100
+ }
40
101
  }
41
102
  }
42
- // Ask for test directory
43
- const testDir = await rl.question(`Test directory (default: ${config.test_directory || './qa-tests'}): `);
44
- if (testDir.trim()) {
45
- config.test_directory = testDir.trim();
103
+ // Set test directory
104
+ if (testDir) {
105
+ config.test_directory = testDir;
46
106
  }
47
107
  // Save configuration
48
108
  await saveConfig(config);
@@ -52,8 +112,14 @@ export const setupCommand = new Command('setup')
52
112
  console.log(error(`Setup failed: ${formatError(err)}`));
53
113
  process.exit(1);
54
114
  }
55
- finally {
56
- rl.close();
57
- }
58
115
  });
116
+ setupCommand.addHelpText('after', `
117
+ Examples:
118
+ qa-use setup Interactive setup
119
+ qa-use setup --api-key sk-xxx Non-interactive with validation
120
+ qa-use setup --api-key sk-xxx --test-dir ./e2e Custom test directory
121
+ qa-use setup --api-key sk-xxx --skip-validation Offline/CI setup
122
+ qa-use setup --yes Accept defaults for missing fields
123
+ qa-use setup No-op if already configured
124
+ `);
59
125
  //# sourceMappingURL=setup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE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D,CACA,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Auto-generated documentation content for the docs command.
3
+ * DO NOT EDIT MANUALLY — Generated from plugins/qa-use/skills/qa-use/
4
+ * Run 'bun run generate:docs' to regenerate.
5
+ */
6
+ export declare const MAIN_DOC = "---\nname: qa-use\ndescription: E2E testing and browser automation with qa-use CLI. Use when the user needs to run tests, verify features, automate browser interactions, or debug test failures.\nallowed-tools: Bash(qa-use *)\n---\n\n# qa-use\n\nE2E testing and browser automation for AI-driven development workflows.\n\n## Critical Insight: Plugin Commands as Shortcuts\n\n**For AI Harnesses (codex, opencode, etc.):**\n\nPlugin commands (slash commands like `/qa-use:verify`) are **convenience shortcuts** that wrap CLI workflows. Harnesses with only the Bash tool can access ALL functionality via CLI commands documented below.\n\n**Pattern throughout this document:**\n- **CLI Workflow**: Step-by-step CLI commands (works for ALL harnesses)\n- **Plugin Shortcut**: Optional slash command (convenience)\n\n## Core Workflow\n\n### 1. Browser Control & Session Lifecycle\n\n**CLI Workflow:**\n```bash\n# Create browser session\nqa-use browser create --viewport desktop\n\n# For localhost testing\nqa-use browser create --tunnel --no-headless\n\n# Navigate\nqa-use browser goto https://example.com\n\n# Snapshot to get element refs (ALWAYS do this before interacting)\nqa-use browser snapshot\n\n# Interact by ref\nqa-use browser click e3\nqa-use browser fill e5 \"text\"\n\n# Close\nqa-use browser close\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore https://example.com\n```\n(Wraps create + goto + snapshot with autonomous exploration)\n\n**Critical:** Always run `snapshot` before your **first** interaction on a page. Never guess element refs.\n\n**Snapshot Diff Feature (use it to avoid unnecessary snapshots):**\nAfter each action (goto, click, fill, etc.), the browser automatically shows DOM changes:\n- **Summary**: \"5 elements added, 1 element modified\"\n- **Added elements**: `+ [e54] generic \"Thanks for agreeing!\"` (green)\n- **Modified elements**: `~ [e18] checkbox \"I agree...\"` with `+attrs: checked, active` (yellow)\n- **Removed elements**: `- [e99] button \"Submit\"` (red)\n\n**When you can skip a full `snapshot`:** If the diff output from your last action already shows the element ref you need to interact with next, use it directly \u2014 no need for an intermediate `snapshot`. For example, if clicking a button shows `+ [e54] button \"Submit\"` in the diff, you can `click e54` immediately.\n\n**When you still need a full `snapshot`:** Run `snapshot` when you need to find elements that weren't in the diff (e.g., pre-existing elements you haven't interacted with yet), or when the diff was truncated (shows \"... and N more changes\").\n\n### 2. Understanding Blocks\n\n**What are blocks?**\n\nBlocks are atomic recorded interactions from a browser session. They are:\n- Automatically captured during any browser interaction (click, fill, goto, scroll, etc.)\n- Stored server-side with the session\n- Retrieved via `qa-use browser get-blocks`\n- The foundation for test generation\n\n**Why blocks matter:**\n- **Record-once, replay-many**: Interactive recording becomes automated test\n- **AI-friendly**: Agents can analyze blocks to understand user intent\n- **Version control**: Blocks stored with session enable test iteration\n- **Bridge CLI \u2192 Tests**: Natural workflow from exploration to automation\n\n**How blocks work:**\n\n```bash\n# 1. Create session and interact\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://example.com\nqa-use browser snapshot # Returns: [ref=e1] button\nqa-use browser click e1 # Records as block\nqa-use browser fill e5 \"text\" # Records as block\n\n# 2. Retrieve blocks (JSON array)\nqa-use browser get-blocks\n# Returns:\n# [\n# {\"type\": \"goto\", \"url\": \"...\", \"timestamp\": \"...\"},\n# {\"type\": \"click\", \"ref\": \"e1\", \"timestamp\": \"...\"},\n# {\"type\": \"fill\", \"ref\": \"e5\", \"value\": \"text\", \"timestamp\": \"...\"}\n# ]\n\n# 3. Generate test YAML from blocks\nqa-use browser generate-test -n \"my_test\" -o qa-tests/my_test.yaml\n\n# 4. Run generated test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n(Wraps the interactive workflow with AI-powered test generation)\n\n### 3. Test Management\n\n**CLI Workflow:**\n```bash\n# Run test by name\nqa-use test run login\n\n# Run with autofix (AI self-healing)\nqa-use test run login --autofix\n\n# Validate syntax\nqa-use test validate login\n\n# Show test details\nqa-use test info login\n\n# List test runs\nqa-use test runs --status failed\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:test-run login --autofix\n```\n(Convenience shortcut for common test execution)\n\n### 4. Test Sync Lifecycle\n\n**CLI Workflow:**\n```bash\n# Pull tests from cloud\nqa-use test sync pull\n\n# Push all local tests to cloud\nqa-use test sync push --all\n\n# Push specific test\nqa-use test sync push --id <uuid>\n\n# Force push (overwrite conflicts)\nqa-use test sync push --force\n\n# Compare local vs cloud\nqa-use test diff login.yaml\n```\n\n**No Plugin Shortcut** - Use CLI commands directly\n\n## Essential Commands\n\n### Browser Session Management\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser create` | Create remote browser session |\n| `qa-use browser create --tunnel` | Create local browser with API tunnel |\n| `qa-use browser create --no-headless` | Show browser window (tunnel mode only) |\n| `qa-use browser create --viewport <size>` | Set viewport: `desktop`, `tablet`, `mobile` |\n| `qa-use browser create --ws-url <url>` | Connect to existing WebSocket browser |\n| `qa-use browser create --after-test-id <uuid>` | Run a test first, then become interactive |\n| `qa-use browser create --var <key=value>` | Override app config variables (repeatable) |\n| `qa-use browser list` | List active sessions |\n| `qa-use browser status` | Show current session details (app_url, recording_url, etc.) |\n| `qa-use browser close` | Close active session |\n\nSessions auto-persist in `~/.qa-use.json`. One active session = no `-s` flag needed.\n\n### Navigation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser goto <url>` | Navigate to URL |\n| `qa-use browser back` | Go back |\n| `qa-use browser forward` | Go forward |\n| `qa-use browser reload` | Reload page |\n\n### Element Interaction\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser click <ref>` | Click element by ref |\n| `qa-use browser click --text \"Button\"` | Click by semantic description |\n| `qa-use browser fill <ref> \"value\"` | Fill input field |\n| `qa-use browser type <ref> \"text\"` | Type with delays (for autocomplete) |\n| `qa-use browser press <key>` | Press key (e.g., `Enter`, `Tab`) |\n| `qa-use browser check <ref>` | Check checkbox |\n| `qa-use browser uncheck <ref>` | Uncheck checkbox |\n| `qa-use browser select <ref> \"option\"` | Select dropdown option |\n| `qa-use browser hover <ref>` | Hover over element |\n| `qa-use browser scroll down 500` | Scroll by pixels |\n| `qa-use browser scroll-into-view <ref>` | Scroll element into view |\n| `qa-use browser drag <ref> --target <ref>` | Drag element to target |\n| `qa-use browser mfa-totp [ref] <secret>` | Generate TOTP code (optionally fill) |\n| `qa-use browser upload <ref> <file>...` | Upload file(s) to input (base64-encoded, works remote & tunnel) |\n\n### Inspection & Snapshot Diff\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser snapshot` | Get full ARIA tree with element refs (use only when diff output is insufficient) |\n| `qa-use browser url` | Get current URL |\n| `qa-use browser screenshot` | Save screenshot.png |\n| `qa-use browser screenshot file.png` | Save to custom path |\n| `qa-use browser screenshot --base64` | Output base64 to stdout |\n| `qa-use browser evaluate <expression>` | Execute JavaScript in browser context |\n\nThe snapshot-diff feature automatically displays DOM changes after each browser action:\n- **Added elements**: Shown with `+` prefix and green color \u2014 these refs are immediately usable\n- **Modified elements**: Shown with `~` prefix and yellow color, including attribute changes (`+attrs: checked`)\n- **Removed elements**: Shown with `-` prefix and red color \u2014 do NOT use these refs\n\n**Downloads:** When an action triggers a file download (e.g., clicking a download link), the response includes download info: filename, size, and a presigned URL. Use `qa-use browser downloads` to list all downloads or `--save <dir>` to save them locally.\n\nUse diff output to interact with newly appeared elements directly, without running a full `snapshot` first.\n\n### Test Operations\n\n| Command | Description |\n|---------|-------------|\n| `qa-use test run <name>` | Run test by name |\n| `qa-use test run --all` | Run all tests |\n| `qa-use test run <name> --tunnel` | Run with local browser tunnel |\n| `qa-use test run <name> --autofix` | Enable AI self-healing |\n| `qa-use test run <name> --update-local` | Persist AI fixes to file |\n| `qa-use test run <name> --download` | Download assets to `/tmp/qa-use/downloads/` |\n| `qa-use test run <name> --var key=value` | Override variable |\n| `qa-use test validate <name>` | Validate test syntax |\n| `qa-use test list` | List available tests |\n| `qa-use test info <name>` | Show test details (steps, tags, description) |\n| `qa-use test info --id <uuid>` | Show cloud test details by ID |\n| `qa-use test runs [name]` | List test run history |\n| `qa-use test runs --id <uuid>` | Filter runs by test ID |\n| `qa-use test runs --status failed` | Filter runs by status |\n| `qa-use test init` | Initialize test directory |\n| `qa-use test sync pull` | Pull tests from cloud |\n| `qa-use test sync push --all` | Push all local tests to cloud |\n| `qa-use test sync push --id <uuid>` | Push specific test |\n| `qa-use test sync push --force` | Push tests, overwriting conflicts |\n| `qa-use test diff <file>` | Compare local vs cloud test |\n| `qa-use test schema [path]` | View test definition schema |\n\n### API Operations (Dynamic OpenAPI)\n\n`qa-use api` dynamically discovers operations from `/api/v1/openapi.json` and caches metadata locally for offline fallback.\n\n| Command | Description |\n|---------|-------------|\n| `qa-use api ls` | List available `/api/v1/*` routes from OpenAPI |\n| `qa-use api ls --refresh` | Force refresh OpenAPI cache |\n| `qa-use api ls --offline` | Use cached OpenAPI metadata only |\n| `qa-use api /api/v1/tests` | Call endpoint (method inferred when possible) |\n| `qa-use api -X GET /api/v1/test-runs -f limit=5` | GET with query fields |\n| `qa-use api -X POST /api/v1/tests-actions/run --input body.json` | POST with JSON body file |\n| `qa-use api -X GET /api/v1/test-runs/<id>` | Fetch detail endpoint by ID |\n\n**No Plugin Shortcut** - Use CLI commands directly.\n\n### Logs & Debugging\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser logs console` | View console logs from session |\n| `qa-use browser logs console -s <id>` | View logs from specific/closed session |\n| `qa-use browser logs network` | View network request logs |\n| `qa-use browser logs network -s <id>` | View network logs from specific session |\n| `qa-use browser downloads` | List downloaded files from session |\n| `qa-use browser downloads --save <dir>` | Save downloaded files to local directory |\n| `qa-use browser downloads --json` | Output download info as JSON |\n\n### Test Generation\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser generate-test` | Generate test YAML from recorded session |\n| `qa-use browser generate-test -s <id>` | Generate from specific session |\n| `qa-use browser generate-test -n <name>` | Specify test name |\n| `qa-use browser generate-test -o <path>` | Specify output path |\n| `qa-use browser get-blocks` | Get recorded interaction blocks (JSON) |\n\n### Waiting\n\n| Command | Description |\n|---------|-------------|\n| `qa-use browser wait <ms>` | Fixed wait |\n| `qa-use browser wait-for-selector \".class\"` | Wait for selector |\n| `qa-use browser wait-for-load` | Wait for page load |\n\n### Variable Overrides\n\nUse `--var` to override app config variables at runtime. Common variables:\n\n| Variable | Description |\n|----------|-------------|\n| `base_url` | Base URL for the app (e.g., preview deployment URL) |\n| `login_url` | Login page URL |\n| `login_username` | Username/email for authentication |\n| `login_password` | Password for authentication |\n\nExample with ephemeral preview URL:\n```bash\nqa-use browser create --after-test-id <login-test-uuid> \\\n --var base_url=https://preview-123.example.com \\\n --var login_url=https://preview-123.example.com/auth/login\n```\n\n## Common Patterns\n\n### Pattern 1: Feature Verification\n\n**CLI Workflow:**\n```bash\n# 1. Search for existing test\nqa-use test list | grep \"login\"\n\n# 2. Run test with autofix\nqa-use test run login --autofix\n\n# 3. Debug failures\nqa-use browser logs console\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:verify \"login works with valid credentials\"\n```\n(Wraps the above CLI workflow with AI-powered test discovery and analysis)\n\n### Pattern 2: Record & Generate Test\n\n**CLI Workflow:**\n```bash\n# 1. Create session\nqa-use browser create --tunnel --no-headless\n\n# 2. Navigate and interact\nqa-use browser goto https://example.com\nqa-use browser snapshot\nqa-use browser click e1\nqa-use browser fill e5 \"test\"\n\n# 3. Generate test from blocks\nqa-use browser get-blocks\nqa-use browser generate-test -n \"my_test\"\n\n# 4. Run test\nqa-use test run my_test\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record start my_test\n# ... perform interactions ...\n/qa-use:record stop\n```\n\n### Pattern 3: Authenticated Exploration\n\n**CLI Workflow:**\n```bash\n# Create session that runs login test first\nqa-use browser create --after-test-id <login-test-uuid>\n\n# Session now authenticated, explore\nqa-use browser goto /dashboard\nqa-use browser snapshot\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:explore /dashboard\n```\n(Automatically handles auth detection and session creation)\n\n### Pattern 4: Edit Existing Test\n\n**CLI Workflow:**\n```bash\n# 1. Open test file in editor\nvim qa-tests/login.yaml\n\n# 2. Validate syntax\nqa-use test validate login\n\n# 3. Run to verify\nqa-use test run login\n```\n\n**Plugin Shortcut:**\n```\n/qa-use:record edit login\n```\n(AI-assisted editing with validation)\n\n### Pattern 5: Using Snapshot Diff to Avoid Unnecessary Snapshots\n\n**CLI Workflow:**\n```bash\n# Create session and navigate\nqa-use browser create --tunnel --no-headless\nqa-use browser goto https://evals.desplega.ai/checkboxes\n\n# goto shows diff \u2014 initial page load shows all elements:\n# Changes: 45 elements added\n# + [e18] checkbox \"I agree to the terms and conditions\"\n# + [e19] generic \"I agree to the terms and conditions\"\n\n# \u2705 Use ref from diff directly \u2014 no snapshot needed!\nqa-use browser click e18\n\n# Diff shows what changed:\n# Changes: 5 elements added, 1 element modified\n# + [e54] generic \"Thanks for agreeing!\"\n# + [e55] link \"Terms and Conditions\"\n# ~ [e18] checkbox \"I agree to the terms and conditions\"\n# +attrs: active, checked\n\n# \u2705 Can click e55 directly from diff output \u2014 no snapshot needed!\nqa-use browser click e55\n\n# \u274C Need to find an element NOT in the diff? Now run snapshot:\nqa-use browser snapshot\n```\n\n**Key principle:** Use diff output as your primary source of element refs after actions. Only fall back to `snapshot` when you need to find elements that weren't in the diff.\n\n**Benefits:**\n- Fewer API calls = faster automation\n- Diff refs are always fresh (just returned from the server)\n- Instantly see what changed (new elements, attribute changes, removals)\n\n**No Plugin Shortcut** - Automatic feature in all browser commands\n\n## CI/CD Integration\n\n### Running Tests in CI\n\n**Environment Variables:**\n```bash\nexport QA_USE_API_KEY=\"your-api-key\"\nexport QA_USE_REGION=\"us\" # Optional: \"us\" or \"auto\"\n```\n\n**Basic Test Execution:**\n```bash\n# Run all tests\nqa-use test run --all\n\n# Run specific tag\nqa-use test run --tag smoke\n\n# Exit codes: 0 = pass, 1 = fail\n```\n\n### GitHub Actions Example\n\n```yaml\nname: QA Tests\non: [push, pull_request]\n\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-node@v3\n with:\n node-version: '20'\n - name: Install qa-use\n run: npm install -g @desplega.ai/qa-use\n - name: Run tests\n run: qa-use test run --all\n env:\n QA_USE_API_KEY: ${{ secrets.QA_USE_API_KEY }}\n```\n\n### Test Artifacts\n\n**Screenshots:**\n- Automatically saved on failure\n- Location: `/tmp/qa-use/downloads/` (local) or cloud (remote)\n\n**Logs:**\n- Console logs: `qa-use browser logs console -s <session-id>`\n- Network logs: `qa-use browser logs network -s <session-id>`\n\n## Advanced Topics\n\n### Localhost Testing (Tunnel Mode)\n\n**When to use tunnel mode:**\n\n```\nTesting localhost (http://localhost:3000)?\n \u251C\u2500 YES \u2192 Use --tunnel\n \u2502 \u2514\u2500 qa-use browser create --tunnel [--no-headless]\n \u2502 (Starts local Playwright, creates localtunnel, keeps running)\n \u2502\n \u2514\u2500 NO (Public URL) \u2192 Use remote browser (default)\n \u2514\u2500 qa-use browser create\n (Uses desplega.ai cloud browser via WebSocket)\n```\n\n**The `--tunnel` flag is a binary choice:**\n- **Local tunnel mode**: Playwright on your machine + localtunnel\n- **Remote mode**: WebSocket URL to cloud-hosted browser\n\n**For test execution:**\n```bash\n# Local app\nqa-use test run my_test --tunnel [--headful]\n\n# Public app\nqa-use test run my_test\n```\n\n**Plugin shortcuts handle tunnel detection automatically:**\n```\n/qa-use:explore http://localhost:3000\n/qa-use:record start local_test\n```\n\nSee [references/localhost-testing.md](references/localhost-testing.md) for troubleshooting.\n\n### Session Persistence\n\nSessions are stored in `~/.qa-use.json` and have:\n- **TTL**: 30 minutes (default)\n- **Auto-resolve**: One active session = no `-s` flag needed\n- **Cleanup**: Automatic on timeout or explicit `browser close`\n\n### Block Limitations\n\n**What's captured:**\n- goto, click, fill, type, check, uncheck, select, hover\n- scroll, scroll-into-view, drag, upload, press\n\n**What's NOT captured:**\n- Assertions (must be added manually)\n- Waits (inferred from timing, may need adjustment)\n- Complex interactions (multi-drag, hover sequences)\n\n**Manual editing:** Edit generated YAML to add assertions and refine selectors.\n\n### WebSocket Sessions\n\n**Sharing sessions across processes:**\n```bash\n# Process 1: Create session\nqa-use browser create --tunnel\n# Output: ws://localhost:12345/browser/abc123\n\n# Process 2: Connect to session\nqa-use browser goto https://example.com --ws-url ws://localhost:12345/browser/abc123\n```\n\n## Deep-Dive References\n\n| Document | Description |\n|----------|-------------|\n| [browser-commands.md](references/browser-commands.md) | Complete browser CLI reference with all flags |\n| [test-format.md](references/test-format.md) | Full test YAML specification |\n| [localhost-testing.md](references/localhost-testing.md) | Tunnel setup for local development |\n| [failure-debugging.md](references/failure-debugging.md) | Failure classification and diagnostics |\n| [ci.md](references/ci.md) | CI/CD integration patterns and examples |\n\n## Templates\n\n| Template | Description |\n|----------|-------------|\n| [basic-test.yaml](templates/basic-test.yaml) | Simple navigation and assertion |\n| [auth-flow.yaml](templates/auth-flow.yaml) | Login flow with credentials |\n| [form-test.yaml](templates/form-test.yaml) | Form submission with validation |\n\n## Test Format Overview\n\n```yaml\nname: Login Test\ndescription: Validates login functionality with valid credentials\ntags:\n - smoke\n - auth\napp_config: <app-config-id>\nvariables:\n email: test@example.com\n password: secret123\ndepends_on: setup-test # Optional\nsteps:\n - action: goto\n url: /login\n - action: fill\n target: email input\n value: $email\n - action: click\n target: login button\n - action: to_be_visible\n target: dashboard\n```\n\nSee [references/test-format.md](references/test-format.md) for complete specification.\n\n## Common Mistakes\n\n| \u274C Wrong | \u2705 Correct |\n|---------|-----------|\n| `browser navigate <url>` | `browser goto <url>` |\n| `browser destroy` | `browser close` |\n| `browser close <session-id>` | `browser close` |\n| Guessing element refs | Use refs from diff output or `snapshot` |\n| Running `snapshot` after every action | Use diff output; only `snapshot` when needed |\n| Testing localhost without `--tunnel` | Use `--tunnel` flag |\n| `test sync --pull` | `test sync pull` (subcommand, not flag) |\n| `test sync --push` | `test sync push` (subcommand, not flag) |\n\n## npx Alternative\n\nAll commands use `qa-use` assuming global install. For one-off use:\n```bash\nnpx @desplega.ai/qa-use browser <command>\n```\n";
7
+ export declare const REFERENCE_DOCS: Record<string, {
8
+ title: string;
9
+ content: string;
10
+ }>;
11
+ export declare const TEMPLATES: Record<string, {
12
+ title: string;
13
+ content: string;
14
+ }>;
15
+ //# sourceMappingURL=docs-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-content.d.ts","sourceRoot":"","sources":["../../../../src/cli/generated/docs-content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,QAAQ,oxpBA0nBpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgnD7E,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiIxE,CAAC"}