提交 e068ef4b 编写于 作者: 1 15829070344

【账号】测试套名称修改,遗留属性覆盖

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