add-scene.js
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const config = require('../config.json');
const caseLayout = require('../libs/case-layout');
global.TEST_PLATFORM = 'ios'
config.cases = {
ios: [{
name: '商品详情页',
scenes: ['IOS_PRODUCT_DETAIL']
}, {
name: '购物车',
scenes: ['IOS_UFO_PRODUCT_DETAIL', 'IOS_PRODUCT_CART']
}]
}
caseLayout.addScene({
scene: 'IOS_PRODUCT_DETAIL',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
caseLayout.addScene({
scene: 'IOS_PRODUCT_DETAIL2',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
caseLayout.addScene({
scene: 'IOS_UFO_PRODUCT_DETAIL',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
caseLayout.addScene({
scene: 'IOS_UFO_PRODUCT_DETAIL2',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
caseLayout.addScene({
scene: 'IOS_PRODUCT_CART',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
caseLayout.addScene({
scene: 'IOS_UFO_PRODUCT_CART2',
driverFn: () => {},
title: '111',
caps: {port: 2222},
serverConfig: {port: 2222}
})
const cases = caseLayout.getCases();
console.log(cases[0].scenes[0].scene === 'IOS_PRODUCT_DETAIL')
console.log(cases[1].scenes[0].scene === 'IOS_UFO_PRODUCT_DETAIL')
console.log(cases[1].scenes[1].scene === 'IOS_PRODUCT_CART')
console.log(cases[2].scenes[0].scene === 'IOS_PRODUCT_DETAIL2')
console.log(cases[3].scenes[0].scene === 'IOS_UFO_PRODUCT_DETAIL2')
console.log(cases[4].scenes[0].scene === 'IOS_UFO_PRODUCT_CART2')