提交 6873fe72 编写于 作者: Z zhaimengchao

【Account】【Master】Fix Testcase Decoupling

Signed-off-by: Nzhaimengchao <zhaimengchao@huawei.com>
上级 ac99f3f9
...@@ -20,6 +20,7 @@ const NAMELIMIT = 512; ...@@ -20,6 +20,7 @@ const NAMELIMIT = 512;
const LENGTHLIMIT = 1024; const LENGTHLIMIT = 1024;
const name = 'zhangsan' const name = 'zhangsan'
const owner = 'com.example.accountauthenticator' const owner = 'com.example.accountauthenticator'
const self_owner = 'com.example.actsaccountoperatetest'
const createAccountOptions = {customData:{age:'12'}} const createAccountOptions = {customData:{age:'12'}}
export default function ActsAccountAppAccess() { export default function ActsAccountAppAccess() {
describe('ActsAccountAuthenticator', function () { describe('ActsAccountAuthenticator', function () {
...@@ -46,7 +47,7 @@ export default function ActsAccountAppAccess() { ...@@ -46,7 +47,7 @@ export default function ActsAccountAppAccess() {
beforeEach(async (done)=>{ beforeEach(async (done)=>{
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
var accounts = await appAccountManager.getAccountsByOwner(owner) var accounts = await appAccountManager.getAccountsByOwner(self_owner)
for (var i=0;i<accounts.length;i++){ for (var i=0;i<accounts.length;i++){
var localName = accounts[i].name var localName = accounts[i].name
if(localName == 'zhangsan'){ if(localName == 'zhangsan'){
......
...@@ -20,6 +20,7 @@ const NAMELIMIT = 512; ...@@ -20,6 +20,7 @@ const NAMELIMIT = 512;
const LENGTHLIMIT = 1024; const LENGTHLIMIT = 1024;
const name = 'zhangsan' const name = 'zhangsan'
const owner = 'com.example.accountauthenticator' const owner = 'com.example.accountauthenticator'
const self_owner = 'com.example.actsaccounttest'
export default function ActsAccountAuthenticator() { export default function ActsAccountAuthenticator() {
describe('ActsAccountAuthenticator', function () { describe('ActsAccountAuthenticator', function () {
beforeAll(async function (done) { beforeAll(async function (done) {
...@@ -45,7 +46,7 @@ export default function ActsAccountAuthenticator() { ...@@ -45,7 +46,7 @@ export default function ActsAccountAuthenticator() {
beforeEach(async function (done) { beforeEach(async function (done) {
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
var appAccountManager = account.createAppAccountManager(); var appAccountManager = account.createAppAccountManager();
var accounts = await appAccountManager.getAccountsByOwner(owner) var accounts = await appAccountManager.getAccountsByOwner(self_owner)
for (var i=0;i<accounts.length;i++){ for (var i=0;i<accounts.length;i++){
var localName = accounts[i].name var localName = accounts[i].name
if(localName == 'zhangsan'){ if(localName == 'zhangsan'){
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -22,7 +22,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() { ...@@ -22,7 +22,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var accounts = await osAccountManager.queryAllCreatedOsAccounts() var accounts = await osAccountManager.queryAllCreatedOsAccounts()
for (i=0;i<accounts.length;i++){ for (let i=0;i<accounts.length;i++){
var localId = accounts[i].localId var localId = accounts[i].localId
if(localId!=100){ if(localId!=100){
await osAccountManager.removeOsAccount(localId) await osAccountManager.removeOsAccount(localId)
......
/* /*
* Copyright (c) 2021 Huawei Device Co., Ltd. * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -24,7 +24,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() { ...@@ -24,7 +24,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console.debug("====>afterEach start===="); console.debug("====>afterEach start====");
var osAccountManager = osaccount.getAccountManager(); var osAccountManager = osaccount.getAccountManager();
var accounts = await osAccountManager.queryAllCreatedOsAccounts() var accounts = await osAccountManager.queryAllCreatedOsAccounts()
for (i=0;i<accounts.length;i++){ for (let i=0;i<accounts.length;i++){
var localId = accounts[i].localId var localId = accounts[i].localId
if(localId!=100){ if(localId!=100){
await osAccountManager.removeOsAccount(localId) await osAccountManager.removeOsAccount(localId)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册