0

我是第一次尝试 botium-cli,但无法运行示例脚本。我收到以下错误:

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 "*"`
  }
}

我运行的步骤:

  • botium-cli 初始化
  • botium-cli 运行

眼镜:

  • OSX 大苏尔 11.2 (M1 mac)
  • 节点 v14.15.4
  • botium-cli v1.0.4

我错过了什么还是需要特定版本的节点?

4

1 回答 1

0

默认情况下,Botium CLI 将遍历当前目录以查找它认为包含测试用例的文件。Botium 支持多种文件格式 - 文本、markdown、excel、csv、json、yaml 甚至自定义格式(有关更多信息,请参阅 Botium 文档)。

您可以通过以下方式解决此问题:

  • 将您的测试用例文件放入另一个目录,建议将其命名为testsspec,并使用 Botium CLI 的--spec命令行参数指向仅包含测试文件的目录。

  • Botium 也尊重.gitignore 文件- 所以如果你将 node_modules 文件夹放在 .gitignore 文件中,它应该也可以工作

于 2021-02-18T07:44:03.907 回答