[英]Protractor - How to exclude spec file in the config file?
Suppose I have 10 spec files all are named *********.test.js
, I want to run my tests on all 9 files except the file Idontwantyou.test.js
.假设我有 10 个规范文件都命名为
*********.test.js
,我想对除文件Idontwantyou.test.js
之外的所有 9 个文件运行我的测试。
Currently I am finding my spec files in my config.file
with:目前我在我的
config.file
找到我的规范文件:
specs: ['*.test.js']
- this will run all 10 files. specs: ['*.test.js']
- 这将运行所有 10 个文件。
How do I make it run all the 9 test files but skip the Idontwantyou.test.js
?如何让它运行所有 9 个测试文件但跳过
Idontwantyou.test.js
?
You can exclude
the spec's by adding them in the exclude tag in you conf.js file.您可以通过将它们添加到 conf.js 文件的 exclude 标记中来
exclude
规范。 You can also add patterns to exclude many test scripts with similar names.您还可以添加模式以排除许多具有相似名称的测试脚本。 Here's how to do it -
这是如何做到的 -
exclude: ['Idontwantyou.test.js'],
More info can be found here .更多信息可以在这里找到。 Hope this helps.
希望这可以帮助。 If that link is broken, search theconfig file for "exclude".
如果该链接已损坏,请在配置文件中搜索“排除”。
As Grish suggested you can use exclude .正如 Grish 建议的那样,您可以使用 exclude 。 As per the comment of Darkbound the exact location is given below .Modify the config.js as per below .
根据 Darkbound 的评论,下面给出了确切的位置。按照下面的内容修改 config.js。
In here in specs: I mentioned the src/com/sam/scriptjs/ExcelTest.js but since I specifically excluded it , it won;t get picked .在规格中:我提到了 src/com/sam/scriptjs/ExcelTest.js 但由于我特意排除了它,它不会被选中。
exports.config = {
framework: 'jasmine',
multiCapabilities: [{
'browserName': 'firefox'
}, {
'browserName': 'chrome'
}],
seleniumAddress: 'http://localhost:4444/wd/hub',
exclude: ['src/com/sam/scriptjs/winstonlogs.spec.js','src/com/sam/scriptjs/ExcelTest.js'],
specs: ['src/com/sam/scriptjs/nonangularstackscript.spec.js','src/com/sam/scriptjs/radiobutton.spec.js','src/com/sam/scriptjs/ExcelTest.js']
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.