add-scene.js 1.58 KB
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')