[英]Angular2 + karma + protractor - run specific e2e test case
What command can I use to start specific e2e test case from test suite? 我可以使用什么命令从测试套件启动特定的e2e测试用例?
If this is not possible - running specific test suite may be some workaround. 如果这是不可能的 - 运行特定的测试套件可能是一些解决方法。
I use Jasmine, Karma and Protractor. 我使用Jasmine,Karma和Protractor。 I start my tests with command
我用命令开始我的测试
npm run e2e
which is defined in package.json
它在
package.json
定义
"e2e": "protractor protractor.config.js"
I can redefine this task (or create new one) 我可以重新定义这个任务(或者创建一个新任务)
"e2e-s": "protractor protractor.config.js --specs ./app/dashboard/e2e-spec.js"
But I'd like to perform this from command line. 但是我想从命令行执行此操作。
You can propagate arguments to the npm script via the --
: 您可以通过
--
: 将参数传播到npm脚本 :
npm run e2e -- --specs path/to/spec
Make sure you have the latest npm
installed. 确保安装了最新的
npm
。
You can also focus tests with fdescribe
/ ddescribe
in Jasmine and describe.only
in Mocha. 您还可以使用Jasmine中的
fdescribe
/ ddescribe
进行测试,并在Mocha中进行describe.only
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.