Unable to run botium-cli

I installed the cli through npm and haven’t been able to run the sample conversation. I get the following error:

xxxx-MacBook-Pro:Botium xxxxx$ npx botium-cli run --convos .
/Users/xxx/Desktop/Botium/node_modules/yargs/build/index.cjs:2772
throw err;
^

BotiumError: ReadScript - an error occurred at ‘node_modules/accepts/HISTORY.md’ file: “" not expected here (Line 4): expecting parent “##” for "
at botiumErrorFromErr (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/BotiumError.js:85:12)
at ScriptingProvider.ReadScript (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:522:13)
at /Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:452:71
at Array.forEach ()
at ScriptingProvider.ReadScriptsFromDirectory (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:451:14)
at /Users/xxxx/Desktop/Botium/node_modules/botium-cli/src/run/index.js:109:14
at Array.forEach ()
at handler (/Users/xxxx/Desktop/Botium/node_modules/botium-cli/src/run/index.js:108:15)
at Object.builder.handler (/Users/xxx/Desktop/Botium/node_modules/botium-cli/bin/botium-cli.js:34:7)
at Object.runCommand (/Users/xxxxx/Desktop/Botium/node_modules/yargs/build/index.cjs:446:48) {
context: {
err: Error: “" not expected here (Line 4): expecting parent “##” for "
at _toStructuredMarkdown (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/CompilerMarkdown.js:55:19)
at CompilerMarkdown.Compile (/Users/xxx/Desktop/Botium/node_modules/botium-core/src/scripting/CompilerMarkdown.js:70:24)
at ScriptingProvider.Compile (/Users/xxxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:407:21)
at ScriptingProvider.ReadScript (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:515:31)
at /Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:452:71
at Array.forEach ()
at ScriptingProvider.ReadScriptsFromDirectory (/Users/xxxx/Desktop/Botium/node_modules/botium-core/src/scripting/ScriptingProvider.js:451:14)
at /Users/xxxx/Desktop/Botium/node_modules/botium-cli/src/run/index.js:109:14
at Array.forEach ()
at handler (/Users/xxxxx/Desktop/Botium/node_modules/botium-cli/src/run/index.js:108:15),
message: ReadScript - an error occurred at 'node_modules/accepts/HISTORY.md' file: "*" not expected here (Line 4): expecting parent "##" for "*"
}
}

OS settings:
* OSX Big Sur 11.2 (M1 mac)
* node v14.15.4
* botium-cli v1.0.4

Steps to run:
* botium-cli init
* botium-cli run

By default, botium-cli is looking for test case files in the current directory, and it reads all file extensions it can handle - markdown is among the supported formats. In your case, there is a node_modules directory which contains some markdown files which are not Botium test cases, so botium-cli fails to load. You can overcome this by either one of:

  • Install botium-cli globally (npm install -g botium-cli), so no node_modules directory is created locally
  • Create a .gitignore file and add the node_moduls folder to it - Botium respects .gitignore if present
  • Use the –spec command line switch (botium-cli run --spec ./spec) to make Botium read a subdirectory only
1 Like