!4018 【Sample】修复Cipher、StorageStatistic、Bluetooth、Wlan测试用例

Merge pull request !4018 from 张宏/0118
This commit is contained in:
openharmony_ci 2024-01-25 08:58:53 +00:00 committed by Gitee
commit 07263e0606
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
11 changed files with 37 additions and 24 deletions

View File

@ -72,9 +72,9 @@ export default function abilityTest() {
* 加密
*/
it(BUNDLE + 'EncryptionFunction_001', 0, async () => {
Logger.info(TAG, BUNDLE + 'EncryptionFunction_001 begin')
let driver = Driver.create()
await driver.delayMs(200)
Logger.info(TAG, BUNDLE + 'EncryptionFunction_001 begin');
let driver = Driver.create();
await driver.delayMs(1000);
// 点击加密按钮,跳转至加密页面
Logger.info(TAG, BUNDLE + 'EncryptionFunction_001 encryption')
await driver.assertComponentExist(ON.id('encryption'))

View File

@ -48,8 +48,8 @@ export default function appTest() {
await driver.delayMs(3000);
// 点击允许,应用获取设备位置
let resourceManager = ability.context.resourceManager;
await driver.assertComponentExist(ON.text(await resourceManager.getStringValue($r('app.string.agree'))));
let addBtn = await driver.findComponent(ON.text(await resourceManager.getStringValue($r('app.string.agree'))));
await driver.assertComponentExist(ON.text(await resourceManager.getStringValue($r('app.string.only_accept_during_use'))));
let addBtn = await driver.findComponent(ON.text(await resourceManager.getStringValue($r('app.string.only_accept_during_use'))));
await driver.delayMs(1000);
await addBtn.click();
await driver.delayMs(1000);

View File

@ -25,8 +25,8 @@
"value": "Match request"
},
{
"name": "agree",
"value": "agree"
"name": "only_accept_during_use",
"value": "only_accept_during_use"
}
]
}

View File

@ -13,8 +13,8 @@
"value": "Match request"
},
{
"name": "agree",
"value": "agree"
"name": "only_accept_during_use",
"value": "only_accept_during_use"
}
]
}

View File

@ -13,8 +13,8 @@
"value": "蓝牙配对请求"
},
{
"name": "agree",
"value": "允许"
"name": "only_accept_during_use",
"value": "仅使用期间允许"
}
]
}

View File

@ -5,7 +5,7 @@
|测试功能|预置条件|输入|预期输出|测试结果|
|--------------------------------|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
|拉起应用| 应用正常运行| |成功拉起应用|Pass|
|主页按钮点击| 位于主页| 点击允许按钮|弹窗消失,获取位置成功|Pass|
|主页按钮点击| 位于主页| 点击仅使用期间允许按钮|弹窗消失,获取位置成功|Pass|
|主页按钮点击| 位于主页| 点击打开蓝牙开关| 首页展示可用设备列表 |Pass|
|主页按钮点击| 位于主页| 点击相应的蓝牙地址| 会弹出匹配弹窗|Pass|
|主页按钮点击| 位于主页| 点击配对| 弹窗消失,配对成功|Pass|

View File

@ -55,15 +55,15 @@ export default function abilityTest() {
* 获取权限
*/
it(BUNDLE + 'RequestPermissionFunction_001', 0, async function () {
hilog.info(DOMAIN, TAG, BUNDLE + 'RequestPermissionFunction_001 begin')
let driver = Driver.create()
await driver.delayMs(2000)
hilog.info(DOMAIN, TAG, BUNDLE + 'RequestPermissionFunction_001 begin');
let driver = Driver.create();
await driver.delayMs(2000);
// 获取文件读写权限
hilog.info(DOMAIN, TAG, BUNDLE + 'RequestPermissionFunction requestPermission')
await driver.assertComponentExist(ON.text('允许'))
let btnStart = await driver.findComponent(ON.text('允许'))
await btnStart.click()
hilog.info(DOMAIN, TAG, BUNDLE + 'RequestPermissionFunction end')
hilog.info(DOMAIN, TAG, 'RequestPermissionFunction requestPermission');
await driver.assertComponentExist(ON.text(await getResourceString($r('app.string.only_accept_during_use'))));
let btnStart = await driver.findComponent(ON.text(await getResourceString($r('app.string.only_accept_during_use'))));
await btnStart.click();
hilog.info(DOMAIN, TAG, 'RequestPermissionFunction end');
})
/**
@ -120,10 +120,11 @@ export default function abilityTest() {
await driver.assertComponentExist(ON.id('input'))
let input = await driver.findComponent(ON.id('input'))
await input.inputText('456');
let sureBtn = await driver.findComponent(ON.id('sure'))
await sureBtn.click()
let sureBtn = await driver.findComponent(ON.id('sure'));
await sureBtn.click();
await driver.delayMs(1000);
// 是否弹出提示文本
await driver.assertComponentExist(ON.text('connecting'))
await driver.assertComponentExist(ON.text('connecting'));
})
})
}

View File

@ -19,6 +19,10 @@
{
"name": "encrypt",
"value": "encrypt"
},
{
"name": "only_accept_during_use",
"value": "only_accept_during_use"
}
]
}

View File

@ -19,6 +19,10 @@
{
"name": "encrypt",
"value": "encrypt"
},
{
"name": "only_accept_during_use",
"value": "only_accept_during_use"
}
]
}

View File

@ -19,6 +19,10 @@
{
"name": "encrypt",
"value": "加密"
},
{
"name": "only_accept_during_use",
"value": "仅使用期间允许"
}
]
}

View File

@ -51,7 +51,7 @@ export default function abilityTest() {
it('getPermission_001', 0, async () => {
Logger.info(TAG, BUNDLE + 'getPermission_001 begin');
await DRIVER.delayMs(1000);
await DRIVER.delayMs(2000);
await DRIVER.assertComponentExist(ON.text(await getResourceString($r('app.string.allow'))));
let allowBtn = await DRIVER.findComponent(ON.text(await getResourceString($r('app.string.allow'))));
await allowBtn.click();