我可以使用规范或套件名称作为参数来运行 Protractor 测试吗? 我目前正在运行它:
protractor myconf.js
谢谢。
最佳答案
是的,有特定的--specs
命令行参数:
$ protractor --help
Usage: protractor [options] [configFile]
configFile defaults to protractor.conf.js
The [options] object will override values from the config file.
Options:
--help Print Protractor help menu
--version Print Protractor version
...
--specs Comma-separated list of files to test
您仍然需要传递配置,但是 --specs
会覆盖配置中设置的 specs
:
protractor myconf.js --specs=test/e2e/myspec.js
您还可以使用 --suite
command-line argument :
protractor myconf.js --suite=smoke
其中 smoke
匹配配置的套件名称:
suites: {
smoke: 'spec/smoketests/*.js',
full: 'spec/*.js'
},
或者,如果您使用的是 jasmine2
,则可以使用 "focused tests" feature通过暂时将 describe
更改为 fdescribe
和/或将 it
更改为 fit
。
关于javascript - Protractor - 发送规范/套件名称作为参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31382299/