未验证 提交 86f3ea1f 编写于 作者: O openharmony_ci 提交者: Gitee

!9902 【Account】【Master】Testcase optimization and decoupling

Merge pull request !9902 from zhaimengchao/master
......@@ -20,6 +20,7 @@ const NAMELIMIT = 512;
const LENGTHLIMIT = 1024;
const name = 'zhangsan'
const owner = 'com.example.accountauthenticator'
const self_owner = 'com.example.actsaccountoperatetest'
const createAccountOptions = {customData:{age:'12'}}
export default function ActsAccountAppAccess() {
describe('ActsAccountAuthenticator', function () {
......@@ -46,7 +47,7 @@ export default function ActsAccountAppAccess() {
beforeEach(async (done)=>{
console.debug("====>afterEach start====");
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++){
var localName = accounts[i].name
if(localName == 'zhangsan'){
......
......@@ -20,6 +20,7 @@ const NAMELIMIT = 512;
const LENGTHLIMIT = 1024;
const name = 'zhangsan'
const owner = 'com.example.accountauthenticator'
const self_owner = 'com.example.actsaccounttest'
export default function ActsAccountAuthenticator() {
describe('ActsAccountAuthenticator', function () {
beforeAll(async function (done) {
......@@ -45,7 +46,7 @@ export default function ActsAccountAuthenticator() {
beforeEach(async function (done) {
console.debug("====>afterEach start====");
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++){
var localName = accounts[i].name
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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -22,7 +22,7 @@ export default function ActsOsAccountThirdPartyTest_third_2() {
console.debug("====>afterEach start====");
var osAccountManager = osaccount.getAccountManager();
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
if(localId!=100){
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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -24,7 +24,7 @@ export default function ActsOsAccountThirdPartyTest_third_4() {
console.debug("====>afterEach start====");
var osAccountManager = osaccount.getAccountManager();
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
if(localId!=100){
await osAccountManager.removeOsAccount(localId)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册