AccessibleSendEvent.test.js 158.2 KB
Newer Older
Y
yichengzhao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
 * 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.
 */
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import accessibility from '@ohos.accessibility'

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

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 已提交
35
    /* Cases SendEvent_0010-0020 & SendEvent_Null_0010-0020  & SendEvent_construct_0010*/
Y
yichengzhao 已提交
36 37 38
    /*    are for accessibility.sendEvent() API test                                  */
    /******************************************************************************** */
    
M
Mupceet 已提交
39
   /*
Y
yichengzhao 已提交
40 41
    * @tc.number  SendEvent_0010
    * @tc.name    SendEvent_0010
Y
yichengzhao 已提交
42 43
    * @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 已提交
44 45 46
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
47 48
    it('SendEvent_0010', 0, async function (done) {
        console.info('SendEvent_0010');
Y
yichengzhao 已提交
49 50 51 52 53 54
        let event = new accessibility.EventInfo();
        event.type = eventType;
        event.bundleName = bundleName;
        event.triggerAction = triggerAction;

        accessibility.sendEvent(event, (err, data) => {
Y
yichengzhao 已提交
55 56 57 58 59
            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 已提交
60 61 62 63
        })
    })

    /*
Y
yichengzhao 已提交
64 65
    * @tc.number  SendEvent_0020
    * @tc.name    SendEvent_0020
Y
yichengzhao 已提交
66 67
    * @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 已提交
68 69 70
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
71 72
    it('SendEvent_0020', 0, async function (done) {
        console.info('SendEvent_0020');
Y
yichengzhao 已提交
73 74 75 76 77 78
        let event = new accessibility.EventInfo();
        event.type = eventType;
        event.bundleName = bundleName;
        event.triggerAction = triggerAction;

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

    /*
Y
yichengzhao 已提交
90 91
    * @tc.number  SendEvent_null_0010
    * @tc.name    SendEvent_null_0010
Y
yichengzhao 已提交
92 93
    * @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 已提交
94 95 96
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
97 98
    it('SendEvent_null_0010', 0, async function (done) {
        console.info('SendEvent_null_0010');
Y
yichengzhao 已提交
99 100 101
        let event = null;

        accessibility.sendEvent(event, (err, data) => {
Y
yichengzhao 已提交
102 103 104 105
            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 已提交
106 107 108 109 110
            done();
        })
    })

    /*
Y
yichengzhao 已提交
111 112
    * @tc.number  SendEvent_null_0020
    * @tc.name    SendEvent_null_0020
Y
yichengzhao 已提交
113 114
    * @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 已提交
115 116 117
    * @tc.size    SmallTest
    * @tc.type    User
    */
Y
yichengzhao 已提交
118 119
    it('SendEvent_null_0020', 0, async function (done) {
        console.info('SendEvent_null_0020');
Y
yichengzhao 已提交
120 121
        let event = null;

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

M
Mupceet 已提交
133 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
      /*
    * @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 已提交
162
    /*********************************************************************************************************** */
M
Mupceet 已提交
163 164
    /* Cases SendEvent_type_0010-SendEvent_itemCount_constructor_0030 
    /* are for interface accessibility.EventInfo API test                                                        */
Y
yichengzhao 已提交
165 166 167 168 169 170
    /*********************************************************************************************************** */

  /*
    * @tc.number  SendEvent_type_0010
    * @tc.name    SendEvent_type_0010
    * @tc.desc    The type of EventInfo is 'accessibilityFocus', test sendEvent() function
Y
yichengzhao 已提交
171
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
172 173 174 175 176 177 178 179 180 181 182 183
    * @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 已提交
184 185
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
186 187 188 189 190 191 192
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
193 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
  /*
    * @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 已提交
226 227 228 229
  /*
    * @tc.number  SendEvent_type_0020
    * @tc.name    SendEvent_type_0020
    * @tc.desc    The type of EventInfo is 'accessibilityFocusClear', test sendEvent() function
Y
yichengzhao 已提交
230
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
231 232 233 234 235 236 237 238 239 240 241 242
    * @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 已提交
243 244
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
245 246 247 248 249 250 251
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
252 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
  /*
    * @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 已提交
285 286 287 288
  /*
    * @tc.number  SendEvent_type_0030
    * @tc.name    SendEvent_type_0030
    * @tc.desc    The type of EventInfo is 'click', test sendEvent() function
Y
yichengzhao 已提交
289
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
290 291 292 293 294 295 296 297 298 299 300 301
    * @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 已提交
302 303
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
304 305 306 307 308 309 310
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
311 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
  /*
    * @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 已提交
344 345 346 347
  /*
    * @tc.number  SendEvent_type_0040
    * @tc.name    SendEvent_type_0040
    * @tc.desc    The type of EventInfo is 'longClick', test sendEvent() function
Y
yichengzhao 已提交
348
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
349 350 351 352 353 354 355 356 357 358 359 360
    * @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 已提交
361 362
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
363 364 365 366 367 368 369
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
370 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
  /*
    * @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 已提交
403 404 405 406
  /*
    * @tc.number  SendEvent_type_0050
    * @tc.name    SendEvent_type_0050
    * @tc.desc    The type of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
407
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
408 409 410 411 412 413 414 415 416 417 418 419
    * @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 已提交
420 421
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
422 423 424 425 426 427 428
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
429 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
  /*
    * @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 已提交
457 458 459 460
  /*
    * @tc.number  SendEvent_type_0060
    * @tc.name    SendEvent_type_0060
    * @tc.desc    The type of EventInfo is 'select', test sendEvent() function
Y
yichengzhao 已提交
461
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
462 463 464 465 466 467 468 469 470 471 472 473
    * @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 已提交
474 475
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
476 477 478 479 480 481 482
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
483 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
  /*
    * @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 已提交
516 517 518 519
  /*
    * @tc.number  SendEvent_type_0070
    * @tc.name    SendEvent_type_0070
    * @tc.desc    The type of EventInfo is 'hoverEnter', test sendEvent() function
Y
yichengzhao 已提交
520
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
521 522 523 524 525 526 527 528 529 530 531 532
    * @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 已提交
533 534
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
535 536 537 538 539 540 541
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
542 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
  /*
    * @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 已提交
575 576 577 578
  /*
    * @tc.number  SendEvent_type_0080
    * @tc.name    SendEvent_type_0080
    * @tc.desc    The type of EventInfo is 'hoverExit', test sendEvent() function
Y
yichengzhao 已提交
579
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
580 581 582 583 584 585 586 587 588 589 590 591
    * @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 已提交
592 593
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
594 595 596 597 598 599 600
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
601 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
  /*
    * @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 已提交
634 635 636 637
  /*
    * @tc.number  SendEvent_type_0090
    * @tc.name    SendEvent_type_0090
    * @tc.desc    The type of EventInfo is 'textUpdate', test sendEvent() function
Y
yichengzhao 已提交
638
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
639 640 641 642 643 644 645 646 647 648 649 650
    * @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 已提交
651 652
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
653 654 655 656 657 658 659
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
660 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
  /*
    * @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 已提交
693 694 695 696
  /*
    * @tc.number  SendEvent_type_0100
    * @tc.name    SendEvent_type_0100
    * @tc.desc    The type of EventInfo is 'textSelectionUpdate', test sendEvent() function
Y
yichengzhao 已提交
697
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
698 699 700 701 702 703 704 705 706 707 708 709
    * @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 已提交
710 711
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
712 713 714 715 716 717 718
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
719 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
  /*
    * @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 已提交
752 753 754 755
  /*
    * @tc.number  SendEvent_type_0110
    * @tc.name    SendEvent_type_0110
    * @tc.desc    The type of EventInfo is 'scroll', test sendEvent() function
Y
yichengzhao 已提交
756
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
757 758 759 760 761 762 763 764 765 766 767 768
    * @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 已提交
769 770
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
771 772 773 774 775 776 777 778
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_type_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

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

    let eventType = '';
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
827 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
    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 已提交
865
    }).catch((err) => {
M
Mupceet 已提交
866
        console.info(`AccessibleSendEvent: SendEvent_type_constructor_0120 has error: ${err}`);
Y
yichengzhao 已提交
867
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
868
        done();
Y
yichengzhao 已提交
869 870 871 872
    });
  })

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

    let eventType = null;
    let event = new accessibility.EventInfo();
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
888 889 890 891
    accessibility.sendEvent(event).then((result) =>{
        console.error(`AccessibleSendEvent: SendEvent_type_0130 result ${result}`);
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
892
    }).catch((err) => {
M
Mupceet 已提交
893
        console.info(`AccessibleSendEvent: SendEvent_type_0130 has error: ${err}`);
Y
yichengzhao 已提交
894
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
895
        done();
Y
yichengzhao 已提交
896 897 898 899
    });
  })

  /*
M
Mupceet 已提交
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 931 932 933 934
    * @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();
    });
  })

  /*
    * @tc.number  SendEvent_windowUpdateType_0010
Y
yichengzhao 已提交
935 936
    * @tc.name    SendEvent_windowUpdateType_0010
    * @tc.desc    The windowUpdateType of EventInfo is 'add', test sendEvent() function
Y
yichengzhao 已提交
937
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
938 939 940 941 942 943 944 945 946 947 948 949 950
    * @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 已提交
951 952
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
953 954 955 956 957 958 959 960 961 962 963
    }).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 已提交
964
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
965 966 967 968 969 970 971 972 973 974 975 976 977
    * @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 已提交
978 979
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
980 981 982 983 984 985 986 987 988 989
    }).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 已提交
990
    * @tc.desc    The windowUpdateType of EventInfo is 'bounds', test sendEvent() function
Y
yichengzhao 已提交
991
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
992 993 994 995 996 997 998
    * @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 已提交
999
    let windowUpdateType = 'bounds';
Y
yichengzhao 已提交
1000 1001 1002 1003 1004
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1005 1006
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
    }).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 已提交
1017
    * @tc.desc    The windowUpdateType of EventInfo is 'active', test sendEvent() function
Y
yichengzhao 已提交
1018
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1019 1020 1021 1022 1023 1024 1025
    * @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 已提交
1026
    let windowUpdateType = 'active';
Y
yichengzhao 已提交
1027 1028 1029 1030 1031
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1032 1033
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043
    }).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 已提交
1044
    * @tc.desc    The windowUpdateType of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
1045
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1046 1047 1048 1049 1050 1051 1052
    * @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 已提交
1053
    let windowUpdateType = 'focus';
Y
yichengzhao 已提交
1054 1055 1056 1057 1058
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1059 1060
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
    }).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 已提交
1071
    * @tc.desc    The windowUpdateType of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1072
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1073 1074 1075 1076 1077 1078 1079
    * @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 已提交
1080
    let windowUpdateType = '';
Y
yichengzhao 已提交
1081 1082 1083 1084 1085
    event.type = eventType;
    event.windowUpdateType = windowUpdateType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1086 1087
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1088 1089 1090 1091 1092 1093 1094 1095
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_windowUpdateType_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

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

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

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

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

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

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

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

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

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

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

  /*
M
Mupceet 已提交
1189 1190 1191
    * @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 已提交
1192
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1193 1194 1195
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1196 1197
  it('SendEvent_bundleName_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_bundleName_0010 starts`);
Y
yichengzhao 已提交
1198 1199

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

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

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

    let event = new accessibility.EventInfo(jsonObj);

Y
yichengzhao 已提交
1236
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1237 1238
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1239
    }).catch(err => {
M
Mupceet 已提交
1240
      console.error(`AccessibleSendEvent: SendEvent_bundleName_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1241 1242 1243 1244 1245 1246 1247 1248 1249
      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 已提交
1250
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
    * @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 已提交
1262
    accessibility.sendEvent(event).then((result) =>{
Y
yichengzhao 已提交
1263
        console.error(`AccessibleSendEvent: SendEvent_bundleName_0020 result ${result}`);
M
Mupceet 已提交
1264 1265
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
1266 1267 1268
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_0020 has error: ${err}`);
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
1269 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
        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 已提交
1303 1304 1305 1306 1307 1308 1309
    });
  })

  /*
    * @tc.number  SendEvent_bundleName_0030
    * @tc.name    SendEvent_bundleName_0030
    * @tc.desc    The bundleName of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1310
    *             The result of sendEvent() should be equal to a rejected promise of undefined
Y
yichengzhao 已提交
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321
    * @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 已提交
1322
    accessibility.sendEvent(event).then((result) =>{
Y
yichengzhao 已提交
1323
        console.error(`AccessibleSendEvent: SendEvent_bundleName_0030 result ${result}`);
M
Mupceet 已提交
1324 1325
        expect(null).assertFail();
        done();
Y
yichengzhao 已提交
1326 1327 1328
    }).catch((err) => {
        console.info(`AccessibleSendEvent: SendEvent_bundleName_0030 has error: ${err}`);
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
1329 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
        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 已提交
1363 1364 1365 1366 1367 1368 1369
    });
  })

  /*
    * @tc.number  SendEvent_componentType_0010
    * @tc.name    SendEvent_componentType_0010
    * @tc.desc    The componentType of EventInfo is 'button', test sendEvent() function
Y
yichengzhao 已提交
1370
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
    * @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 已提交
1384 1385
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1386 1387 1388 1389 1390 1391 1392
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1393 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
  /*
    * @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 已提交
1426 1427 1428 1429
  /*
    * @tc.number  SendEvent_componentType_0020
    * @tc.name    SendEvent_componentType_0020
    * @tc.desc    The componentType of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1430
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443
    * @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 已提交
1444 1445
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1446 1447 1448 1449 1450 1451 1452
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1453 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
  /*
    * @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 已提交
1486 1487 1488 1489
  /*
    * @tc.number  SendEvent_componentType_0030
    * @tc.name    SendEvent_componentType_0030
    * @tc.desc    The componentType of EventInfo is null, test sendEvent() function
Y
yichengzhao 已提交
1490
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503
    * @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 已提交
1504 1505
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1506 1507 1508 1509 1510 1511 1512 1513
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_componentType_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
1514 1515 1516
    * @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 已提交
1517
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1518 1519
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1520 1521 1522
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534
  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 已提交
1535 1536

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

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

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

  /*
M
Mupceet 已提交
1574 1575 1576
    * @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 已提交
1577
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1578 1579
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1580 1581 1582
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594
  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 已提交
1595 1596

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

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

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

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

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

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

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

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

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

  /*
M
Mupceet 已提交
1694 1695 1696
    * @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 已提交
1697
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1698 1699
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1700 1701 1702
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714
  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 已提交
1715 1716

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

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

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

  /*
M
Mupceet 已提交
1754 1755 1756
    * @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 已提交
1757
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1758 1759
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1760 1761 1762
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774
  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 已提交
1775 1776

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

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

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

  /*
M
Mupceet 已提交
1814 1815 1816
    * @tc.number  SendEvent_description_constructor_0020
    * @tc.name    SendEvent_description_constructor_0020
    * @tc.desc    The description of EventInfo is '', test sendEvent() function
Y
yichengzhao 已提交
1817
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1818 1819
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1820 1821 1822
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834
  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 已提交
1835 1836

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

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

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

  /*
M
Mupceet 已提交
1874 1875 1876
    * @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 已提交
1877
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
1878 1879
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
1880 1881 1882
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894
  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 已提交
1895 1896

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

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

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

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

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

    let event = new accessibility.EventInfo(jsonObj);

Y
yichengzhao 已提交
1954
    accessibility.sendEvent(event).then((result) => {
Y
yichengzhao 已提交
1955 1956
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1957
    }).catch(err => {
M
Mupceet 已提交
1958
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0010 has error: ${err}`);
Y
yichengzhao 已提交
1959 1960 1961 1962 1963 1964 1965 1966 1967
      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 已提交
1968
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
    * @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 已提交
1981 1982
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
1983 1984 1985 1986 1987 1988 1989
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
1990 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
    /*
    * @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 已提交
2022 2023 2024 2025
  /*
    * @tc.number  SendEvent_triggerAction_0030
    * @tc.name    SendEvent_triggerAction_0030
    * @tc.desc    The triggerAction of EventInfo is 'focus', test sendEvent() function
Y
yichengzhao 已提交
2026
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
    * @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 已提交
2039 2040
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2041 2042 2043 2044 2045 2046 2047
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2048 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
  /*
    * @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 已提交
2078 2079 2080 2081
  /*
    * @tc.number  SendEvent_triggerAction_0040
    * @tc.name    SendEvent_triggerAction_0040
    * @tc.desc    The triggerAction of EventInfo is 'clearFocus', test sendEvent() function
Y
yichengzhao 已提交
2082
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094
    * @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 已提交
2095 2096
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2097 2098 2099 2100 2101 2102 2103
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0040 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2104 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
  /*
    * @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 已提交
2136 2137 2138 2139
  /*
    * @tc.number  SendEvent_triggerAction_0050
    * @tc.name    SendEvent_triggerAction_0050
    * @tc.desc    The triggerAction of EventInfo is 'clearSelection', test sendEvent() function
Y
yichengzhao 已提交
2140
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
    * @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 已提交
2153 2154
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2155 2156 2157 2158 2159 2160 2161
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0050 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2162 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
  /*
    * @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 已提交
2194 2195 2196 2197
  /*
    * @tc.number  SendEvent_triggerAction_0060
    * @tc.name    SendEvent_triggerAction_0060
    * @tc.desc    The triggerAction of EventInfo is 'click', test sendEvent() function
Y
yichengzhao 已提交
2198
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210
    * @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 已提交
2211 2212
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2213 2214 2215 2216 2217 2218 2219
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0060 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2220 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
  /*
    * @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 已提交
2252 2253 2254 2255
  /*
    * @tc.number  SendEvent_triggerAction_0070
    * @tc.name    SendEvent_triggerAction_0070
    * @tc.desc    The triggerAction of EventInfo is 'longClick', test sendEvent() function
Y
yichengzhao 已提交
2256
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268
    * @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 已提交
2269 2270
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2271 2272 2273 2274 2275 2276 2277
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0070 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2278 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
  /*
    * @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 已提交
2310 2311 2312 2313
  /*
    * @tc.number  SendEvent_triggerAction_0080
    * @tc.name    SendEvent_triggerAction_0080
    * @tc.desc    The triggerAction of EventInfo is 'cut', test sendEvent() function
Y
yichengzhao 已提交
2314
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326
    * @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 已提交
2327 2328
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2329 2330 2331 2332 2333 2334 2335 2336
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0080 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

  /*
M
Mupceet 已提交
2337 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
    * @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
Y
yichengzhao 已提交
2370 2371
    * @tc.name    SendEvent_triggerAction_0090
    * @tc.desc    The triggerAction of EventInfo is 'copy', test sendEvent() function
Y
yichengzhao 已提交
2372
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384
    * @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 已提交
2385 2386
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2387 2388 2389 2390 2391 2392 2393
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0090 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2394 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
  /*
    * @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 已提交
2426 2427 2428 2429
  /*
    * @tc.number  SendEvent_triggerAction_0100
    * @tc.name    SendEvent_triggerAction_0100
    * @tc.desc    The triggerAction of EventInfo is 'paste', test sendEvent() function
Y
yichengzhao 已提交
2430
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442
    * @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 已提交
2443 2444
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2445 2446 2447 2448 2449 2450 2451
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0100 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2452 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
  /*
    * @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 已提交
2484 2485 2486 2487
  /*
    * @tc.number  SendEvent_triggerAction_0110
    * @tc.name    SendEvent_triggerAction_0110
    * @tc.desc    The triggerAction of EventInfo is 'select', test sendEvent() function
Y
yichengzhao 已提交
2488
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500
    * @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 已提交
2501 2502
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2503 2504 2505 2506 2507 2508 2509
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0110 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2510 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
  /*
    * @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 已提交
2542 2543 2544 2545
  /*
    * @tc.number  SendEvent_triggerAction_0120
    * @tc.name    SendEvent_triggerAction_0120
    * @tc.desc    The triggerAction of EventInfo is 'setText', test sendEvent() function
Y
yichengzhao 已提交
2546
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558
    * @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 已提交
2559 2560
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2561 2562 2563 2564 2565 2566 2567
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0120 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2568 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
  /*
    * @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 已提交
2600 2601 2602 2603
  /*
    * @tc.number  SendEvent_triggerAction_0130
    * @tc.name    SendEvent_triggerAction_0130
    * @tc.desc    The triggerAction of EventInfo is 'delete', test sendEvent() function
Y
yichengzhao 已提交
2604
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616
    * @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 已提交
2617 2618
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2619 2620 2621 2622 2623 2624 2625
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0130 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2626 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
  /*
    * @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 已提交
2658 2659 2660 2661
  /*
    * @tc.number  SendEvent_triggerAction_0140
    * @tc.name    SendEvent_triggerAction_0140
    * @tc.desc    The triggerAction of EventInfo is 'scrollForward', test sendEvent() function
Y
yichengzhao 已提交
2662
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674
    * @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 已提交
2675 2676
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2677 2678 2679 2680 2681 2682 2683
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0140 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2684 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
  /*
    * @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 已提交
2716 2717 2718 2719
  /*
    * @tc.number  SendEvent_triggerAction_0150
    * @tc.name    SendEvent_triggerAction_0150
    * @tc.desc    The triggerAction of EventInfo is 'scrollBackward', test sendEvent() function
Y
yichengzhao 已提交
2720
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732
    * @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 已提交
2733 2734
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2735 2736 2737 2738 2739 2740 2741
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0150 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2742 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
  /*
    * @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 已提交
2774 2775 2776 2777
  /*
    * @tc.number  SendEvent_triggerAction_0160
    * @tc.name    SendEvent_triggerAction_0160
    * @tc.desc    The triggerAction of EventInfo is 'setSelection', test sendEvent() function
Y
yichengzhao 已提交
2778
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790
    * @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 已提交
2791 2792
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2793 2794 2795 2796 2797 2798 2799 2800
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_triggerAction_0160 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

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

    let event = new accessibility.EventInfo();
    let triggerAction = '';
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
2848
    accessibility.sendEvent(event).then((result) =>{
M
Mupceet 已提交
2849 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
        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 已提交
2885
    }).catch((err) => {
M
Mupceet 已提交
2886
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0170 has error: ${err}`);
Y
yichengzhao 已提交
2887
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
2888
        done();
Y
yichengzhao 已提交
2889 2890 2891 2892
    });
  })

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

    let event = new accessibility.EventInfo();
    let triggerAction = null;
    event.type = eventType;
    event.bundleName = bundleName;
    event.triggerAction = triggerAction;
M
Mupceet 已提交
2908
    accessibility.sendEvent(event).then((result) =>{
M
Mupceet 已提交
2909 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
        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 已提交
2945
    }).catch((err) => {
M
Mupceet 已提交
2946
        console.info(`AccessibleSendEvent: SendEvent_triggerAction_constructor_0180 has error: ${err}`);
Y
yichengzhao 已提交
2947
        expect(err).assertEqual(undefined);
M
Mupceet 已提交
2948
        done();
Y
yichengzhao 已提交
2949 2950 2951 2952 2953 2954 2955
    });
  })

  /*
    * @tc.number  SendEvent_textMoveUnit_0010
    * @tc.name    SendEvent_textMoveUnit_0010
    * @tc.desc    The textMoveUnit of EventInfo is 'char', test sendEvent() function
Y
yichengzhao 已提交
2956
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969
    * @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 已提交
2970 2971
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
2972 2973 2974 2975 2976 2977 2978
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0010 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
2979 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
  /*
    * @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 已提交
3012 3013 3014 3015
  /*
    * @tc.number  SendEvent_textMoveUnit_0020
    * @tc.name    SendEvent_textMoveUnit_0020
    * @tc.desc    The textMoveUnit of EventInfo is 'word', test sendEvent() function
Y
yichengzhao 已提交
3016
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029
    * @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 已提交
3030 3031
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3032 3033 3034 3035 3036 3037 3038
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0020 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

M
Mupceet 已提交
3039 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
  /*
    * @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 已提交
3072 3073 3074 3075
  /*
    * @tc.number  SendEvent_textMoveUnit_0030
    * @tc.name    SendEvent_textMoveUnit_0030
    * @tc.desc    The textMoveUnit of EventInfo is 'line', test sendEvent() function
Y
yichengzhao 已提交
3076
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089
    * @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 已提交
3090 3091
      expect(result).assertEqual(undefined);
      done();
Y
yichengzhao 已提交
3092 3093 3094 3095 3096 3097 3098 3099
    }).catch(err => {
      console.error(`AccessibleSendEvent: SendEvent_textMoveUnit_0030 has error: ${err}`);
      expect(null).assertFail();
      done();
    });
  })

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /*
M
Mupceet 已提交
3400 3401 3402
    * @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 已提交
3403
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3404 3405
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3406 3407 3408
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3409 3410
  it('SendEvent_contents_constructor_0010', 0, async function (done) {
    console.info(`AccessibleSendEvent: SendEvent_contents_constructor_0010 starts`);
Y
yichengzhao 已提交
3411

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  /*
M
Mupceet 已提交
3640 3641 3642
    * @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 已提交
3643
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3644 3645
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3646 3647 3648
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660
  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 已提交
3661 3662

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

M
Mupceet 已提交
3672

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

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

  /*
M
Mupceet 已提交
3701 3702 3703
    * @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 已提交
3704
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3705 3706
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3707 3708 3709
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721
  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 已提交
3722 3723

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

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

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

  /*
M
Mupceet 已提交
3761 3762 3763
    * @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 已提交
3764
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3765 3766
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3767 3768 3769
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781
  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 已提交
3782 3783

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

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

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

  /*
M
Mupceet 已提交
3821 3822 3823
    * @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 已提交
3824
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
3825 3826
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
3827 3828 3829
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841
  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 已提交
3842 3843

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

  /*
M
Mupceet 已提交
3854 3855 3856 3857 3858 3859 3860 3861 3862
      * @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 已提交
3863 3864

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

  /*
M
Mupceet 已提交
3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901
      * @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 已提交
3902 3903

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

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

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

  /*
M
Mupceet 已提交
3941 3942 3943
    * @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 已提交
3944
    *             The result of sendEvent() should be equal to a promise of undefined
Y
yichengzhao 已提交
3945 3946 3947
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959
  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 已提交
3960 3961

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

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

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

  /*
M
Mupceet 已提交
3999 4000 4001
    * @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 已提交
4002
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4003 4004
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4005 4006 4007
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019
  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 已提交
4020 4021

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

  /*
M
Mupceet 已提交
4032 4033 4034 4035 4036 4037 4038 4039 4040
      * @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 已提交
4041 4042

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

  /*
M
Mupceet 已提交
4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079
      * @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 已提交
4080 4081

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

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

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

  /*
M
Mupceet 已提交
4119 4120 4121
    * @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 已提交
4122
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4123 4124
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4125 4126 4127
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139
  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 已提交
4140 4141

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

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

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

  /*
M
Mupceet 已提交
4179 4180 4181
    * @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 已提交
4182
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4183 4184
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4185 4186 4187
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199
  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 已提交
4200 4201

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

  /*
M
Mupceet 已提交
4212 4213 4214 4215 4216 4217 4218 4219 4220
      * @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 已提交
4221 4222

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

  /*
M
Mupceet 已提交
4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259
      * @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 已提交
4260 4261

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

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

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

  /*
M
Mupceet 已提交
4299 4300 4301
    * @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 已提交
4302
    *             The result of sendEvent() should be equal to a promise of undefined
M
Mupceet 已提交
4303 4304
    *             Another test point is to test whether the modified constructor (EventInfo)
    *             works correctly.
Y
yichengzhao 已提交
4305 4306 4307
    * @tc.size    SmallTest
    * @tc.type    User
    */
M
Mupceet 已提交
4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319
  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 已提交
4320 4321

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

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

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

M
Mupceet 已提交
4358 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
    /*
    * @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 已提交
4390 4391
})