javascript - 如何使用命令行在 Protractor 中运行特定的测试用例

标签 javascript node.js protractor

我已经在 Protractor 中成功创建了我的测试用例。我想从命令行运行一个特定的测试用例。我的 conf.js 文件包含套装中的所有 spec.js。

当我运行 Protractor conf.js 时,我只想运行我在命令行中键入的规范。 例子 如果我有 3 个测试用例 A.js B.js 和 C.js 在测试套件中,我的 conf.js 中包含所有 3 个测试用例 当我运行 protractor conf.js -A.js 时,它应该运行测试用例 A.js。

请帮我看看我怎样才能实现它?

最佳答案

您只需将 --specs 作为参数传递即可简单地执行特定规范。

protractor config.js --specs test1.js

否则

您可以在 config.js 中为每个规范文件创建单独的套件并传递 --suite suitename 以执行特定测试。

关于javascript - 如何使用命令行在 Protractor 中运行特定的测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39388142/

相关文章:

javascript - jQuery 悬停处理函数在动态添加类后无法在悬停上工作

node.js - 如何更新 node.js 中的 Protractor npm 模块?

javascript - Protractor - 错误 : Index out of bound exception while using the same function for the second time

javascript - css代码如何更改事件导航按钮的颜色

javascript - typescript :调试失败。错误表达式:传递给 `ts.resolveTypeReferenceDirective` 的非字符串值

javascript - 读取所有目录条目内容

node.js - Chef 安装 Node 、npm 和包并运行它们

javascript - NPM MSSQL - 错误 : uncaughtException: Cannot read property 'release' of null

php - 使用 socket.io 和 redis 进行实时通知

javascript - JavaScript 闭包如何帮助 Protractor 测试自动化?