• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import file from '@system.file'
16import app from '@system.app'
17import device from '@system.device'
18import router from '@system.router'
19import {Core, Constant, DataDriver, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
20
21import data from '../../../test/data.json'
22
23export default {
24    data: {
25        title: ""
26    },
27    onInit() {
28        this.title = this.$t('strings.world');
29    },
30    onShow() {
31        console.info('onShow finish')
32        const core = Core.getInstance()
33        const dataDriver = new DataDriver({data:data})
34        const expectExtend = new ExpectExtend({
35            'id': 'extend'
36        })
37        const reportExtend = new ReportExtend(file)
38        const instrumentLog = new InstrumentLog({
39            'id': 'report',
40            'version': '1.0.3'
41        })
42        core.addService('dataDriver',dataDriver)
43        core.addService('expect', expectExtend)
44        core.addService('report', reportExtend)
45        core.addService('report', instrumentLog)
46        core.init()
47        core.subscribeEvent('spec', instrumentLog)
48        core.subscribeEvent('suite', instrumentLog)
49        core.subscribeEvent('task', instrumentLog)
50
51        const configService = core.getDefaultService('config')
52        configService.setConfig(this)
53
54        require('../../../test/List.test')
55        core.execute()
56    },
57    onReady() {
58    },
59}