• 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} 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    */
48    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100', 0, async function (done) {
49      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0100');
50      let callbackdata = (data) => {
51      }
52      accessibility.on('accessibilityStateChange', callbackdata);
53      accessibility.off('accessibilityStateChange', callbackdata);
54      expect(true).assertTrue();
55      done();
56    })
57
58    /*
59    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200
60    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200
61    * @tc.desc    on(touchGuideStateChange)
62    * @tc.size    SmallTest
63    * @tc.type    User
64    */
65    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200', 0, async function (done) {
66      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0200');
67      let callbackdata = (data) => {
68      }
69      accessibility.on('touchGuideStateChange', callbackdata);
70      accessibility.off('touchGuideStateChange', callbackdata);
71      expect(true).assertTrue();
72      done();
73    })
74
75    /*
76    * @tc.number  SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300
77    * @tc.name    SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300
78    * @tc.desc    on(screenReaderStateChange)
79    * @tc.size    SmallTest
80    * @tc.type    User
81    */
82    it('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300', 0, async function (done) {
83      console.info('SUB_BASIC_BARRIERFREE_API_AccessibleRegisterState_0300');
84      let callbackdata = (data) => {
85      }
86      accessibility.on('screenReaderStateChange', callbackdata);
87      accessibility.off('screenReaderStateChange', callbackdata);
88      expect(true).assertTrue();
89      done();
90    })
91})
92}
93