1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License") 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { Driver, ON } from '@ohos.UiTest'; 17import { beforeAll, describe, expect, it } from '@ohos/hypium'; 18import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; 19import { WantParams } from '../../../../main/ets/common/vm/Constants'; 20import Want from '@ohos.app.ability.Want'; 21 22const delegator = abilityDelegatorRegistry.getAbilityDelegator(); 23const bundleName = abilityDelegatorRegistry.getArguments().bundleName; 24 25const delayTime: number = 1000; 26 27export default function FaceMixSuccessLandscapeTest() { 28 describe('FaceMixSuccessLandscapeTest', () => { 29 beforeAll(async () => { 30 const data : WantParams = { 31 "cmd": [{ 32 "event": "CMD_NOTIFY_AUTH_START", 33 "payload": { 34 "lockoutDuration": 0, 35 "remainAttempts": 5, 36 "type": "pin", 37 "result": 0 38 }, 39 }, { 40 "event": "CMD_NOTIFY_AUTH_START", 41 "payload": { 42 "lockoutDuration": 0, 43 "remainAttempts": 5, 44 "type": "face", 45 "result": 0 46 }, 47 }, { 48 "event": "CMD_NOTIFY_AUTH_START", 49 "payload": { 50 "lockoutDuration": 0, 51 "remainAttempts": 5, 52 "sensorInfo": "{\"sensorType\":\"SensorType1\",\"udSensorCenterXInThousandth\":500,\"udSensorCenterYInThousandth\":500,\"udSensorRadiusInPx\":30}", 53 "type": "fingerprint", 54 "result": 0 55 }, 56 }, { 57 "event": "CMD_NOTIFY_AUTH_START", 58 "payload": { 59 "lockoutDuration": 0, 60 "remainAttempts": 5, 61 "type": "test", 62 "result": 0 63 }, 64 }], 65 "pinSubType": "PIN_SIX", 66 "title": "", 67 "type": ["pin", "face", "fingerprint"], 68 "widgetContextId": 7728484037972500000, 69 "windowModeType": "DIALOG_BOX" 70 } 71 72 let want: Want = { 73 bundleName: bundleName, 74 abilityName: 'FaceMixSuccessLandscapeAbility', 75 parameters: { 76 useriamCmdData: data 77 } 78 } 79 await delegator.startAbility(want); 80 AppStorage.SetOrCreate('IS_LANDSCAPE', true); 81 }) 82 83 it('faceMixSuccessLandscape_test', 0, async (done: Function) => { 84 let driver = Driver.create(); 85 await driver.delayMs(delayTime); 86 await driver.findComponent(ON.id('cancelBtnFaceAuth')); 87 expect(true).assertTrue(); 88 done(); 89 }) 90 }) 91}