getting readscript error when running botium-cli (Botium)

152 Views Asked by At

I am trying out botium-cli for the first time and I am unable to run the sample script. 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 (<anonymous>)
    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 (<anonymous>)
    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 (<anonymous>)
        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 (<anonymous>)
        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 "*"`
  }
}

Steps I took to run:

  • botium-cli init
  • botium-cli run

specs:

  • OSX Big Sur 11.2 (M1 mac)
  • node v14.15.4
  • botium-cli v1.0.4

Am I missing something or do I need a specific version of node?

1

There are 1 best solutions below

0
On

By default, Botium CLI will traverse the current directory for files that it considers to contain test cases. There are plenty of file formats supported by Botium - text, markdown, excel, csv, json, yaml and even custom formats (see Botium Docs for more information).

You can come around this issue by:

  • Place your test case files into another directory, suggested is to name it tests or spec, and use the --spec command line argument to Botium CLI to point to this directory that contains test files only.

  • Botium also respects a .gitignore file - so if you place the node_modules folder within a .gitignore file, it should work as well