• 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType, Size, Level} from '@ohos/hypium'
16import accessibility from '@ohos.accessibility'
17import { Driver } from '@ohos.UiTest';
18
19const bundleName = 'com.sample.testfora11y';
20const triggerAction = 'accessibilityFocus';
21const eventType = 'accessibilityFocus';
22
23export default function AccessibleRegisterState() {
24describe('AccessibleRegisterState', function () {
25    beforeAll(async function (done) {
26        let driver = Driver.create();
27        console.info(`AccessibleRegisterState: beforeAll starts`);
28        done();
29    })
30
31    beforeEach(async function (done) {
32        console.info(`AccessibleRegisterState: beforeEach starts`);
33        done();
34    })
35
36    afterEach(async function (done) {
37        console.info(`AccessibleRegisterState: afterEach starts`);
38        done();
39    })
40
41    /*
42    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100
43    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100
44    * @tc.desc    on(accessibilityStateChange)
45    * @tc.size    SmallTest
46    * @tc.type    User
47    * @tc.level   Level 1
48    */
49    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100', TestType.FUNCTION | Size.SmallTest| Level.LEVEL0, async function (done) {
50      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100');
51      let callbackdata = (data) => {
52      }
53      accessibility.on('accessibilityStateChange', callbackdata);
54      accessibility.off('accessibilityStateChange', callbackdata);
55      expect(true).assertTrue();
56      done();
57    })
58
59    /*
60    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200
61    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200
62    * @tc.desc    on(touchGuideStateChange)
63    * @tc.size    SmallTest
64    * @tc.type    User
65    * @tc.level   Level 1
66    */
67    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200', TestType.FUNCTION | Size.SmallTest| Level.LEVEL0, async function (done) {
68      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200');
69      let callbackdata = (data) => {
70      }
71      accessibility.on('touchGuideStateChange', callbackdata);
72      accessibility.off('touchGuideStateChange', callbackdata);
73      expect(true).assertTrue();
74      done();
75    })
76
77    /*
78    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300
79    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300
80    * @tc.desc    on(screenReaderStateChange)
81    * @tc.size    SmallTest
82    * @tc.type    User
83    * @tc.level   Level 1
84    */
85    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300', TestType.FUNCTION | Size.SmallTest| Level.LEVEL1, async function (done) {
86      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300');
87      let callbackdata = (data) => {
88      }
89      accessibility.on('screenReaderStateChange', callbackdata);
90      accessibility.off('screenReaderStateChange', callbackdata);
91      expect(true).assertTrue();
92      done();
93    })
94
95    /*
96    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0400
97    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0400
98    * @tc.desc    on(touchModeChange)
99    * @tc.size    SmallTest
100    * @tc.type    User
101    * @tc.level   Level 1
102    */
103    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0400', TestType.FUNCTION | Size.SmallTest| Level.LEVEL1, async function (done) {
104        console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0400');
105        let callbackdata = (data) => {
106        }
107        accessibility.on('touchModeChange', callbackdata);
108        accessibility.off('touchModeChange', callbackdata);
109        expect(true).assertTrue();
110        done();
111    })
112})
113}
114