AccessibleSendEvent.test.js 158.2 KB
Newer Older
Y
yichengzhao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
J
jiyong_sd 已提交
15
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
Y
yichengzhao 已提交
16 17 18 19 20 21
import accessibility from '@ohos.accessibility'

const bundleName = 'com.sample.testfora11y';
const triggerAction = 'accessibilityFocus';
const eventType = 'accessibilityFocus';

J
jiyong_sd 已提交
22
export default function AccessibleSendEvent() {
Y
yichengzhao 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35
describe('AccessibleSendEvent', function () {

    beforeEach(async function (done) {
        console.info(`AccessibleSendEvent: beforeEach starts`);
        done();
    })

    afterEach(async function (done) {
        console.info(`AccessibleSendEvent: afterEach starts`);
        setTimeout(done, 1000);
    })
    
    /******************************************************************************** */
M
Mupceet 已提交
36
    /* Cases SendEvent_0010-0020 & SendEvent_Null_0010-0020  & SendEvent_construct_0010*/
Y
yichengzhao 已提交
37 38 39
    /*    are for accessibility.sendEvent() API test                                  */
    /******************************************************************************** */
    
M
Mupceet 已提交
40
   /*
Y
yichengzhao 已提交
41 42
    * @tc.number  SendEvent_0010
    * @tc.name    SendEvent_0010
Y
yichengzhao 已提交
43 44
    * @tc.desc    The parameter input is EventInfo, test the sendEvent() function
    *             The result of sendEvent() should be equal to an error code with no error
Y
yichengzhao 已提交
45 46 47
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
48 49
    it('SendEvent_0010', 0, async function (done) {
        console.info('SendEvent_0010');
Y
yichengzhao 已提交
50 51 52 53 54 55
        let event = new accessibility.EventInfo();
        event.type = eventType;
        event.bundleName = bundleName;
        event.triggerAction = triggerAction;

        accessibility.sendEvent(event, (err, data) => {
Y
yichengzhao 已提交
56 57 58 59 60
            console.info(`AccessibleSendEvent: SendEvent_0010 has error: ${err.code}`);
            expect(err.code).assertEqual(0);
            console.info(`AccessibleSendEvent: SendEvent_0010 has data: ${data}`);
            expect(data).assertEqual(undefined);
            done();      
Y
yichengzhao 已提交
61 62 63 64
        })
    })

    /*
Y
yichengzhao 已提交
65 66
    * @tc.number  SendEvent_0020
    * @tc.name    SendEvent_0020
Y
yichengzhao 已提交
67 68
    * @tc.desc    The parameter input is EventInfo, test the sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
69 70 71
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
72 73
    it('SendEvent_0020', 0, async function (done) {
        console.info('SendEvent_0020');
Y
yichengzhao 已提交
74 75 76 77 78 79
        let event = new accessibility.EventInfo();
        event.type = eventType;
        event.bundleName = bundleName;
        event.triggerAction = triggerAction;

        accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
80 81
            console.info(`AccessibleSendEvent: SendEvent_0020 result ${result}`);
            expect(result).assertEqual(undefined);
Y
yichengzhao 已提交
82 83
            done();
        }).catch((err) => {
Y
yichengzhao 已提交
84
            console.error(`AccessibleSendEvent: SendEvent_0020 has error: ${err}`);
Y
yichengzhao 已提交
85 86 87 88 89 90
            expect(null).assertFail();
            done();
        });
    })

    /*
Y
yichengzhao 已提交
91 92
    * @tc.number  SendEvent_null_0010
    * @tc.name    SendEvent_null_0010
Y
yichengzhao 已提交
93 94
    * @tc.desc    The parameter input is null, test the sendEvent() function
    *             The result of sendEvent() should be equal to an error code with error
Y
yichengzhao 已提交
95 96 97
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
98 99
    it('SendEvent_null_0010', 0, async function (done) {
        console.info('SendEvent_null_0010');
Y
yichengzhao 已提交
100 101 102
        let event = null;

        accessibility.sendEvent(event, (err, data) => {
Y
yichengzhao 已提交
103 104 105 106
            console.info(`AccessibleSendEvent: SendEvent_null_0010 has error: ${err.code}`);
            expect(err.code).assertEqual(-1);
            console.info(`AccessibleSendEvent: SendEvent_null_0010 has data: ${data}`);
            expect(data).assertEqual(undefined);
Y
yichengzhao 已提交
107 108 109 110 111
            done();
        })
    })

    /*
Y
yichengzhao 已提交
112 113
    * @tc.number  SendEvent_null_0020
    * @tc.name    SendEvent_null_0020
Y
yichengzhao 已提交
114 115
    * @tc.desc    The parameter input is null, test the sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
116 117 118
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
119 120
    it('SendEvent_null_0020', 0, async function (done) {
        console.info('SendEvent_null_0020');
Y
yichengzhao 已提交
121 122
        let event = null;

Y
yichengzhao 已提交
123 124 125
        accessibility.sendEvent(event).then((result) => {           
            console.error(`AccessibleSendEvent: SendEvent_null_0020 result ${result}`);
            expect(null).assertFail();            
Y
yichengzhao 已提交
126 127
            done();
        }).catch((err) => {
Y
yichengzhao 已提交
128 129
            console.info(`AccessibleSendEvent: SendEvent_null_0020 has error: ${err}`);
            expect(err).assertEqual(undefined);
Y
yichengzhao 已提交
130 131 132
            done();
        });
    })
Y
yichengzhao 已提交
133

M
Mupceet 已提交
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
      /*
    * @tc.number  SendEvent_construct_0010
    * @tc.name    SendEvent_construct_0010
    * @tc.desc    The parameter input is EventInfo, test the sendEvent() function
    *             The result of sendEvent() should be equal to an error code with no error.
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
    it('SendEvent_construct_0010', 0, async function (done) {
      console.info('SendEvent_construct_0010');
      let jsonObj = {
        type : eventType,
        bundleName : bundleName,
        triggerAction : triggerAction,
      }

      let event = new accessibility.EventInfo(jsonObj);

      accessibility.sendEvent(event, (err, data) => {
          console.info(`AccessibleSendEventTest: SendEvent_construct_0010 has error: ${err.code}`);
          expect(err.code).assertEqual(0);
          console.info(`AccessibleSendEventTest: SendEvent_construct_0010 has data: ${data}`);
          expect(data).assertEqual(undefined);
          done();
      })
    })

Y
yichengzhao 已提交
163
    /*********************************************************************************************************** */
M
Mupceet 已提交
164 165
    /* Cases SendEvent_type_0010-SendEvent_itemCount_constructor_0030 
    /* are for interface accessibility.EventInfo API test                                                        */
Y
yichengzhao 已提交
166 167
    /*********************************************************************************************************** */

M
Mupceet 已提交
168
   /*
Y
yichengzhao 已提交
169 170 171
    * @tc.number  SendEvent_type_0010
    * @tc.name    SendEvent_type_0010
    * @tc.desc    The type of EventInfo is 'accessibilityFocus', test sendEvent() function
Y
yichengzhao 已提交
172
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
173 174 175 176 177 178 179 180 181 182 183 184
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0010 starts`);

    let eventType = 'accessibilityFocus';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
185 186
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
187 188 189 190 191 192 193
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
  /*
    * @tc.number  SendEvent_type_constructor_0010
    * @tc.name    SendEvent_type_0010
    * @tc.desc    The type of EventInfo is 'accessibilityFocus', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0010 starts`);

    let eventType = 'accessibilityFocus';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
227 228 229 230
  /*
    * @tc.number  SendEvent_type_0020
    * @tc.name    SendEvent_type_0020
    * @tc.desc    The type of EventInfo is 'accessibilityFocusClear', test sendEvent() function
Y
yichengzhao 已提交
231
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
232 233 234 235 236 237 238 239 240 241 242 243
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0020 starts`);

    let eventType = 'accessibilityFocusClear';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
244 245
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
246 247 248 249 250 251 252
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
  /*
    * @tc.number  SendEvent_type_constructor_0020
    * @tc.name    SendEvent_type_0020
    * @tc.desc    The type of EventInfo is 'accessibilityFocusClear', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0020 starts`);

    let eventType = 'accessibilityFocusClear';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
286 287 288 289
  /*
    * @tc.number  SendEvent_type_0030
    * @tc.name    SendEvent_type_0030
    * @tc.desc    The type of EventInfo is 'click', test sendEvent() function
Y
yichengzhao 已提交
290
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
291 292 293 294 295 296 297 298 299 300 301 302
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0030 starts`);

    let eventType = 'click';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
303 304
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
305 306 307 308 309 310 311
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
  /*
    * @tc.number  SendEvent_type_constructor_0030
    * @tc.name    SendEvent_type_constructor_0030
    * @tc.desc    The type of EventInfo is 'click', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0030 starts`);

    let eventType = 'click';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
345 346 347 348
  /*
    * @tc.number  SendEvent_type_0040
    * @tc.name    SendEvent_type_0040
    * @tc.desc    The type of EventInfo is 'longClick', test sendEvent() function
Y
yichengzhao 已提交
349
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
350 351 352 353 354 355 356 357 358 359 360 361
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0040 starts`);

    let eventType = 'longClick';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
362 363
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
364 365 366 367 368 369 370
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
  /*
    * @tc.number  SendEvent_type_constructor_0040
    * @tc.name    SendEvent_type_constructor_0040
    * @tc.desc    The type of EventInfo is 'longClick', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0040 starts`);

    let eventType = 'longClick';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
404 405 406 407
  /*
    * @tc.number  SendEvent_type_0050
    * @tc.name    SendEvent_type_0050
    * @tc.desc    The type of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
408
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
409 410 411 412 413 414 415 416 417 418 419 420
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0050 starts`);

    let eventType = 'focus';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
421 422
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
423 424 425 426 427 428 429
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
  /*
    * @tc.number  SendEvent_type_constructor_0050
    * @tc.name    SendEvent_type_constructor_0050
    * @tc.desc    The type of EventInfo is 'focus', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0050 starts`);

    let eventType = 'focus';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
458 459 460 461
  /*
    * @tc.number  SendEvent_type_0060
    * @tc.name    SendEvent_type_0060
    * @tc.desc    The type of EventInfo is 'select', test sendEvent() function
Y
yichengzhao 已提交
462
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
463 464 465 466 467 468 469 470 471 472 473 474
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0060 starts`);

    let eventType = 'select';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
475 476
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
477 478 479 480 481 482 483
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
  /*
    * @tc.number  SendEvent_type_constructor_0060
    * @tc.name    SendEvent_type_constructor_0060
    * @tc.desc    The type of EventInfo is 'select', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0060 starts`);

    let eventType = 'select';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
517 518 519 520
  /*
    * @tc.number  SendEvent_type_0070
    * @tc.name    SendEvent_type_0070
    * @tc.desc    The type of EventInfo is 'hoverEnter', test sendEvent() function
Y
yichengzhao 已提交
521
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
522 523 524 525 526 527 528 529 530 531 532 533
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0070 starts`);

    let eventType = 'hoverEnter';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
534 535
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
536 537 538 539 540 541 542
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
  /*
    * @tc.number  SendEvent_type_constructor_0070
    * @tc.name    SendEvent_type_constructor_0070
    * @tc.desc    The type of EventInfo is 'hoverEnter', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0070 starts`);

    let eventType = 'hoverEnter';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
576 577 578 579
  /*
    * @tc.number  SendEvent_type_0080
    * @tc.name    SendEvent_type_0080
    * @tc.desc    The type of EventInfo is 'hoverExit', test sendEvent() function
Y
yichengzhao 已提交
580
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
581 582 583 584 585 586 587 588 589 590 591 592
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0080', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0080 starts`);

    let eventType = 'hoverExit';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
593 594
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
595 596 597 598 599 600 601
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
  /*
    * @tc.number  SendEvent_type_constructor_0080
    * @tc.name    SendEvent_type_constructor_0080
    * @tc.desc    The type of EventInfo is 'hoverExit', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0080', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0080 starts`);

    let eventType = 'hoverExit';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
635 636 637 638
  /*
    * @tc.number  SendEvent_type_0090
    * @tc.name    SendEvent_type_0090
    * @tc.desc    The type of EventInfo is 'textUpdate', test sendEvent() function
Y
yichengzhao 已提交
639
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
640 641 642 643 644 645 646 647 648 649 650 651
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0090', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0090 starts`);

    let eventType = 'textUpdate';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
652 653
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
654 655 656 657 658 659 660
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
  /*
    * @tc.number  SendEvent_type_constructor_0090
    * @tc.name    SendEvent_type_constructor_0090
    * @tc.desc    The type of EventInfo is 'textUpdate', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0090', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0090 starts`);

    let eventType = 'textUpdate';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
694 695 696 697
  /*
    * @tc.number  SendEvent_type_0100
    * @tc.name    SendEvent_type_0100
    * @tc.desc    The type of EventInfo is 'textSelectionUpdate', test sendEvent() function
Y
yichengzhao 已提交
698
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
699 700 701 702 703 704 705 706 707 708 709 710
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0100', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0100 starts`);

    let eventType = 'textSelectionUpdate';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
711 712
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
713 714 715 716 717 718 719
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
  /*
    * @tc.number  SendEvent_type_constructor_0100
    * @tc.name    SendEvent_type_constructor_0100
    * @tc.desc    The type of EventInfo is 'textSelectionUpdate', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0100', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0100 starts`);

    let eventType = 'textSelectionUpdate';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
753 754 755 756
  /*
    * @tc.number  SendEvent_type_0110
    * @tc.name    SendEvent_type_0110
    * @tc.desc    The type of EventInfo is 'scroll', test sendEvent() function
Y
yichengzhao 已提交
757
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
758 759 760 761 762 763 764 765 766 767 768 769
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_0110', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0110 starts`);

    let eventType = 'scroll';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
770 771
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
772 773 774 775 776 777 778 779
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814
    * @tc.number  SendEvent_type_constructor_0110
    * @tc.name    SendEvent_type_constructor_0110
    * @tc.desc    The type of EventInfo is 'scroll', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0110', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0110 starts`);

    let eventType = 'scroll';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_constructor_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_type_0120
    * @tc.name    SendEvent_type_0120
Y
yichengzhao 已提交
815
    * @tc.desc    The type of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
816
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
817 818 819
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
820 821
  it('SendEvent_type_0120', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0120 starts`);
Y
yichengzhao 已提交
822 823 824 825 826 827

    let eventType = '';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865
    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_type_0120 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_type_0120 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
    });
  })

  /*
    * @tc.number  SendEvent_type_constructor_0120
    * @tc.name    SendEvent_type_constructor_0120
    * @tc.desc    The type of EventInfo is '', test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0120', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0120 starts`);

    let eventType = '';

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_type_constructor_0120 result ${result}`);
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
866
    }).catch((err) => {
M
Mupceet 已提交
867
        console.info(`AccessibleSendEvent: SendEvent_type_constructor_0120 has error: ${err}`);
Y
yichengzhao 已提交
868
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
869
        done();
Y
yichengzhao 已提交
870 871 872 873
    });
  })

  /*
M
Mupceet 已提交
874 875
    * @tc.number  SendEvent_type_0130
    * @tc.name    SendEvent_type_0130
Y
yichengzhao 已提交
876
    * @tc.desc    The type of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
877
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
878 879 880
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
881 882
  it('SendEvent_type_0130', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_0130 starts`);
Y
yichengzhao 已提交
883 884 885 886 887 888

    let eventType = null;
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
889 890 891 892
    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_type_0130 result ${result}`);
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
893
    }).catch((err) => {
M
Mupceet 已提交
894
        console.info(`AccessibleSendEvent: SendEvent_type_0130 has error: ${err}`);
Y
yichengzhao 已提交
895
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930
        done();
    });
  })

  /*
    * @tc.number  SendEvent_type_constructor_0130
    * @tc.name    SendEvent_type_constructor_0130
    * @tc.desc    The type of EventInfo is null, test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_type_constructor_0130', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_type_constructor_0130 starts`);

    let eventType = null;

    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_type_constructor_0130 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_type_constructor_0130 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
Y
yichengzhao 已提交
931 932 933 934 935 936 937
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0010
    * @tc.name    SendEvent_windowUpdateType_0010
    * @tc.desc    The windowUpdateType of EventInfo is 'add', test sendEvent() function
Y
yichengzhao 已提交
938
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
939 940 941 942 943 944 945 946 947 948 949 950 951
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0010 starts`);

    let event = new accessibility.EventInfo();
    let windowUpdateType = 'add';
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
952 953
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
954 955 956 957 958 959 960 961 962 963 964
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0020
    * @tc.name    SendEvent_windowUpdateType_0020
    * @tc.desc    The windowUpdateType of EventInfo is 'remove', test sendEvent() function
Y
yichengzhao 已提交
965
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
966 967 968 969 970 971 972 973 974 975 976 977 978
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0020 starts`);

    let event = new accessibility.EventInfo();
    let windowUpdateType = 'remove';
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
979 980
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
981 982 983 984 985 986 987 988 989 990
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0030
    * @tc.name    SendEvent_windowUpdateType_0030
M
Mupceet 已提交
991
    * @tc.desc    The windowUpdateType of EventInfo is 'bounds', test sendEvent() function
Y
yichengzhao 已提交
992
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
993 994 995 996 997 998 999
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0030 starts`);

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1000
    let windowUpdateType = 'bounds';
Y
yichengzhao 已提交
1001 1002 1003 1004 1005
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1006 1007
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0040
    * @tc.name    SendEvent_windowUpdateType_0040
M
Mupceet 已提交
1018
    * @tc.desc    The windowUpdateType of EventInfo is 'active', test sendEvent() function
Y
yichengzhao 已提交
1019
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1020 1021 1022 1023 1024 1025 1026
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0040 starts`);

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1027
    let windowUpdateType = 'active';
Y
yichengzhao 已提交
1028 1029 1030 1031 1032
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1033 1034
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0050
    * @tc.name    SendEvent_windowUpdateType_0050
M
Mupceet 已提交
1045
    * @tc.desc    The windowUpdateType of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
1046
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1047 1048 1049 1050 1051 1052 1053
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0050 starts`);

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1054
    let windowUpdateType = 'focus';
Y
yichengzhao 已提交
1055 1056 1057 1058 1059
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1060 1061
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0060
    * @tc.name    SendEvent_windowUpdateType_0060
M
Mupceet 已提交
1072
    * @tc.desc    The windowUpdateType of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1073
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1074 1075 1076 1077 1078 1079 1080
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_windowUpdateType_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0060 starts`);

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1081
    let windowUpdateType = '';
Y
yichengzhao 已提交
1082 1083 1084 1085 1086
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1087 1088
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1089 1090 1091 1092 1093 1094 1095 1096
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1097 1098 1099
    * @tc.number  SendEvent_windowUpdateType_constructor_0060
    * @tc.name    SendEvent_windowUpdateType_constructor_0060
    * @tc.desc    The windowUpdateType of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1100
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1101 1102
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1103 1104 1105
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1106 1107
  it('SendEvent_windowUpdateType_constructor_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_constructor_0060 starts`);
Y
yichengzhao 已提交
1108

M
Mupceet 已提交
1109 1110 1111 1112 1113 1114 1115
    let windowUpdateType = '';
    let jsonObj = {
      type : eventType,
      windowUpdateType : windowUpdateType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }
Y
yichengzhao 已提交
1116

M
Mupceet 已提交
1117
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1118 1119

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1120 1121
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1122
    }).catch(err => {
M
Mupceet 已提交
1123
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_constructor_0060 has error: ${err}`);
Y
yichengzhao 已提交
1124 1125 1126 1127 1128 1129
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1130 1131 1132
    * @tc.number  SendEvent_windowUpdateType_0070
    * @tc.name    SendEvent_windowUpdateType_0070
    * @tc.desc    The windowUpdateType of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1133
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1134 1135 1136
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1137 1138
  it('SendEvent_windowUpdateType_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_0070 starts`);
Y
yichengzhao 已提交
1139 1140

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1141
    let windowUpdateType = null;
Y
yichengzhao 已提交
1142 1143 1144 1145 1146
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1147 1148
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1149
    }).catch(err => {
M
Mupceet 已提交
1150
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0070 has error: ${err}`);
Y
yichengzhao 已提交
1151 1152 1153 1154 1155 1156
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1157 1158 1159
    * @tc.number  SendEvent_windowUpdateType_constructor_0070
    * @tc.name    SendEvent_windowUpdateType_constructor_0070
    * @tc.desc    The windowUpdateType of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1160
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1161 1162
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1163 1164 1165
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1166 1167
  it('SendEvent_windowUpdateType_constructor_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_windowUpdateType_constructor_0070 starts`);
Y
yichengzhao 已提交
1168

M
Mupceet 已提交
1169 1170 1171 1172 1173 1174 1175
    let windowUpdateType = null;
    let jsonObj = {
      type : eventType,
      windowUpdateType : windowUpdateType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }
Y
yichengzhao 已提交
1176

M
Mupceet 已提交
1177
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1178 1179

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1180 1181
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1182
    }).catch(err => {
M
Mupceet 已提交
1183
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_constructor_0070 has error: ${err}`);
Y
yichengzhao 已提交
1184 1185 1186 1187 1188 1189
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1190 1191 1192
    * @tc.number  SendEvent_bundleName_0010
    * @tc.name    SendEvent_bundleName_0010
    * @tc.desc    The bundleName of EventInfo is 'com.ixaa.testfora11y', test sendEvent() function
Y
yichengzhao 已提交
1193
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1194 1195 1196
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1197 1198
  it('SendEvent_bundleName_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_0010 starts`);
Y
yichengzhao 已提交
1199 1200

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1201
    let localBundleName = 'com.ixaa.testfora11y';
Y
yichengzhao 已提交
1202
    event.type = eventType;
M
Mupceet 已提交
1203
    event.bundleName = localBundleName;
Y
yichengzhao 已提交
1204 1205
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1206 1207
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1208
    }).catch(err => {
M
Mupceet 已提交
1209
      console.error(`AccessibleSendEvent: SendEvent_bundleName_0010 has error: ${err}`);
Y
yichengzhao 已提交
1210 1211 1212 1213 1214 1215
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1216 1217
    * @tc.number  SendEvent_bundleName_constructor_0010
    * @tc.name    SendEvent_bundleName_constructor_0010
Y
yichengzhao 已提交
1218
    * @tc.desc    The bundleName of EventInfo is 'com.ixaa.testfora11y', test sendEvent() function
Y
yichengzhao 已提交
1219
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1220 1221
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1222 1223 1224
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1225 1226
  it('SendEvent_bundleName_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_constructor_0010 starts`);
Y
yichengzhao 已提交
1227 1228

    let localBundleName = 'com.ixaa.testfora11y';
M
Mupceet 已提交
1229 1230 1231 1232 1233 1234 1235 1236
    let jsonObj = {
      type : eventType,
      bundleName : localBundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

Y
yichengzhao 已提交
1237
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1238 1239
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1240
    }).catch(err => {
M
Mupceet 已提交
1241
      console.error(`AccessibleSendEvent: SendEvent_bundleName_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1242 1243 1244 1245 1246 1247 1248 1249 1250
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_bundleName_0020
    * @tc.name    SendEvent_bundleName_0020
    * @tc.desc    The bundleName of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1251
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_bundleName_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_0020 starts`);

    let event = new accessibility.EventInfo();
    let localBundleName = '';
    event.type = eventType;
    event.bundleName = localBundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
1263
    accessibility.sendEvent(event).then((result) =>{
Y
yichengzhao 已提交
1264
        console.error(`AccessibleSendEvent: SendEvent_bundleName_0020 result ${result}`);
M
Mupceet 已提交
1265 1266
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
1267 1268 1269
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_0020 has error: ${err}`);
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
        done();
    });
  })

  /*
    * @tc.number  SendEvent_bundleName_constructor_0020
    * @tc.name    SendEvent_bundleName_constructor_0020
    * @tc.desc    The bundleName of EventInfo is '', test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_bundleName_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_constructor_0020 starts`);

    let localBundleName = '';
    let jsonObj = {
      type : eventType,
      bundleName : localBundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_bundleName_constructor_0020 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_constructor_0020 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
Y
yichengzhao 已提交
1304 1305 1306 1307 1308 1309 1310
    });
  })

  /*
    * @tc.number  SendEvent_bundleName_0030
    * @tc.name    SendEvent_bundleName_0030
    * @tc.desc    The bundleName of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1311
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_bundleName_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_0030 starts`);

    let event = new accessibility.EventInfo();
    let localBundleName = null;
    event.type = eventType;
    event.bundleName = localBundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
1323
    accessibility.sendEvent(event).then((result) =>{
Y
yichengzhao 已提交
1324
        console.error(`AccessibleSendEvent: SendEvent_bundleName_0030 result ${result}`);
M
Mupceet 已提交
1325 1326
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
1327 1328 1329
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_0030 has error: ${err}`);
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363
        done();
    });
  })

  /*
    * @tc.number  SendEvent_bundleName_constructor_0030
    * @tc.name    SendEvent_bundleName_constructor_0030
    * @tc.desc    The bundleName of EventInfo is null, test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_bundleName_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_constructor_0030 starts`);

    let localBundleName = null;
    let jsonObj = {
      type : eventType,
      bundleName : localBundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_bundleName_constructor_0030 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_constructor_0030 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
Y
yichengzhao 已提交
1364 1365 1366 1367 1368 1369 1370
    });
  })

  /*
    * @tc.number  SendEvent_componentType_0010
    * @tc.name    SendEvent_componentType_0010
    * @tc.desc    The componentType of EventInfo is 'button', test sendEvent() function
Y
yichengzhao 已提交
1371
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_componentType_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_0010 starts`);

    let event = new accessibility.EventInfo();
    let componentType = 'button';
    event.type = eventType;
    event.bundleName = bundleName;
    event.componentType = componentType;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1385 1386
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1387 1388 1389 1390 1391 1392 1393
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
  /*
    * @tc.number  SendEvent_componentType_constructor_0010
    * @tc.name    SendEvent_componentType_constructor_0010
    * @tc.desc    The componentType of EventInfo is 'button', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_componentType_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_constructor_0010 starts`);

    let componentType = 'button';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      componentType : componentType,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_constructor_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
1427 1428 1429 1430
  /*
    * @tc.number  SendEvent_componentType_0020
    * @tc.name    SendEvent_componentType_0020
    * @tc.desc    The componentType of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1431
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_componentType_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_0020 starts`);

    let event = new accessibility.EventInfo();
    let componentType = '';
    event.type = eventType;
    event.bundleName = bundleName;
    event.componentType = componentType;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1445 1446
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1447 1448 1449 1450 1451 1452 1453
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486
  /*
    * @tc.number  SendEvent_componentType_constructor_0020
    * @tc.name    SendEvent_componentType_constructor_0020
    * @tc.desc    The componentType of EventInfo is '', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_componentType_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_constructor_0020 starts`);

    let componentType = '';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      componentType : componentType,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_constructor_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
1487 1488 1489 1490
  /*
    * @tc.number  SendEvent_componentType_0030
    * @tc.name    SendEvent_componentType_0030
    * @tc.desc    The componentType of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1491
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_componentType_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_0030 starts`);

    let event = new accessibility.EventInfo();
    let componentType = null;
    event.type = eventType;
    event.bundleName = bundleName;
    event.componentType = componentType;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1505 1506
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1507 1508 1509 1510 1511 1512 1513 1514
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1515 1516 1517
    * @tc.number  SendEvent_componentType_constructor_0030
    * @tc.name    SendEvent_componentType_constructor_0030
    * @tc.desc    The componentType of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1518
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1519 1520
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1521 1522 1523
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535
  it('SendEvent_componentType_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_componentType_constructor_0030 starts`);

    let componentType = null;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      componentType : componentType,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1536 1537

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1538 1539
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1540
    }).catch(err => {
M
Mupceet 已提交
1541
      console.error(`AccessibleSendEvent: SendEvent_componentType_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
1542 1543 1544 1545 1546 1547
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1548 1549 1550
    * @tc.number  SendEvent_pageId_0010
    * @tc.name    SendEvent_pageId_0010
    * @tc.desc    The pageId of EventInfo is 1, test sendEvent() function
Y
yichengzhao 已提交
1551
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1552 1553 1554
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1555 1556
  it('SendEvent_pageId_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_0010 starts`);
Y
yichengzhao 已提交
1557 1558

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1559
    let pageId = 1;
Y
yichengzhao 已提交
1560 1561
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
1562
    event.pageId = pageId;
Y
yichengzhao 已提交
1563 1564
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1565 1566
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1567
    }).catch(err => {
M
Mupceet 已提交
1568
      console.error(`AccessibleSendEvent: SendEvent_pageId_0010 has error: ${err}`);
Y
yichengzhao 已提交
1569 1570 1571 1572 1573 1574
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1575 1576 1577
    * @tc.number  SendEvent_pageId_constructor_0010
    * @tc.name    SendEvent_pageId_constructor_0010
    * @tc.desc    The pageId of EventInfo is 1, test sendEvent() function
Y
yichengzhao 已提交
1578
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1579 1580
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1581 1582 1583
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595
  it('SendEvent_pageId_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_constructor_0010 starts`);

    let pageId = 1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      pageId : pageId,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1596 1597

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1598 1599
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1600
    }).catch(err => {
M
Mupceet 已提交
1601
      console.error(`AccessibleSendEvent: SendEvent_pageId_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1602 1603 1604 1605 1606 1607
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1608 1609 1610
    * @tc.number  SendEvent_pageId_0020
    * @tc.name    SendEvent_pageId_0020
    * @tc.desc    The pageId of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
1611
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1612 1613 1614
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1615 1616
  it('SendEvent_pageId_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_0020 starts`);
Y
yichengzhao 已提交
1617 1618

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1619
    let pageId = 0;
Y
yichengzhao 已提交
1620 1621
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
1622
    event.pageId = pageId;
Y
yichengzhao 已提交
1623 1624
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1625 1626
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1627
    }).catch(err => {
M
Mupceet 已提交
1628
      console.error(`AccessibleSendEvent: SendEvent_pageId_0020 has error: ${err}`);
Y
yichengzhao 已提交
1629 1630 1631 1632 1633 1634
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1635 1636 1637
    * @tc.number  SendEvent_pageId_constructor_0020
    * @tc.name    SendEvent_pageId_constructor_0020
    * @tc.desc    The pageId of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
1638
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1639 1640
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1641 1642 1643
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1644 1645
  it('SendEvent_pageId_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_constructor_0020 starts`);
Y
yichengzhao 已提交
1646

M
Mupceet 已提交
1647 1648 1649 1650 1651 1652 1653
    let pageId = 0;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      pageId : pageId,
      triggerAction : triggerAction,
    }
Y
yichengzhao 已提交
1654

M
Mupceet 已提交
1655
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1656 1657

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1658 1659
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1660
    }).catch(err => {
M
Mupceet 已提交
1661
      console.error(`AccessibleSendEvent: SendEvent_pageId_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
1662 1663 1664 1665 1666 1667
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1668 1669 1670
    * @tc.number  SendEvent_pageId_0030
    * @tc.name    SendEvent_pageId_0030
    * @tc.desc    The pageId of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
1671
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1672 1673 1674
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1675 1676
  it('SendEvent_pageId_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_0030 starts`);
Y
yichengzhao 已提交
1677 1678

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1679
    let pageId = -1;
Y
yichengzhao 已提交
1680 1681 1682 1683 1684
    event.type = eventType;
    event.bundleName = bundleName;
    event.pageId = pageId;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1685 1686
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1687
    }).catch(err => {
M
Mupceet 已提交
1688
      console.error(`AccessibleSendEvent: SendEvent_pageId_0030 has error: ${err}`);
Y
yichengzhao 已提交
1689 1690 1691 1692 1693 1694
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1695 1696 1697
    * @tc.number  SendEvent_pageId_constructor_0030
    * @tc.name    SendEvent_pageId_constructor_0030
    * @tc.desc    The pageId of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
1698
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1699 1700
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1701 1702 1703
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715
  it('SendEvent_pageId_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_pageId_constructor_0030 starts`);

    let pageId = -1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      pageId : pageId,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1716 1717

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1718 1719
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1720
    }).catch(err => {
M
Mupceet 已提交
1721
      console.error(`AccessibleSendEvent: SendEvent_pageId_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
1722 1723 1724 1725 1726 1727
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1728 1729 1730
    * @tc.number  SendEvent_description_0010
    * @tc.name    SendEvent_description_0010
    * @tc.desc    The description of EventInfo is '1', test sendEvent() function
Y
yichengzhao 已提交
1731
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1732 1733 1734
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1735 1736
  it('SendEvent_description_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_0010 starts`);
Y
yichengzhao 已提交
1737 1738

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1739
    let description = '1';
Y
yichengzhao 已提交
1740 1741
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
1742
    event.description = description;
Y
yichengzhao 已提交
1743 1744
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1745 1746
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1747
    }).catch(err => {
M
Mupceet 已提交
1748
      console.error(`AccessibleSendEvent: SendEvent_description_0010 has error: ${err}`);
Y
yichengzhao 已提交
1749 1750 1751 1752 1753 1754
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1755 1756 1757
    * @tc.number  SendEvent_description_constructor_0010
    * @tc.name    SendEvent_description_constructor_0010
    * @tc.desc    The description of EventInfo is '1', test sendEvent() function
Y
yichengzhao 已提交
1758
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1759 1760
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1761 1762 1763
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775
  it('SendEvent_description_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_constructor_0010 starts`);

    let description = '1';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      description : description,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1776 1777

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1778 1779
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1780
    }).catch(err => {
M
Mupceet 已提交
1781
      console.error(`AccessibleSendEvent: SendEvent_description_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1782 1783 1784 1785 1786 1787
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1788 1789 1790
    * @tc.number  SendEvent_description_0020
    * @tc.name    SendEvent_description_0020
    * @tc.desc    The description of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1791
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1792 1793 1794
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1795 1796
  it('SendEvent_description_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_0020 starts`);
Y
yichengzhao 已提交
1797 1798

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1799
    let description = '';
Y
yichengzhao 已提交
1800 1801
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
1802
    event.description = description;
Y
yichengzhao 已提交
1803 1804
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1805 1806
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1807
    }).catch(err => {
M
Mupceet 已提交
1808
      console.error(`AccessibleSendEvent: SendEvent_description_0020 has error: ${err}`);
Y
yichengzhao 已提交
1809 1810 1811 1812 1813 1814
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1815 1816 1817
    * @tc.number  SendEvent_description_constructor_0020
    * @tc.name    SendEvent_description_constructor_0020
    * @tc.desc    The description of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1818
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1819 1820
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1821 1822 1823
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835
  it('SendEvent_description_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_constructor_0020 starts`);

    let description = '';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      description : description,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1836 1837

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1838 1839
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1840
    }).catch(err => {
M
Mupceet 已提交
1841
      console.error(`AccessibleSendEvent: SendEvent_description_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
1842 1843 1844 1845 1846 1847
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1848 1849 1850
    * @tc.number  SendEvent_description_0030
    * @tc.name    SendEvent_description_0030
    * @tc.desc    The description of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1851
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1852 1853 1854
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1855 1856
  it('SendEvent_description_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_0030 starts`);
Y
yichengzhao 已提交
1857 1858

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1859
    let description = null;
Y
yichengzhao 已提交
1860 1861 1862 1863 1864
    event.type = eventType;
    event.bundleName = bundleName;
    event.description = description;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1865 1866
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1867
    }).catch(err => {
M
Mupceet 已提交
1868
      console.error(`AccessibleSendEvent: SendEvent_description_0030 has error: ${err}`);
Y
yichengzhao 已提交
1869 1870 1871 1872 1873 1874
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1875 1876 1877
    * @tc.number  SendEvent_description_constructor_0030
    * @tc.name    SendEvent_description_constructor_0030
    * @tc.desc    The description of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1878
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1879 1880
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1881 1882 1883
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895
  it('SendEvent_description_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_description_constructor_0030 starts`);

    let description = null;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      description : description,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
1896 1897

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1898 1899
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1900
    }).catch(err => {
M
Mupceet 已提交
1901
      console.error(`AccessibleSendEvent: SendEvent_description_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
1902 1903 1904 1905 1906 1907
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1908 1909 1910
    * @tc.number  SendEvent_triggerAction_0010
    * @tc.name    SendEvent_triggerAction_0010
    * @tc.desc    The triggerAction of EventInfo is 'accessibilityFocus', test sendEvent() function
Y
yichengzhao 已提交
1911
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1912 1913 1914
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1915 1916
  it('SendEvent_triggerAction_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0010 starts`);
Y
yichengzhao 已提交
1917 1918

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
1919
    let triggerAction = 'accessibilityFocus';
Y
yichengzhao 已提交
1920 1921 1922 1923
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1924 1925
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1926
    }).catch(err => {
M
Mupceet 已提交
1927
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0010 has error: ${err}`);
Y
yichengzhao 已提交
1928 1929 1930 1931 1932 1933
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1934 1935
    * @tc.number  SendEvent_triggerAction_constructor_0010
    * @tc.name    SendEvent_triggerAction_constructor_0010
Y
yichengzhao 已提交
1936
    * @tc.desc    The triggerAction of EventInfo is 'accessibilityFocus', test sendEvent() function
Y
yichengzhao 已提交
1937
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1938 1939
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1940 1941 1942
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1943 1944
  it('SendEvent_triggerAction_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0010 starts`);
Y
yichengzhao 已提交
1945 1946

    let triggerAction = 'accessibilityFocus';
M
Mupceet 已提交
1947 1948 1949 1950 1951 1952 1953 1954
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

Y
yichengzhao 已提交
1955
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1956 1957
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1958
    }).catch(err => {
M
Mupceet 已提交
1959
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1960 1961 1962 1963 1964 1965 1966 1967 1968
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_triggerAction_0020
    * @tc.name    SendEvent_triggerAction_0020
    * @tc.desc    The triggerAction of EventInfo is 'clearAccessibilityFocus', test sendEvent() function
Y
yichengzhao 已提交
1969
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0020 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'clearAccessibilityFocus';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1982 1983
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1984 1985 1986 1987 1988 1989 1990
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022
    /*
    * @tc.number  SendEvent_triggerAction_constructor_0020
    * @tc.name    SendEvent_triggerAction_constructor_0020
    * @tc.desc    The triggerAction of EventInfo is 'clearAccessibilityFocus', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
    it('SendEvent_triggerAction_constructor_0020', 0, async function (done) {
      console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0020 starts`);
  
      let triggerAction = 'clearAccessibilityFocus';
      let jsonObj = {
        type : eventType,
        bundleName : bundleName,
        triggerAction : triggerAction,
      }
  
      let event = new accessibility.EventInfo(jsonObj);

      accessibility.sendEvent(event).then((result) => {
        expect(result).assertEqual(undefined);
        done();
      }).catch(err => {
        console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0020 has error: ${err}`);
        expect(null).assertFail();
        done();
      });
    })

Y
yichengzhao 已提交
2023 2024 2025 2026
  /*
    * @tc.number  SendEvent_triggerAction_0030
    * @tc.name    SendEvent_triggerAction_0030
    * @tc.desc    The triggerAction of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
2027
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0030 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'focus';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2040 2041
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2042 2043 2044 2045 2046 2047 2048
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0030
    * @tc.name    SendEvent_triggerAction_constructor_0030
    * @tc.desc    The triggerAction of EventInfo is 'focus', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0030 starts`);

    let triggerAction = 'focus';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2079 2080 2081 2082
  /*
    * @tc.number  SendEvent_triggerAction_0040
    * @tc.name    SendEvent_triggerAction_0040
    * @tc.desc    The triggerAction of EventInfo is 'clearFocus', test sendEvent() function
Y
yichengzhao 已提交
2083
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0040 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'clearFocus';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2096 2097
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2098 2099 2100 2101 2102 2103 2104
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0040
    * @tc.name    SendEvent_triggerAction_constructor_0040
    * @tc.desc    The triggerAction of EventInfo is 'clearFocus', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0040 starts`);

    let triggerAction = 'clearFocus';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2137 2138 2139 2140
  /*
    * @tc.number  SendEvent_triggerAction_0050
    * @tc.name    SendEvent_triggerAction_0050
    * @tc.desc    The triggerAction of EventInfo is 'clearSelection', test sendEvent() function
Y
yichengzhao 已提交
2141
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0050 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'clearSelection';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2154 2155
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2156 2157 2158 2159 2160 2161 2162
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0050
    * @tc.name    SendEvent_triggerAction_constructor_0050
    * @tc.desc    The triggerAction of EventInfo is 'clearSelection', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0050 starts`);

    let triggerAction = 'clearSelection';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2195 2196 2197 2198
  /*
    * @tc.number  SendEvent_triggerAction_0060
    * @tc.name    SendEvent_triggerAction_0060
    * @tc.desc    The triggerAction of EventInfo is 'click', test sendEvent() function
Y
yichengzhao 已提交
2199
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0060 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'click';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2212 2213
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2214 2215 2216 2217 2218 2219 2220
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0060
    * @tc.name    SendEvent_triggerAction_constructor_0060
    * @tc.desc    The triggerAction of EventInfo is 'click', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0060 starts`);

    let triggerAction = 'click';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2253 2254 2255 2256
  /*
    * @tc.number  SendEvent_triggerAction_0070
    * @tc.name    SendEvent_triggerAction_0070
    * @tc.desc    The triggerAction of EventInfo is 'longClick', test sendEvent() function
Y
yichengzhao 已提交
2257
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0070 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'longClick';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2270 2271
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2272 2273 2274 2275 2276 2277 2278
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0070
    * @tc.name    SendEvent_triggerAction_constructor_0070
    * @tc.desc    The triggerAction of EventInfo is 'longClick', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0070 starts`);

    let triggerAction = 'longClick';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2311 2312 2313 2314
  /*
    * @tc.number  SendEvent_triggerAction_0080
    * @tc.name    SendEvent_triggerAction_0080
    * @tc.desc    The triggerAction of EventInfo is 'cut', test sendEvent() function
Y
yichengzhao 已提交
2315
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0080', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0080 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'cut';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2328 2329
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2330 2331 2332 2333 2334 2335 2336 2337
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371
    * @tc.number  SendEvent_triggerAction_constructor_0080
    * @tc.name    SendEvent_triggerAction_constructor_0080
    * @tc.desc    The triggerAction of EventInfo is 'cut', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0080', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0080 starts`);

    let triggerAction = 'cut';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_triggerAction_0090
    * @tc.name    SendEvent_triggerAction_0090
Y
yichengzhao 已提交
2372
    * @tc.desc    The triggerAction of EventInfo is 'copy', test sendEvent() function
Y
yichengzhao 已提交
2373
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0090', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0090 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'copy';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2386 2387
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2388 2389 2390 2391 2392 2393 2394
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0090
    * @tc.name    SendEvent_triggerAction_constructor_0090
    * @tc.desc    The triggerAction of EventInfo is 'copy', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0090', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0090 starts`);

    let triggerAction = 'copy';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2427 2428 2429 2430
  /*
    * @tc.number  SendEvent_triggerAction_0100
    * @tc.name    SendEvent_triggerAction_0100
    * @tc.desc    The triggerAction of EventInfo is 'paste', test sendEvent() function
Y
yichengzhao 已提交
2431
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0100', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0100 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'paste';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2444 2445
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2446 2447 2448 2449 2450 2451 2452
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0100
    * @tc.name    SendEvent_triggerAction_constructor_0100
    * @tc.desc    The triggerAction of EventInfo is 'paste', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0100', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0100 starts`);

    let triggerAction = 'paste';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2485 2486 2487 2488
  /*
    * @tc.number  SendEvent_triggerAction_0110
    * @tc.name    SendEvent_triggerAction_0110
    * @tc.desc    The triggerAction of EventInfo is 'select', test sendEvent() function
Y
yichengzhao 已提交
2489
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0110', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0110 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'select';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2502 2503
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2504 2505 2506 2507 2508 2509 2510
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0110
    * @tc.name    SendEvent_triggerAction_constructor_0110
    * @tc.desc    The triggerAction of EventInfo is 'select', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0110', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0110 starts`);

    let triggerAction = 'select';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2543 2544 2545 2546
  /*
    * @tc.number  SendEvent_triggerAction_0120
    * @tc.name    SendEvent_triggerAction_0120
    * @tc.desc    The triggerAction of EventInfo is 'setText', test sendEvent() function
Y
yichengzhao 已提交
2547
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0120', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0120 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'setText';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2560 2561
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2562 2563 2564 2565 2566 2567 2568
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0120 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0120
    * @tc.name    SendEvent_triggerAction_constructor_0120
    * @tc.desc    The triggerAction of EventInfo is 'setText', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0120', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0120 starts`);

    let triggerAction = 'setText';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0120 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2601 2602 2603 2604
  /*
    * @tc.number  SendEvent_triggerAction_0130
    * @tc.name    SendEvent_triggerAction_0130
    * @tc.desc    The triggerAction of EventInfo is 'delete', test sendEvent() function
Y
yichengzhao 已提交
2605
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0130', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0130 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'delete';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2618 2619
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2620 2621 2622 2623 2624 2625 2626
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0130 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0130
    * @tc.name    SendEvent_triggerAction_constructor_0130
    * @tc.desc    The triggerAction of EventInfo is 'delete', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0130', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0130 starts`);

    let triggerAction = 'delete';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0130 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2659 2660 2661 2662
  /*
    * @tc.number  SendEvent_triggerAction_0140
    * @tc.name    SendEvent_triggerAction_0140
    * @tc.desc    The triggerAction of EventInfo is 'scrollForward', test sendEvent() function
Y
yichengzhao 已提交
2663
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0140', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0140 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'scrollForward';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2676 2677
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2678 2679 2680 2681 2682 2683 2684
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0140 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0140
    * @tc.name    SendEvent_triggerAction_constructor_0140
    * @tc.desc    The triggerAction of EventInfo is 'scrollForward', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0140', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0140 starts`);

    let triggerAction = 'scrollForward';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0140 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2717 2718 2719 2720
  /*
    * @tc.number  SendEvent_triggerAction_0150
    * @tc.name    SendEvent_triggerAction_0150
    * @tc.desc    The triggerAction of EventInfo is 'scrollBackward', test sendEvent() function
Y
yichengzhao 已提交
2721
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0150', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0150 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'scrollBackward';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2734 2735
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2736 2737 2738 2739 2740 2741 2742
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0150 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774
  /*
    * @tc.number  SendEvent_triggerAction_constructor_0150
    * @tc.name    SendEvent_triggerAction_constructor_0150
    * @tc.desc    The triggerAction of EventInfo is 'scrollBackward', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0150', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0150 starts`);

    let triggerAction = 'scrollBackward';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0150 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
2775 2776 2777 2778
  /*
    * @tc.number  SendEvent_triggerAction_0160
    * @tc.name    SendEvent_triggerAction_0160
    * @tc.desc    The triggerAction of EventInfo is 'setSelection', test sendEvent() function
Y
yichengzhao 已提交
2779
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_0160', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0160 starts`);

    let event = new accessibility.EventInfo();
    let triggerAction = 'setSelection';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2792 2793
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2794 2795 2796 2797 2798 2799 2800 2801
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0160 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835
    * @tc.number  SendEvent_triggerAction_constructor_0160
    * @tc.name    SendEvent_triggerAction_constructor_0160
    * @tc.desc    The triggerAction of EventInfo is 'setSelection', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0160', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0160 starts`);

    let triggerAction = 'setSelection';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0160 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
    * @tc.number  SendEvent_triggerAction_0170
    * @tc.name    SendEvent_triggerAction_0170
Y
yichengzhao 已提交
2836
    * @tc.desc    The triggerAction of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
2837
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
2838 2839 2840
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
2841 2842
  it('SendEvent_triggerAction_0170', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0170 starts`);
Y
yichengzhao 已提交
2843 2844 2845 2846 2847 2848

    let event = new accessibility.EventInfo();
    let triggerAction = '';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
2849
    accessibility.sendEvent(event).then((result) =>{
M
Mupceet 已提交
2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885
        console.error(`AccessibleSendEvent: SendEvent_triggerAction_0170 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_0170 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
    });
  })

  /*
    * @tc.number  SendEvent_triggerAction_constructor_0170
    * @tc.name    SendEvent_triggerAction_constructor_0170
    * @tc.desc    The triggerAction of EventInfo is '', test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0170', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0170 starts`);

    let triggerAction = '';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0170 result ${result}`);
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
2886
    }).catch((err) => {
M
Mupceet 已提交
2887
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0170 has error: ${err}`);
Y
yichengzhao 已提交
2888
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
2889
        done();
Y
yichengzhao 已提交
2890 2891 2892 2893
    });
  })

  /*
M
Mupceet 已提交
2894 2895
    * @tc.number  SendEvent_triggerAction_0180
    * @tc.name    SendEvent_triggerAction_0180
Y
yichengzhao 已提交
2896
    * @tc.desc    The triggerAction of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
2897
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
2898 2899 2900
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
2901 2902
  it('SendEvent_triggerAction_0180', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_0180 starts`);
Y
yichengzhao 已提交
2903 2904 2905 2906 2907 2908

    let event = new accessibility.EventInfo();
    let triggerAction = null;
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
2909
    accessibility.sendEvent(event).then((result) =>{
M
Mupceet 已提交
2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945
        console.error(`AccessibleSendEvent: SendEvent_triggerAction_0180 result ${result}`);
        expect(null).assertFail();
        done();
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_0180 has error: ${err}`);
        expect(err).assertEqual(undefined);
        done();
    });
  })

  /*
    * @tc.number  SendEvent_triggerAction_constructor_0180
    * @tc.name    SendEvent_triggerAction_constructor_0180
    * @tc.desc    The triggerAction of EventInfo is null, test sendEvent() function
    *             The result of sendEvent() should be equal to a rejected promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_triggerAction_constructor_0180', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0180 starts`);

    let triggerAction = null;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0180 result ${result}`);
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
2946
    }).catch((err) => {
M
Mupceet 已提交
2947
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0180 has error: ${err}`);
Y
yichengzhao 已提交
2948
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
2949
        done();
Y
yichengzhao 已提交
2950 2951 2952 2953 2954 2955 2956
    });
  })

  /*
    * @tc.number  SendEvent_textMoveUnit_0010
    * @tc.name    SendEvent_textMoveUnit_0010
    * @tc.desc    The textMoveUnit of EventInfo is 'char', test sendEvent() function
Y
yichengzhao 已提交
2957
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_textMoveUnit_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0010 starts`);

    let event = new accessibility.EventInfo();
    let textMoveUnit = 'char';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    event.textMoveUnit = textMoveUnit;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
2971 2972
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2973 2974 2975 2976 2977 2978 2979
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012
  /*
    * @tc.number  SendEvent_textMoveUnit_constructor_0010
    * @tc.name    SendEvent_textMoveUnit_constructor_0010
    * @tc.desc    The textMoveUnit of EventInfo is 'char', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_textMoveUnit_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0010 starts`);

    let textMoveUnit = 'char';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
3013 3014 3015 3016
  /*
    * @tc.number  SendEvent_textMoveUnit_0020
    * @tc.name    SendEvent_textMoveUnit_0020
    * @tc.desc    The textMoveUnit of EventInfo is 'word', test sendEvent() function
Y
yichengzhao 已提交
3017
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_textMoveUnit_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0020 starts`);

    let event = new accessibility.EventInfo();
    let textMoveUnit = 'word';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    event.textMoveUnit = textMoveUnit;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3031 3032
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3033 3034 3035 3036 3037 3038 3039
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072
  /*
    * @tc.number  SendEvent_textMoveUnit_constructor_0020
    * @tc.name    SendEvent_textMoveUnit_constructor_0020
    * @tc.desc    The textMoveUnit of EventInfo is 'word', test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_textMoveUnit_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0020 starts`);

    let textMoveUnit = 'word';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }

    let event = new accessibility.EventInfo(jsonObj);

    accessibility.sendEvent(event).then((result) => {
      expect(result).assertEqual(undefined);
      done();
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

Y
yichengzhao 已提交
3073 3074 3075 3076
  /*
    * @tc.number  SendEvent_textMoveUnit_0030
    * @tc.name    SendEvent_textMoveUnit_0030
    * @tc.desc    The textMoveUnit of EventInfo is 'line', test sendEvent() function
Y
yichengzhao 已提交
3077
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090
    * @tc.size    SmallTest
    * @tc.type    User
    */
  it('SendEvent_textMoveUnit_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0030 starts`);

    let event = new accessibility.EventInfo();
    let textMoveUnit = 'line';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    event.textMoveUnit = textMoveUnit;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3091 3092
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3093 3094 3095 3096 3097 3098 3099 3100
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3101 3102 3103
    * @tc.number  SendEvent_textMoveUnit_constructor_0030
    * @tc.name    SendEvent_textMoveUnit_constructor_0030
    * @tc.desc    The textMoveUnit of EventInfo is 'line', test sendEvent() function
Y
yichengzhao 已提交
3104
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3105 3106
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3107 3108 3109
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3110 3111
  it('SendEvent_textMoveUnit_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0030 starts`);
Y
yichengzhao 已提交
3112

M
Mupceet 已提交
3113 3114 3115 3116 3117 3118 3119
    let textMoveUnit = 'line';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }
Y
yichengzhao 已提交
3120

M
Mupceet 已提交
3121
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3122 3123

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3124 3125
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3126
    }).catch(err => {
M
Mupceet 已提交
3127
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
3128 3129 3130 3131 3132 3133
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3134 3135 3136
    * @tc.number  SendEvent_textMoveUnit_0040
    * @tc.name    SendEvent_textMoveUnit_0040
    * @tc.desc    The textMoveUnit of EventInfo is 'page', test sendEvent() function
Y
yichengzhao 已提交
3137
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3138 3139 3140
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3141 3142
  it('SendEvent_textMoveUnit_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0040 starts`);
Y
yichengzhao 已提交
3143 3144

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3145
    let textMoveUnit = 'page';
Y
yichengzhao 已提交
3146 3147 3148 3149 3150
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    event.textMoveUnit = textMoveUnit;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3151 3152
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3153
    }).catch(err => {
M
Mupceet 已提交
3154
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0040 has error: ${err}`);
Y
yichengzhao 已提交
3155 3156 3157 3158 3159 3160
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3161 3162 3163
    * @tc.number  SendEvent_textMoveUnit_constructor_0040
    * @tc.name    SendEvent_textMoveUnit_constructor_0040
    * @tc.desc    The textMoveUnit of EventInfo is 'page', test sendEvent() function
Y
yichengzhao 已提交
3164
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3165 3166
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3167 3168 3169
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3170 3171
  it('SendEvent_textMoveUnit_constructor_0040', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0040 starts`);
Y
yichengzhao 已提交
3172

M
Mupceet 已提交
3173 3174 3175 3176 3177 3178 3179
    let textMoveUnit = 'page';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }
Y
yichengzhao 已提交
3180

M
Mupceet 已提交
3181
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3182 3183

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3184 3185
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3186
    }).catch(err => {
M
Mupceet 已提交
3187
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0040 has error: ${err}`);
Y
yichengzhao 已提交
3188 3189 3190 3191 3192 3193
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3194 3195 3196
    * @tc.number  SendEvent_textMoveUnit_0050
    * @tc.name    SendEvent_textMoveUnit_0050
    * @tc.desc    The textMoveUnit of EventInfo is 'paragraph', test sendEvent() function
Y
yichengzhao 已提交
3197
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3198 3199 3200
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3201 3202
  it('SendEvent_textMoveUnit_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0050 starts`);
Y
yichengzhao 已提交
3203 3204

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3205
    let textMoveUnit = 'paragraph';
Y
yichengzhao 已提交
3206 3207 3208
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
3209
    event.textMoveUnit = textMoveUnit;
Y
yichengzhao 已提交
3210
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3211 3212
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3213
    }).catch(err => {
M
Mupceet 已提交
3214
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0050 has error: ${err}`);
Y
yichengzhao 已提交
3215 3216 3217 3218 3219 3220
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3221 3222 3223
    * @tc.number  SendEvent_textMoveUnit_constructor_0050
    * @tc.name    SendEvent_textMoveUnit_constructor_0050
    * @tc.desc    The textMoveUnit of EventInfo is 'paragraph', test sendEvent() function
Y
yichengzhao 已提交
3224
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3225 3226
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3227 3228 3229
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3230 3231
  it('SendEvent_textMoveUnit_constructor_0050', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0050 starts`);
Y
yichengzhao 已提交
3232

M
Mupceet 已提交
3233 3234 3235 3236 3237 3238 3239
    let textMoveUnit = 'paragraph';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }
Y
yichengzhao 已提交
3240

M
Mupceet 已提交
3241
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3242 3243

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3244 3245
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3246
    }).catch(err => {
M
Mupceet 已提交
3247
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0050 has error: ${err}`);
Y
yichengzhao 已提交
3248 3249 3250 3251 3252 3253
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3254 3255 3256
    * @tc.number  SendEvent_textMoveUnit_0060
    * @tc.name    SendEvent_textMoveUnit_0060
    * @tc.desc    The textMoveUnit of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
3257
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3258 3259 3260
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3261 3262
  it('SendEvent_textMoveUnit_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0060 starts`);
Y
yichengzhao 已提交
3263 3264

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3265
    let textMoveUnit = '';
Y
yichengzhao 已提交
3266 3267 3268
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
3269
    event.textMoveUnit = textMoveUnit;
Y
yichengzhao 已提交
3270
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3271 3272
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3273
    }).catch(err => {
M
Mupceet 已提交
3274
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0060 has error: ${err}`);
Y
yichengzhao 已提交
3275 3276 3277 3278 3279 3280
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3281 3282 3283
    * @tc.number  SendEvent_textMoveUnit_constructor_0060
    * @tc.name    SendEvent_textMoveUnit_constructor_0060
    * @tc.desc    The textMoveUnit of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
3284
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3285 3286
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3287 3288 3289
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3290 3291
  it('SendEvent_textMoveUnit_constructor_0060', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0060 starts`);
Y
yichengzhao 已提交
3292

M
Mupceet 已提交
3293 3294 3295 3296 3297 3298 3299
    let textMoveUnit = '';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }
Y
yichengzhao 已提交
3300

M
Mupceet 已提交
3301
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3302 3303

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3304 3305
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3306
    }).catch(err => {
M
Mupceet 已提交
3307
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0060 has error: ${err}`);
Y
yichengzhao 已提交
3308 3309 3310 3311 3312 3313
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3314 3315 3316
    * @tc.number  SendEvent_textMoveUnit_0070
    * @tc.name    SendEvent_textMoveUnit_0070
    * @tc.desc    The textMoveUnit of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
3317
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3318 3319 3320
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3321 3322
  it('SendEvent_textMoveUnit_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_0070 starts`);
Y
yichengzhao 已提交
3323 3324

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3325
    let textMoveUnit = null;
Y
yichengzhao 已提交
3326 3327 3328
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
3329
    event.textMoveUnit = textMoveUnit;
Y
yichengzhao 已提交
3330
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3331 3332
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3333
    }).catch(err => {
M
Mupceet 已提交
3334
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0070 has error: ${err}`);
Y
yichengzhao 已提交
3335 3336 3337 3338 3339 3340
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3341 3342 3343
    * @tc.number  SendEvent_textMoveUnit_constructor_0070
    * @tc.name    SendEvent_textMoveUnit_constructor_0070
    * @tc.desc    The textMoveUnit of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
3344
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3345 3346
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3347 3348 3349
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3350 3351
  it('SendEvent_textMoveUnit_constructor_0070', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0070 starts`);
Y
yichengzhao 已提交
3352

M
Mupceet 已提交
3353 3354 3355 3356 3357 3358 3359
    let textMoveUnit = null;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      textMoveUnit : textMoveUnit,
    }
Y
yichengzhao 已提交
3360

M
Mupceet 已提交
3361
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3362 3363

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3364 3365
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3366
    }).catch(err => {
M
Mupceet 已提交
3367
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_constructor_0070 has error: ${err}`);
Y
yichengzhao 已提交
3368 3369 3370 3371 3372 3373
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3374 3375 3376
    * @tc.number  SendEvent_contents_0010
    * @tc.name    SendEvent_contents_0010
    * @tc.desc    The contents of EventInfo is ['1'], test sendEvent() function
Y
yichengzhao 已提交
3377
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3378 3379 3380
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3381 3382
  it('SendEvent_contents_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_contents_0010 starts`);
Y
yichengzhao 已提交
3383 3384

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3385
    let contents = ['1'];
Y
yichengzhao 已提交
3386 3387 3388
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
3389
    event.contents = contents;
Y
yichengzhao 已提交
3390
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3391 3392
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3393
    }).catch(err => {
M
Mupceet 已提交
3394
      console.error(`AccessibleSendEvent: SendEvent_contents_0010 has error: ${err}`);
Y
yichengzhao 已提交
3395 3396 3397 3398 3399 3400
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3401 3402 3403
    * @tc.number  SendEvent_contents_constructor_0010
    * @tc.name    SendEvent_contents_constructor_0010
    * @tc.desc    The contents of EventInfo is ['1'], test sendEvent() function
Y
yichengzhao 已提交
3404
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3405 3406
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3407 3408 3409
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3410 3411
  it('SendEvent_contents_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_contents_constructor_0010 starts`);
Y
yichengzhao 已提交
3412

M
Mupceet 已提交
3413 3414 3415 3416 3417 3418 3419
    let contents = ['1'];
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      contents : contents,
    }
Y
yichengzhao 已提交
3420

M
Mupceet 已提交
3421
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3422 3423

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3424 3425
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3426
    }).catch(err => {
M
Mupceet 已提交
3427
      console.error(`AccessibleSendEvent: SendEvent_contents_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
3428 3429 3430 3431 3432 3433
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3434 3435 3436
    * @tc.number  SendEvent_contents_0020
    * @tc.name    SendEvent_contents_0020
    * @tc.desc    The contents of EventInfo is [], test sendEvent() function
Y
yichengzhao 已提交
3437
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3438 3439 3440
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3441 3442
  it('SendEvent_contents_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_contents_0020 starts`);
Y
yichengzhao 已提交
3443 3444

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3445
    let contents = [];
Y
yichengzhao 已提交
3446 3447 3448
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
3449
    event.contents = contents;
Y
yichengzhao 已提交
3450
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3451 3452
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3453
    }).catch(err => {
M
Mupceet 已提交
3454
      console.error(`AccessibleSendEvent: SendEvent_contents_0020 has error: ${err}`);
Y
yichengzhao 已提交
3455 3456 3457 3458 3459 3460
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3461 3462 3463
    * @tc.number  SendEvent_contents_constructor_0020
    * @tc.name    SendEvent_contents_constructor_0020
    * @tc.desc    The contents of EventInfo is [], test sendEvent() function
Y
yichengzhao 已提交
3464
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3465 3466
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3467 3468 3469
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3470 3471
  it('SendEvent_contents_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_contents_constructor_0020 starts`);
Y
yichengzhao 已提交
3472

M
Mupceet 已提交
3473 3474 3475 3476 3477 3478 3479
    let contents = [];
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      contents : contents,
    }
Y
yichengzhao 已提交
3480

M
Mupceet 已提交
3481
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3482 3483

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3484 3485
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3486
    }).catch(err => {
M
Mupceet 已提交
3487
      console.error(`AccessibleSendEvent: SendEvent_contents_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
3488 3489 3490 3491 3492 3493
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3494 3495 3496
    * @tc.number  SendEvent_lastContent_0010
    * @tc.name    SendEvent_lastContent_0010
    * @tc.desc    The lastContent of EventInfo is '1', test sendEvent() function
Y
yichengzhao 已提交
3497
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3498 3499 3500
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3501 3502
  it('SendEvent_lastContent_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_0010 starts`);
Y
yichengzhao 已提交
3503 3504

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3505
    let lastContent = '1';
Y
yichengzhao 已提交
3506 3507
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3508
    event.lastContent = lastContent;
Y
yichengzhao 已提交
3509 3510
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3511 3512
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3513
    }).catch(err => {
M
Mupceet 已提交
3514
      console.error(`AccessibleSendEvent: SendEvent_lastContent_0010 has error: ${err}`);
Y
yichengzhao 已提交
3515 3516 3517 3518 3519 3520
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3521 3522 3523
    * @tc.number  SendEvent_lastContent_constructor_0010
    * @tc.name    SendEvent_lastContent_constructor_0010
    * @tc.desc    The lastContent of EventInfo is '1', test sendEvent() function
Y
yichengzhao 已提交
3524
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3525 3526
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3527 3528 3529
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3530 3531
  it('SendEvent_lastContent_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_constructor_0010 starts`);
Y
yichengzhao 已提交
3532

M
Mupceet 已提交
3533 3534 3535 3536 3537 3538 3539
    let lastContent = '1';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      lastContent : lastContent,
    }
Y
yichengzhao 已提交
3540

M
Mupceet 已提交
3541
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3542 3543

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3544 3545
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3546
    }).catch(err => {
M
Mupceet 已提交
3547
      console.error(`AccessibleSendEvent: SendEvent_lastContent_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
3548 3549 3550 3551 3552 3553
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3554 3555 3556
    * @tc.number  SendEvent_lastContent_0020
    * @tc.name    SendEvent_lastContent_0020
    * @tc.desc    The lastContent of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
3557
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3558 3559 3560
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3561 3562
  it('SendEvent_lastContent_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_0020 starts`);
Y
yichengzhao 已提交
3563 3564

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3565
    let lastContent = '';
Y
yichengzhao 已提交
3566 3567
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3568
    event.lastContent = lastContent;
Y
yichengzhao 已提交
3569 3570
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3571 3572
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3573
    }).catch(err => {
M
Mupceet 已提交
3574
      console.error(`AccessibleSendEvent: SendEvent_lastContent_0020 has error: ${err}`);
Y
yichengzhao 已提交
3575 3576 3577 3578 3579 3580
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3581 3582 3583
    * @tc.number  SendEvent_lastContent_constructor_0020
    * @tc.name    SendEvent_lastContent_constructor_0020
    * @tc.desc    The lastContent of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
3584
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3585 3586
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3587 3588 3589
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3590 3591
  it('SendEvent_lastContent_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_constructor_0020 starts`);
Y
yichengzhao 已提交
3592

M
Mupceet 已提交
3593 3594 3595 3596 3597 3598 3599
    let lastContent = '';
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      lastContent : lastContent,
    }
Y
yichengzhao 已提交
3600

M
Mupceet 已提交
3601
    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3602 3603

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3604 3605
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3606
    }).catch(err => {
M
Mupceet 已提交
3607
      console.error(`AccessibleSendEvent: SendEvent_lastContent_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
3608 3609 3610 3611 3612 3613
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3614 3615 3616
    * @tc.number  SendEvent_lastContent_0030
    * @tc.name    SendEvent_lastContent_0030
    * @tc.desc    The lastContent of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
3617
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3618 3619 3620
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3621 3622
  it('SendEvent_lastContent_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_0030 starts`);
Y
yichengzhao 已提交
3623 3624

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3625
    let lastContent = null;
Y
yichengzhao 已提交
3626 3627
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3628
    event.lastContent = lastContent;
Y
yichengzhao 已提交
3629 3630
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3631 3632
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3633
    }).catch(err => {
M
Mupceet 已提交
3634
      console.error(`AccessibleSendEvent: SendEvent_lastContent_0030 has error: ${err}`);
Y
yichengzhao 已提交
3635 3636 3637 3638 3639 3640
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3641 3642 3643
    * @tc.number  SendEvent_lastContent_constructor_0030
    * @tc.name    SendEvent_lastContent_constructor_0030
    * @tc.desc    The lastContent of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
3644
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3645 3646
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3647 3648 3649
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661
  it('SendEvent_lastContent_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_lastContent_constructor_0030 starts`);

    let lastContent = null;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      lastContent : lastContent,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3662 3663

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3664 3665
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3666
    }).catch(err => {
M
Mupceet 已提交
3667
      console.error(`AccessibleSendEvent: SendEvent_lastContent_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
3668 3669 3670 3671 3672
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
3673

Y
yichengzhao 已提交
3674
  /*
M
Mupceet 已提交
3675 3676 3677
    * @tc.number  SendEvent_beginIndex_0010
    * @tc.name    SendEvent_beginIndex_0010
    * @tc.desc    The beginIndex of EventInfo is 1, test sendEvent() function
Y
yichengzhao 已提交
3678
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3679 3680 3681
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3682 3683
  it('SendEvent_beginIndex_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_0010 starts`);
Y
yichengzhao 已提交
3684 3685

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3686
    let beginIndex = 1;
Y
yichengzhao 已提交
3687 3688
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3689
    event.beginIndex = beginIndex;
Y
yichengzhao 已提交
3690 3691
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3692 3693
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3694
    }).catch(err => {
M
Mupceet 已提交
3695
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_0010 has error: ${err}`);
Y
yichengzhao 已提交
3696 3697 3698 3699 3700 3701
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3702 3703 3704
    * @tc.number  SendEvent_beginIndex_constructor_0010
    * @tc.name    SendEvent_beginIndex_constructor_0010
    * @tc.desc    The beginIndex of EventInfo is 1, test sendEvent() function
Y
yichengzhao 已提交
3705
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3706 3707
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3708 3709 3710
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722
  it('SendEvent_beginIndex_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0010 starts`);

    let beginIndex = 1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      beginIndex : beginIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3723 3724

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3725 3726
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3727
    }).catch(err => {
M
Mupceet 已提交
3728
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
3729 3730 3731 3732 3733 3734
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3735 3736 3737
    * @tc.number  SendEvent_beginIndex_0020
    * @tc.name    SendEvent_beginIndex_0020
    * @tc.desc    The beginIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
3738
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3739 3740 3741
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3742 3743
  it('SendEvent_beginIndex_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_0020 starts`);
Y
yichengzhao 已提交
3744 3745

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3746
    let beginIndex = 0;
Y
yichengzhao 已提交
3747 3748
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3749
    event.beginIndex = beginIndex;
Y
yichengzhao 已提交
3750 3751
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3752 3753
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3754
    }).catch(err => {
M
Mupceet 已提交
3755
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_0020 has error: ${err}`);
Y
yichengzhao 已提交
3756 3757 3758 3759 3760 3761
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3762 3763 3764
    * @tc.number  SendEvent_beginIndex_constructor_0020
    * @tc.name    SendEvent_beginIndex_constructor_0020
    * @tc.desc    The beginIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
3765
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3766 3767
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3768 3769 3770
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782
  it('SendEvent_beginIndex_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0020 starts`);

    let beginIndex = 0;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      beginIndex : beginIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3783 3784

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3785 3786
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3787
    }).catch(err => {
M
Mupceet 已提交
3788
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
3789 3790 3791 3792 3793 3794
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3795 3796 3797
    * @tc.number  SendEvent_beginIndex_0030
    * @tc.name    SendEvent_beginIndex_0030
    * @tc.desc    The beginIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
3798
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3799 3800 3801
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3802 3803
  it('SendEvent_beginIndex_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_0030 starts`);
Y
yichengzhao 已提交
3804 3805

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3806
    let beginIndex = -1;
Y
yichengzhao 已提交
3807 3808
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3809
    event.beginIndex = beginIndex;
Y
yichengzhao 已提交
3810 3811
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3812 3813
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3814
    }).catch(err => {
M
Mupceet 已提交
3815
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_0030 has error: ${err}`);
Y
yichengzhao 已提交
3816 3817 3818 3819 3820 3821
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3822 3823 3824
    * @tc.number  SendEvent_beginIndex_constructor_0030
    * @tc.name    SendEvent_beginIndex_constructor_0030
    * @tc.desc    The beginIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
3825
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3826 3827
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3828 3829 3830
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842
  it('SendEvent_beginIndex_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0030 starts`);

    let beginIndex = -1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      beginIndex : beginIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3843 3844

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3845 3846
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3847
    }).catch(err => {
M
Mupceet 已提交
3848
      console.error(`AccessibleSendEvent: SendEvent_beginIndex_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
3849 3850 3851 3852 3853 3854
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3855 3856 3857 3858 3859 3860 3861 3862 3863
      * @tc.number  SendEvent_currentIndex_0010
      * @tc.name    SendEvent_currentIndex_0010
      * @tc.desc    The currentIndex of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_currentIndex_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_0010 starts`);
Y
yichengzhao 已提交
3864 3865

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3866
    let currentIndex = 1;
Y
yichengzhao 已提交
3867 3868
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3869
    event.currentIndex = currentIndex;
Y
yichengzhao 已提交
3870 3871
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3872 3873
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3874
    }).catch(err => {
M
Mupceet 已提交
3875
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_0010 has error: ${err}`);
Y
yichengzhao 已提交
3876 3877 3878 3879 3880 3881
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902
      * @tc.number  SendEvent_currentIndex_constructor_0010
      * @tc.name    SendEvent_currentIndex_constructor_0010
      * @tc.desc    The currentIndex of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      *             Another test point is to test whether the modified constructor (EventInfo)
      *             works correctly.
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_currentIndex_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0010 starts`);

    let currentIndex = 1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      currentIndex : currentIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3903 3904

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3905 3906
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3907
    }).catch(err => {
M
Mupceet 已提交
3908
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
3909 3910 3911 3912 3913 3914
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3915 3916 3917
    * @tc.number  SendEvent_currentIndex_0020
    * @tc.name    SendEvent_currentIndex_0020
    * @tc.desc    The currentIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
3918
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3919 3920 3921
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3922 3923
  it('SendEvent_currentIndex_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_0020 starts`);
Y
yichengzhao 已提交
3924 3925

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3926
    let currentIndex = 0;
Y
yichengzhao 已提交
3927 3928
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3929
    event.currentIndex = currentIndex;
Y
yichengzhao 已提交
3930 3931
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3932 3933
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3934
    }).catch(err => {
M
Mupceet 已提交
3935
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_0020 has error: ${err}`);
Y
yichengzhao 已提交
3936 3937 3938 3939 3940 3941
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3942 3943 3944
    * @tc.number  SendEvent_currentIndex_constructor_0020
    * @tc.name    SendEvent_currentIndex_constructor_0020
    * @tc.desc    The currentIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
3945
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3946 3947 3948
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960
  it('SendEvent_currentIndex_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0020 starts`);

    let currentIndex = 0;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      currentIndex : currentIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
3961 3962

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3963 3964
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3965
    }).catch(err => {
M
Mupceet 已提交
3966
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
3967 3968 3969 3970 3971 3972
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
3973 3974 3975
    * @tc.number  SendEvent_currentIndex_0030
    * @tc.name    SendEvent_currentIndex_0030
    * @tc.desc    The currentIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
3976
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3977 3978 3979
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3980 3981
  it('SendEvent_currentIndex_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_0030 starts`);
Y
yichengzhao 已提交
3982 3983

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
3984
    let currentIndex = -1;
Y
yichengzhao 已提交
3985 3986
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
3987
    event.currentIndex = currentIndex;
Y
yichengzhao 已提交
3988 3989
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
3990 3991
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3992
    }).catch(err => {
M
Mupceet 已提交
3993
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_0030 has error: ${err}`);
Y
yichengzhao 已提交
3994 3995 3996 3997 3998 3999
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4000 4001 4002
    * @tc.number  SendEvent_currentIndex_constructor_0030
    * @tc.name    SendEvent_currentIndex_constructor_0030
    * @tc.desc    The currentIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
4003
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4004 4005
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4006 4007 4008
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020
  it('SendEvent_currentIndex_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0030 starts`);

    let currentIndex = -1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      currentIndex : currentIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4021 4022

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4023 4024
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4025
    }).catch(err => {
M
Mupceet 已提交
4026
      console.error(`AccessibleSendEvent: SendEvent_currentIndex_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
4027 4028 4029 4030 4031 4032
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4033 4034 4035 4036 4037 4038 4039 4040 4041
      * @tc.number  SendEvent_endIndex_0010
      * @tc.name    SendEvent_endIndex_0010
      * @tc.desc    The endIndex of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_endIndex_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_0010 starts`);
Y
yichengzhao 已提交
4042 4043

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4044
    let endIndex = 1;
Y
yichengzhao 已提交
4045 4046
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4047
    event.endIndex = endIndex;
Y
yichengzhao 已提交
4048 4049
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4050 4051
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4052
    }).catch(err => {
M
Mupceet 已提交
4053
      console.error(`AccessibleSendEvent: SendEvent_endIndex_0010 has error: ${err}`);
Y
yichengzhao 已提交
4054 4055 4056 4057 4058 4059
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080
      * @tc.number  SendEvent_endIndex_constructor_0010
      * @tc.name    SendEvent_endIndex_constructor_0010
      * @tc.desc    The endIndex of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      *             Another test point is to test whether the modified constructor (EventInfo)
      *             works correctly.
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_endIndex_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_constructor_0010 starts`);

    let endIndex = 1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      endIndex : endIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4081 4082

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4083 4084
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4085
    }).catch(err => {
M
Mupceet 已提交
4086
      console.error(`AccessibleSendEvent: SendEvent_endIndex_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
4087 4088 4089 4090 4091 4092
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4093 4094 4095
    * @tc.number  SendEvent_endIndex_0020
    * @tc.name    SendEvent_endIndex_0020
    * @tc.desc    The endIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
4096
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
4097 4098 4099
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4100 4101
  it('SendEvent_endIndex_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_0020 starts`);
Y
yichengzhao 已提交
4102 4103

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4104
    let endIndex = 0;
Y
yichengzhao 已提交
4105 4106
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4107
    event.endIndex = endIndex;
Y
yichengzhao 已提交
4108 4109
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4110 4111
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4112
    }).catch(err => {
M
Mupceet 已提交
4113
      console.error(`AccessibleSendEvent: SendEvent_endIndex_0020 has error: ${err}`);
Y
yichengzhao 已提交
4114 4115 4116 4117 4118 4119
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4120 4121 4122
    * @tc.number  SendEvent_endIndex_constructor_0020
    * @tc.name    SendEvent_endIndex_constructor_0020
    * @tc.desc    The endIndex of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
4123
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4124 4125
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4126 4127 4128
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140
  it('SendEvent_endIndex_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_constructor_0020 starts`);

    let endIndex = 0;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      endIndex : endIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4141 4142

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4143 4144
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4145
    }).catch(err => {
M
Mupceet 已提交
4146
      console.error(`AccessibleSendEvent: SendEvent_endIndex_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
4147 4148 4149 4150 4151 4152
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4153 4154 4155
    * @tc.number  SendEvent_endIndex_0030
    * @tc.name    SendEvent_endIndex_0030
    * @tc.desc    The endIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
4156
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
4157 4158 4159
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4160 4161
  it('SendEvent_endIndex_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_0030 starts`);
Y
yichengzhao 已提交
4162 4163

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4164
    let endIndex = -1;
Y
yichengzhao 已提交
4165 4166
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4167
    event.endIndex = endIndex;
Y
yichengzhao 已提交
4168 4169
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4170 4171
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4172
    }).catch(err => {
M
Mupceet 已提交
4173
      console.error(`AccessibleSendEvent: SendEvent_endIndex_0030 has error: ${err}`);
Y
yichengzhao 已提交
4174 4175 4176 4177 4178 4179
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4180 4181 4182
    * @tc.number  SendEvent_endIndex_constructor_0030
    * @tc.name    SendEvent_endIndex_constructor_0030
    * @tc.desc    The endIndex of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
4183
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4184 4185
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4186 4187 4188
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200
  it('SendEvent_endIndex_constructor_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_endIndex_constructor_0030 starts`);

    let endIndex = -1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      endIndex : endIndex,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4201 4202

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4203 4204
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4205
    }).catch(err => {
M
Mupceet 已提交
4206
      console.error(`AccessibleSendEvent: SendEvent_endIndex_constructor_0030 has error: ${err}`);
Y
yichengzhao 已提交
4207 4208 4209 4210 4211 4212
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4213 4214 4215 4216 4217 4218 4219 4220 4221
      * @tc.number  SendEvent_itemCount_0010
      * @tc.name    SendEvent_itemCount_0010
      * @tc.desc    The itemCount of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_itemCount_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_itemCount_0010 starts`);
Y
yichengzhao 已提交
4222 4223

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4224
    let itemCount = 1;
Y
yichengzhao 已提交
4225 4226
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4227
    event.itemCount = itemCount;
Y
yichengzhao 已提交
4228 4229
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4230 4231
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4232
    }).catch(err => {
M
Mupceet 已提交
4233
      console.error(`AccessibleSendEvent: SendEvent_itemCount_0010 has error: ${err}`);
Y
yichengzhao 已提交
4234 4235 4236 4237 4238 4239
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260
      * @tc.number  SendEvent_itemCount_constructor_0010
      * @tc.name    SendEvent_itemCount_constructor_0010
      * @tc.desc    The itemCount of EventInfo is 1, test sendEvent() function
      *             The result of sendEvent() should be equal to a promise of undefined
      *             Another test point is to test whether the modified constructor (EventInfo)
      *             works correctly.
      * @tc.size    SmallTest
      * @tc.type    User
      */
  it('SendEvent_itemCount_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_itemCount_constructor_0010 starts`);

    let itemCount = 1;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      itemCount : itemCount,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4261 4262

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4263 4264
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4265
    }).catch(err => {
M
Mupceet 已提交
4266
      console.error(`AccessibleSendEvent: SendEvent_itemCount_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
4267 4268 4269 4270 4271 4272
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4273 4274 4275
    * @tc.number  SendEvent_itemCount_0020
    * @tc.name    SendEvent_itemCount_0020
    * @tc.desc    The itemCount of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
4276
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
4277 4278 4279
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4280 4281
  it('SendEvent_itemCount_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_itemCount_0020 starts`);
Y
yichengzhao 已提交
4282 4283

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4284
    let itemCount = 0;
Y
yichengzhao 已提交
4285 4286
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4287
    event.itemCount = itemCount;
Y
yichengzhao 已提交
4288 4289
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4290 4291
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4292
    }).catch(err => {
M
Mupceet 已提交
4293
      console.error(`AccessibleSendEvent: SendEvent_itemCount_0020 has error: ${err}`);
Y
yichengzhao 已提交
4294 4295 4296 4297 4298 4299
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4300 4301 4302
    * @tc.number  SendEvent_itemCount_constructor_0020
    * @tc.name    SendEvent_itemCount_constructor_0020
    * @tc.desc    The itemCount of EventInfo is 0, test sendEvent() function
Y
yichengzhao 已提交
4303
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4304 4305
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4306 4307 4308
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320
  it('SendEvent_itemCount_constructor_0020', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_itemCount_constructor_0020 starts`);

    let itemCount = 0;
    let jsonObj = {
      type : eventType,
      bundleName : bundleName,
      triggerAction : triggerAction,
      itemCount : itemCount,
    }

    let event = new accessibility.EventInfo(jsonObj);
Y
yichengzhao 已提交
4321 4322

    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4323 4324
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4325
    }).catch(err => {
M
Mupceet 已提交
4326
      console.error(`AccessibleSendEvent: SendEvent_itemCount_constructor_0020 has error: ${err}`);
Y
yichengzhao 已提交
4327 4328 4329 4330 4331 4332
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
4333 4334 4335
    * @tc.number  SendEvent_itemCount_0030
    * @tc.name    SendEvent_itemCount_0030
    * @tc.desc    The itemCount of EventInfo is -1, test sendEvent() function
Y
yichengzhao 已提交
4336
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
4337 4338 4339
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4340 4341
  it('SendEvent_itemCount_0030', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_itemCount_0030 starts`);
Y
yichengzhao 已提交
4342 4343

    let event = new accessibility.EventInfo();
M
Mupceet 已提交
4344
    let itemCount = -1;
Y
yichengzhao 已提交
4345 4346
    event.type = eventType;
    event.bundleName = bundleName;
M
Mupceet 已提交
4347
    event.itemCount = itemCount;
Y
yichengzhao 已提交
4348 4349
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
4350 4351
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
4352
    }).catch(err => {
M
Mupceet 已提交
4353
      console.error(`AccessibleSendEvent: SendEvent_itemCount_0030 has error: ${err}`);
Y
yichengzhao 已提交
4354 4355 4356 4357 4358
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390
    /*
    * @tc.number  SendEvent_itemCount_constructor_0030
    * @tc.name    SendEvent_itemCount_constructor_0030
    * @tc.desc    The itemCount of EventInfo is -1, test sendEvent() function
    *             The result of sendEvent() should be equal to a promise of undefined
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
    * @tc.size    SmallTest
    * @tc.type    User
    */
    it('SendEvent_itemCount_constructor_0030', 0, async function (done) {
      console.info(`AccessibleSendEvent: SendEvent_itemCount_constructor_0030 starts`);
  
      let itemCount = -1;
      let jsonObj = {
        type : eventType,
        bundleName : bundleName,
        triggerAction : triggerAction,
        itemCount : itemCount,
      }
  
      let event = new accessibility.EventInfo(jsonObj);

      accessibility.sendEvent(event).then((result) => {
        expect(result).assertEqual(undefined);
        done();
      }).catch(err => {
        console.error(`AccessibleSendEvent: SendEvent_itemCount_constructor_0030 has error: ${err}`);
        expect(null).assertFail();
        done();
      });
    })
Y
yichengzhao 已提交
4391
})
J
jiyong_sd 已提交
4392
}