

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 指定测试命令
<a name="report-group-test-case-commands"></a>

 您可以在 buildspec 文件的 `commands` 部分中指定运行测试用例的命令。这些命令运行您在 buildspec 文件的 `reports` 部分中为报告组指定的测试用例。以下是 `commands` 部分的示例，其中包含用于运行测试文件中的测试的命令：

```
commands:
    - echo Running tests for surefire junit
    - mvn test -f surefire/pom.xml -fn
    - echo
    - echo Running tests for cucumber with json plugin
    - mvn test -Dcucumber.options="--plugin json:target/cucumber-json-report.json" -f cucumber-json/pom.xml -fn
```

有关更多信息，请参阅 [buildspec 语法](build-spec-ref.md#build-spec-ref-syntax)。