我最近选择了一个使用 Protractor 的项目。
我无法理解套件和规范之间的区别。当我在运行该文件夹后运行测试文件夹时,我也遇到了套件问题 我运行了另一个测试文件夹,但所有测试都失败了。任何帮助都会很好,下面列出了套件的外观。
例子:
suites: {
CSRSmokeTest: '../smoke/Video/**.js'
DesktopSmokeTest: '../smoke/deskTop/**.js'
},
最佳答案
套件对于组织测试非常有用。
这个问题实际上归结为套件和一般测试用例之间的差异。引自 wikipedia "Test suite" definition :
a collection of test cases that are intended to be used to test a software program to show that it has some specified set of behaviours. A test suite often contains detailed instructions or goals for each collection of test cases and information on the system configuration to be used during testing.
换句话说,测试套件是由共同属性、逻辑联合起来的规范/测试用例的集合。例如,您可能拥有适用于应用程序不同类型功能的套件,主页
、搜索
等:
suites: {
homepage: 'tests/e2e/homepage/**/*Spec.js',
search: [
'tests/e2e/contact_search/**/*Spec.js',
'tests/e2e/venue_search/**/*Spec.js'
]
},
和/或,您可能将规范按测试类型分组到套件中:
suites: {
smoke: 'tests/e2e/smoke/*.js',
performance: 'tests/e2e/performance/*.js'
},
或者,您可以将所有“回归”测试放入一个单独的套件中。或者,您可以将自己的逻辑应用于组规范。
请务必注意,单个规范可以是多个测试套件的一部分。
关于javascript - 套件与规范 Protractor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30331018/