提交 d34b8c24 编写于 作者: 1 15829070344 提交者: 何海涛

fixed e068ef4b from https://gitee.com/murphy1984/acts/pulls/6243

【账号】测试套名称修改,遗留属性覆盖
Signed-off-by: N15829070344 <hehaitao5@huawei.com>
Change-Id: I0f9a09f359ecfc1f15c7a47d6b8fe0203dca1a57
上级 32ccfe60
......@@ -50,6 +50,18 @@ export default function ActsAccountAppAccess() {
await sleep(1500)
done();
});
beforeEach(async (done)=>{
console.debug("====>afterEach start====");
var appAccountManager = account.getAccountManager();
var accounts = await appAccountManager.getAllAccountByOwner(owner)
for (i=0;i<accounts.length;i++){
var localName = accounts[i].name
if(localName == 'zhangsan'){
await appAccountManager.removeAccount(localName)
}
}
done();
})
/*
* @tc.number : ActsAccountCheckAccountLabels_0100
* @tc.name : Check Account Labels callback form
......@@ -347,37 +359,37 @@ export default function ActsAccountAppAccess() {
/*
* @tc.number : ActsAccountDeleteAccountCredential_0100
* @tc.number : ActsAccountDeleteCredential_0100
* @tc.name : Delete Account Credential callback form
* @tc.desc :
*/
it('ActsAccountDeleteAccountCredential_0100', 0, async function (done) {
console.debug("====>ActsAccountDeleteAccountCredential_0100 start====");
it('ActsAccountDeleteCredential_0100', 0, async function (done) {
console.debug("====>ActsAccountDeleteCredential_0100 start====");
var appAccountManager = account.createAppAccountManager();
console.debug("====>start finish====");
appAccountManager.createAccount(name, (err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 add_account_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 add_account_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.setCredential(name, "PIN", "credential1", (err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 setAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 setAccountCredential_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
appAccountManager.getCredential(name, "PIN", (err, data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 getAccountCredential_err:" + JSON.stringify(err))
console.debug("====>ActsAccountDeleteCredential_0100 getAccountCredential_err:" + JSON.stringify(err))
expect(err).assertEqual(null);
console.debug("====>ActsAccountDeleteAccountCredential_0100 getAccountCredential_success:" + JSON.stringify(data));
appAccountManager.deleteAccountCredential(name, "PIN", (err, data)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0100 deleteAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0100 getAccountCredential_success:" + JSON.stringify(data));
appAccountManager.deleteCredential(name, "PIN", (err, data)=>{
console.debug("====>ActsAccountDeleteCredential_0100 deleteCredential_err:" + JSON.stringify(err));
expect(err).assertEqual(null);
expect(data).assertEqual(undefined);
console.debug("====>ActsAccountDeleteAccountCredential_0100 deleteAccountCredential_data:" + JSON.stringify(data));
console.debug("====>ActsAccountDeleteCredential_0100 deleteCredential_data:" + JSON.stringify(data));
expect(data).assertEqual(null);
try{
appAccountManager.removeAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0100 removeAccount_success')
console.debug('====>ActsAccountDeleteCredential_0100 removeAccount_success')
done();
}
catch{
console.debug('====>ActsAccountDeleteAccountCredential_0100 removeAccount_err')
console.debug('====>ActsAccountDeleteCredential_0100 removeAccount_err')
expect().assertFail()
done();
}
......@@ -388,48 +400,48 @@ export default function ActsAccountAppAccess() {
});
/*
* @tc.number : ActsAccountDeleteAccountCredential_0200
* @tc.number : ActsAccountDeleteCredential_0200
* @tc.name : Delete Account Credential promise form
* @tc.desc :
*/
it('ActsAccountDeleteAccountCredential_0200', 0, async function (done) {
console.debug("====>ActsAccountDeleteAccountCredential_0200 start====");
it('ActsAccountDeleteCredential_0200', 0, async function (done) {
console.debug("====>ActsAccountDeleteCredential_0200 start====");
var appAccountManager = account.createAppAccountManager();
appAccountManager.createAccount(name, createAccountOptions).then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 add_account_success");
console.debug("====>ActsAccountDeleteCredential_0200 add_account_success");
appAccountManager.setCredential(name, "PIN", "credential2").then(() =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 setAccountCredential_success");
console.debug("====>ActsAccountDeleteCredential_0200 setAccountCredential_success");
appAccountManager.getCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_data:" + JSON.stringify(data));
appAccountManager.deleteAccountCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 data:" + JSON.stringify(data));
console.debug("====>ActsAccountDeleteCredential_0200 getAccountCredential_data:" + JSON.stringify(data));
appAccountManager.deleteCredential(name, "PIN").then((data) =>{
console.debug("====>ActsAccountDeleteCredential_0200 data:" + JSON.stringify(data));
try{
appAccountManager.removeAccount(name)
console.debug('====>ActsAccountDeleteAccountCredential_0200 removeAccount_success')
console.debug('====>ActsAccountDeleteCredential_0200 removeAccount_success')
done();
}
catch{
console.debug('====>ActsAccountDeleteAccountCredential_0200 removeAccount_err')
console.debug('====>ActsAccountDeleteCredential_0200 removeAccount_err')
expect().assertFail()
}
}).catch((err) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err)=>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 getAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 getAccountCredential_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err) =>{
console.debug("====>ActsAccountDeleteAccountCredential_0200 setAccountCredential_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 setAccountCredential_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
}).catch((err) => {
console.debug("====>ActsAccountDeleteAccountCredential_0200 createAccount_err:" + JSON.stringify(err));
console.debug("====>ActsAccountDeleteCredential_0200 createAccount_err:" + JSON.stringify(err));
expect().assertFail();
done();
})
......@@ -702,7 +714,7 @@ export default function ActsAccountAppAccess() {
it('ActsAccountCreateAccountImplicitly_0100', 0, async function (done) {
console.debug("====>ActsAccountCreateAccountImplicitly_0100 start====");
var appAccountManager = account.createAppAccountManager();
var options = {authType: "PIN"}
var options = {authType: "PIN", requiredLabels:['male', '30-40'], parameters: ['sex', 'age']}
console.debug("====>start finish====");
appAccountManager.createAccountImplicitly("com.example.accountauthenticator", options, {
onResult: async (resultCode, resultData)=>{
......
......@@ -17,8 +17,8 @@ group("getallaccounts") {
testonly = true
if (is_standard_system) {
deps = [
"getallaccountsnoparameter:GetAllAccountsNoParameter",
"getmultipleaccounts:GetMultipleAccountsTest",
"actsgetallaccountsnoparameter:ActsGetAllAccountsNoParameter",
"actsgetmultipleaccounts:ActsGetMultipleAccountsTest",
]
}
}
......@@ -13,14 +13,14 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("GetMultipleAccountsTest") {
ohos_js_hap_suite("ActsGetAllAccountsNoParameter") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "GetMultipleAccountsTest"
hap_name = "ActsGetAllAccountsNoParameter"
subsystem_name = "account"
part_name = "os_account"
}
......
......@@ -10,7 +10,7 @@
"kits": [
{
"test-file-name": [
"GetAllAccountsNoParameter.hap",
"ActsGetAllAccountsNoParameter.hap",
"ActsAccountSceneAccessible.hap"
],
"type": "AppInstallKit",
......
......@@ -13,14 +13,14 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("GetAllAccountsNoParameter") {
ohos_js_hap_suite("ActsGetMultipleAccountsTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "GetAllAccountsNoParameter"
hap_name = "ActsGetMultipleAccountsTest"
subsystem_name = "account"
part_name = "os_account"
}
......
......@@ -10,7 +10,7 @@
"kits": [
{
"test-file-name": [
"GetMultipleAccountsTest.hap",
"ActsGetMultipleAccountsTest.hap",
"ActsAccountAccessibleFirst.hap",
"ActsAccountAccessibleSecond.hap"
],
......
......@@ -14,7 +14,6 @@
*/
import account from '@ohos.account.appAccount'
import featureAbility from '@ohos.ability.featureAbility'
import app from '../../../../../../../../../getallaccounts/getallaccountsnoparameter/src/main/js/TestAbility/app'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册