form-tester 0.8.1 → 0.8.2

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.
@@ -16,14 +16,23 @@ Test modes:
16
16
  form-tester test <url> --auto
17
17
  form-tester test <url> --auto --pnr 12345 --persona ung-mann
18
18
 
19
- # Human mode — prompts for persona, scenario, person selection:
19
+ # Human mode — user chooses persona and scenario:
20
+ # Step 1: Run without flags to see available personas:
20
21
  form-tester test <url> --human
22
+ # Step 2: Ask the user which persona and scenario they want.
23
+ # Step 3: Re-run with their choices:
24
+ form-tester test <url> --human --persona ung-mann --scenario "test validation"
21
25
 
22
26
  # Full interactive CLI:
23
27
  form-tester
24
28
  ```
25
29
 
26
- When the user asks for human/interactive mode, use `--human`. Otherwise default to `--auto`.
30
+ When the user asks for human/interactive mode, use `--human`:
31
+ 1. First run `form-tester test <url> --human` (no flags) to get the persona list.
32
+ 2. Show the personas to the user and ask them to choose.
33
+ 3. Ask the user for a test scenario (or use "" for standard).
34
+ 4. Re-run with their choices: `form-tester test <url> --human --persona <id> --scenario "<text>"`
35
+ Otherwise default to `--auto`.
27
36
 
28
37
  Commands:
29
38
  ```
@@ -20,8 +20,9 @@ form-tester install --global # or install to ~/.claude/skills/
20
20
  form-tester test <url> --auto
21
21
  form-tester test <url> --auto --pnr 12345 --persona ung-mann --scenario "test validation"
22
22
 
23
- # Interactive mode (prompts for persona, scenario, etc.):
24
- form-tester test <url> --human
23
+ # Human mode (user picks persona and scenario):
24
+ form-tester test <url> --human # lists personas, ask user
25
+ form-tester test <url> --human --persona ung-mann --scenario "test X" # run with user's choices
25
26
 
26
27
  # Full interactive CLI:
27
28
  form-tester
@@ -17,8 +17,9 @@ form-tester install
17
17
  form-tester test <url> --auto
18
18
  form-tester test <url> --auto --pnr 12345 --persona ung-mann --scenario "test validation"
19
19
 
20
- # Human mode — prompts for persona, scenario, person selection:
21
- form-tester test <url> --human
20
+ # Human mode — user chooses persona and scenario:
21
+ form-tester test <url> --human # lists personas
22
+ form-tester test <url> --human --persona ung-mann --scenario "test X" # run with choices
22
23
 
23
24
  # Full interactive CLI:
24
25
  form-tester
@@ -26,7 +27,11 @@ form-tester
26
27
 
27
28
  Persona IDs: `ung-mann`, `gravid-kvinne`, `eldre-kvinne`, `kronisk-syk-mann`. Defaults to "noen" if omitted.
28
29
 
29
- When the user asks for `--human` mode, use that flag. Otherwise default to `--auto`.
30
+ When the user asks for `--human` mode:
31
+ 1. Run `form-tester test <url> --human` to get persona list.
32
+ 2. Ask the user to pick a persona and scenario.
33
+ 3. Re-run: `form-tester test <url> --human --persona <id> --scenario "<text>"` (use `""` for standard test).
34
+ Otherwise default to `--auto`.
30
35
 
31
36
  ## Commands
32
37
 
package/form-tester.js CHANGED
@@ -6,7 +6,7 @@ const { spawn, execSync } = require("child_process");
6
6
 
7
7
  const CONFIG_PATH = path.join(process.cwd(), "form-tester.config.json");
8
8
  const OUTPUT_BASE = path.resolve(process.cwd(), "output");
9
- const LOCAL_VERSION = "0.8.1";
9
+ const LOCAL_VERSION = "0.8.2";
10
10
  const RECOMMENDED_PERSON = "Uromantisk Direktør";
11
11
 
12
12
  // Recording — persisted to disk so `form-tester exec` can append across processes
@@ -1321,10 +1321,31 @@ async function main() {
1321
1321
  const config = loadConfig();
1322
1322
  const url = args.find((a) => a.startsWith("http"));
1323
1323
  if (!url) {
1324
- console.error("Usage: form-tester test <url> --human");
1324
+ console.error("Usage: form-tester test <url> --human --persona <id> --scenario \"<text>\"");
1325
1325
  process.exit(1);
1326
1326
  }
1327
- await handleTest(url, config);
1327
+ const flagVal = (flag) => args.includes(flag) ? args[args.indexOf(flag) + 1] : undefined;
1328
+ const personaFlag = flagVal("--persona");
1329
+ const scenarioFlag = flagVal("--scenario");
1330
+
1331
+ // If persona or scenario missing, print choices and exit so the AI can ask the user
1332
+ if (!personaFlag || scenarioFlag === undefined) {
1333
+ console.log("HUMAN MODE: Ask the user to choose persona and scenario, then re-run with flags.\n");
1334
+ console.log("Available personas:");
1335
+ console.log(formatPersonaList());
1336
+ console.log("\nPersona IDs: ung-mann, gravid-kvinne, eldre-kvinne, kronisk-syk-mann, noen");
1337
+ console.log("\nRe-run with: form-tester test <url> --human --persona <id> --scenario \"<description>\"");
1338
+ console.log("Use --scenario \"\" for standard test.");
1339
+ process.exit(0);
1340
+ }
1341
+
1342
+ // Run with user's choices
1343
+ await handleTestAuto(url, config, {
1344
+ pnr: flagVal("--pnr"),
1345
+ persona: personaFlag,
1346
+ scenario: scenarioFlag || undefined,
1347
+ verbosity: "normal",
1348
+ });
1328
1349
  process.exit(0);
1329
1350
  }
1330
1351
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-tester",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "AI-powered form testing skill for /skjemautfyller forms using Playwright CLI. Works with Claude Code and GitHub Copilot.",
5
5
  "main": "form-tester.js",
6
6
  "bin": {