• 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';
16
17import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
18import testsuite from "../../test/List.test"
19
20
21@Entry
22@Component
23struct Index {
24
25  aboutToAppear(){
26    console.info("start run testcase!!!!")
27    const core = Core.getInstance()
28    const expectExtend = new ExpectExtend({
29      'id': 'extend'
30    })
31    core.addService('expect', expectExtend)
32    const reportExtend = new ReportExtend(file)
33
34    core.addService('report', reportExtend)
35    core.init()
36    core.subscribeEvent('task', reportExtend)
37    const configService = core.getDefaultService('config')
38    console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
39    globalThis.abilityWant.parameters.timeout = 70000;
40    configService.setConfig(globalThis.abilityWant.parameters)
41    testsuite(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
42    core.execute()
43  }
44
45  build() {
46    Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
47      Text('Hello World')
48        .fontSize(50)
49        .fontWeight(FontWeight.Bold)
50      Button() {
51        Text('next page')
52          .fontSize(25)
53          .fontWeight(FontWeight.Bold)
54      }.type(ButtonType.Capsule)
55      .margin({
56        top: 20
57      })
58      .backgroundColor('#0D9FFB')
59      .onClick(() => {
60      })
61    }
62    .width('100%')
63    .height('100%')
64  }
65}