我有多个使用FeatureSpec编写的套件,我使用> scala tests命令通过命令promt运行,或者我通过IDE运行它们,我正在寻找一种方法,我可以配置Test Suite序列以及哪些按顺序运行和哪些并行运行。
我的套房看起来像:
Suite1.scala ==>
const oneLiner = (hour = "00", min = "00", sec = "00") => `${(hour % 12) || 12}:${("0" + min).slice(-2)}:${sec} ${(hour < 12) ? 'am' : 'pm'}`
console.log('oneliner', oneLiner(..."13:05:12".split(":")))
const oneLinerWithObjectInput = ({hour = "00", min = "00", sec = "00"} = {}) => `${(hour % 12) || 12}:${("0" + min).slice(-2)}:${sec} ${(hour < 12) ? 'am' : 'pm'}`
console.log('onelinerWithObjectInput', oneLinerWithObjectInput({
hour: "13:05:12".split(":")[0],
min: "13:05:12".split(":")[1],
sec: "13:05:12".split(":")[2]
}))
const multiLineWithObjectInput = ({hour = "00", min = "00", sec = "00"} = {}) => {
const newHour = (hour % 12) || 12
, newMin = ("0" + min).slice(-2)
, ampm = (hour < 12) ? 'am' : 'pm'
return `${newHour}:${newMin}:${sec} ${ampm}`
}
console.log('multiLineWithObjectInput', multiLineWithObjectInput({
hour: "13:05:12".split(":")[0],
min: "13:05:12".split(":")[1],
sec: "13:05:12".split(":")[2]
}))
}
Suite2.scala ==&gt;
class Suite1 extends BaseFeatureSpec {
feature("Feature1") {
scenario("Scenario1") {//test code}
scenario("Scenario2") {//test code}
}
Suite3.scala ==&gt;
class Suite2 extends BaseFeatureSpec {
feature("Feature2") {
scenario("Scenario3") {//test code}
scenario("Scenario4") {//test code}
}
}
现在我想要的东西就像我可以并行运行Suite1(顺序为Suite 2和Suite 3)并将不同的配置并行传递给每个设置。
答案 0 :(得分:0)
我在所有测试类中添加了注释,
@DoNotDiscover
class TestClass1 extends FeatureSpec
{
//code
}
然后在新课程
中添加如下的经销商class TestDistributor extends Stepwise(
Sequential(new TestClass2, new TestClass4)
)
class TestDistributor2 extends Stepwise(
Sequential(new TestClass1, new TestClass3)
)
使用此测试套件(2和4将按顺序运行)并且与(1和3按顺序)并行