提交 d11cea20 编写于 作者: 华华小仙女

Merge branch 'master' of https://gitee.com/huahua-fairy/xts_acts

......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent"
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import commonEvent from "@ohos.commonEvent"
......
......@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
......
......@@ -13,39 +13,39 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
/**
* @tc.number: ACTS_AACommand_printSync_0100
* @tc.number: ACTS_AACommand_printSync_01_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The printSync information includes Chinese, special characters, etc.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_printSync_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 start ====> " )
it('ACTS_AACommand_printSync_01_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_01_0100 start ====> " )
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0100 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0100 end'
console.log("ACTS_AACommand_printSync_01_0100 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01_0100 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then((data)=>{
console.log("ACTS_AACommand_printSync_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_0100 finishTest test end " +
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0100 finishTest test end " +
"========> callback data: "+JSON.stringify(data))
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0200
* @tc.number: ACTS_AACommand_printSync_01_0200
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* The length of the printSync message is 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_printSync_0200', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0200', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
......@@ -58,22 +58,22 @@ export default function abilityTest() {
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0200 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0200 end'
console.log("ACTS_AACommand_printSync_01_0200 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01_0200 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0200 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0200 print test end ========> callback " )
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0300
* @tc.number: ACTS_AACommand_printSync_01_0300
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
* The length of the printSync message is greater than 1000 characters.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_printSync_0300', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0300', 0, async function (done) {
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
......@@ -87,27 +87,27 @@ export default function abilityTest() {
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae' +
'fffffffffff'
globalThis.abilityDelegator.printSync(msg);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0300 end'
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01_0300 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0300 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0300 print test end ========> callback " )
done()
})
})
/**
* @tc.number: ACTS_AACommand_printSync_0400
* @tc.number: ACTS_AACommand_printSync_01_0400
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid,
* printSync information is null.
* @tc.desc: Verify that the test framework can be started normally and the logs can be output normally through
* the test command.
*/
it('ACTS_AACommand_printSync_0400', 0, async function (done) {
it('ACTS_AACommand_printSync_01_0400', 0, async function (done) {
globalThis.abilityDelegator.printSync(null);
console.log("ACTS_AACommand_printSync_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_0400 end'
console.log("ACTS_AACommand_printSync_01_0300 printSync end ====> " )
var finishmsg = 'ACTS_AACommand_printSync_01_0400 end'
globalThis.abilityDelegator.finishTest(finishmsg, 1).then(()=>{
console.log("ACTS_AACommand_printSync_0400 print test end ========> callback " )
console.log("ACTS_AACommand_printSync_01_0400 print test end ========> callback " )
done()
})
})
......
......@@ -14,20 +14,11 @@
*/
import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
globalThis.abilityContext = this.context;
console.log('MainAbility onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
......@@ -36,7 +27,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
windowStage.setUIContent(this.context, 'pages/index', null)
}
......
/*
* Copyright (c) 2022 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
......@@ -13,17 +13,103 @@
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
let cmd: any
let abilityDelegatorArguments: any
let abilityDelegator: any
function sleep(delay) {
let start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
}
}
function test(time) {
sleep(time);
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0100 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0100 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0100 stdResult = ' + data.stdResult)
globalThis.stdResult1 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0100 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0200 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0200 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0200 stdResult = ' + data.stdResult)
globalThis.stdResult2 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0200 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0300 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0300 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0300 stdResult = ' + data.stdResult)
globalThis.stdResult3 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0300 - executeShellCommand: end ')
})
test(3000)
cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_01_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_01_0400 start err: ' + JSON.stringify(err))
console.log('ACTS_AACommand_printSync_01_0400 stdResult = ' + data.stdResult)
globalThis.stdResult4 = data.stdResult;
console.log('ACTS_AACommand_printSync_01_0400 - executeShellCommand: end ')
})
test(3000)
setTimeout(() => {
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, 15000)
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
}
.width('100%')
}
......
......@@ -14,21 +14,10 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import appManager from '@ohos.application.appManager';
const DELAY = 3000
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
let msg: any
export default function abilityTest() {
describe('ActsAbilityTest', function () {
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
function checkRunningProcess(name, dataInfo) {
for (let i = 0, len = dataInfo.length; i < len; i++) {
if (dataInfo[i].processName == name) {
return true;
}
}
return false;
}
/**
* @tc.number: ACTS_AACommand_printSync_0100
* @tc.name: The -b, -p, -s, -w and other parameters of the test command are valid
......@@ -37,27 +26,10 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0100', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0100 --- start")
var cmd = 'aa test -b com.example.aacommandprintsync -m entry_test -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0100 -s unittest OpenHarmonyTestRunner'
var msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0100 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0100 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0100 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0100 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0100====>infores = " + infores)
expect(infores==false).assertEqual(true);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0100 --- start')
msg = '测试日志!@#$%^&*()_+QWE{}|?><Fafq3146'
expect(globalThis.stdResult1).assertContain(msg)
done()
})
/**
......@@ -68,37 +40,20 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0200', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0200 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0200 -s unittest OpenHarmonyTestRunner'
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0200 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0200 query string i = ' + i);
expect(i == -1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0200 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0200 getProcessRunningInfos ======> ' +
'' + JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0200====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0200 --- start')
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult2).assertContain(msg);
done();
})
/**
......@@ -109,41 +64,21 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0300', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0300 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0300 -s unittest OpenHarmonyTestRunner'
var msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
var msgcopy = 'fffffffffff'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0300 stdResult = ' + data.stdResult)
var i = data.stdResult.indexOf(msg);
console.log('ACTS_AACommand_printSync_0300 query string i = ' + i);
expect(i == -1).assertEqual(false);
var j = data.stdResult.indexOf(msgcopy);
console.log('ACTS_AACommand_printSync_0300 === query string j = ' + j);
expect(j == -1).assertEqual(true);
console.log('ACTS_AACommand_printSync_0300 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0300 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0300====>infores = " + infores)
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0300 --- start')
msg = '0callbackaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaa' +
'1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae'
expect(globalThis.stdResult3).assertContain(msg);
done()
})
/**
......@@ -154,24 +89,10 @@ export default function abilityTest() {
* the test command.
*/
it('ACTS_AACommand_printSync_0400', 0, async function (done) {
console.log("ACTS_AACommand_printSync_0400 --- start")
var cmd = 'aa test -m entry_test -b com.example.aacommandprintsync -s class ' +
'ACTS_AACommand_01_3#ACTS_AACommand_printSync_0400 -s unittest OpenHarmonyTestRunner'
globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: start ')
console.log('ACTS_AACommand_printSync_0400 stdResult = ' + data.stdResult)
expect(data.stdResult.indexOf('start ability successfully')==-1).assertEqual(false);
console.log('ACTS_AACommand_printSync_0400 - executeShellCommand: end')
})
setTimeout(async() => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_AACommand_printSync_0400 getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess('com.example.aacommandprintsync', procrssinfo)
console.log("====>ACTS_AACommand_printSync_0400====>infores = ")
expect(infores).assertEqual(false);
done();
}, DELAY )
console.log('ACTS_AACommand_printSync_0400 --- start')
msg = 'start ability successfully';
expect(globalThis.stdResult4).assertContain(msg);
done();
})
})
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
......
......@@ -15,7 +15,7 @@
import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
export default function abilityTest() {
describe('ACTS_AACommand_01_3', function () {
......
......@@ -14,19 +14,10 @@
*/
import Ability from '@ohos.application.Ability'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log('MainAbility onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
onDestroy() {
......@@ -35,7 +26,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
windowStage.setUIContent(this.context, 'pages/index', null)
globalThis.abilityContext = this.context;
}
......
/*
* Copyright (c) 2022 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ export default function ActsAmsCallBackFirstScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -86,6 +86,7 @@ export default function ActsAmsCallBackFourthScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -52,6 +52,7 @@ export default function ActsAmsCallBackSecondScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -52,6 +52,7 @@ export default function ActsAmsCallBackThirdScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -106,6 +106,7 @@ export default function ActsAmsTestFifthScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -40,6 +40,7 @@ export default function ActsAmsTestFirstScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -106,6 +106,7 @@ export default function ActsAmsTestFourthScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -62,6 +62,7 @@ export default function ActsAmsTestSecondScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -63,6 +63,7 @@ export default function ActsAmsTestThirdScene() {
' + error.code + ', data length [' + data.length + ']');
}
);
sleep(500);
done();
});
......
......@@ -16,7 +16,7 @@ import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function PublishCallBackOne() {
console.debug("====>Publish CallBack ACTS_StartAbility_0100_CommonEvent====>");
globalThis.abilityContext.terminateSelf().then(()=>{
globalThis.abilityContext2.terminateSelf().then(()=>{
commonEvent.publish("ACTS_TerminateSelf_CommonEvent", PublishCallBackTwo);
console.debug("====>publish ACTS_TerminateSelf_CommonEvent finish====>")
});
......@@ -40,7 +40,7 @@ export default class MainAbility2 extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility2 onWindowStageCreate")
globalThis.abilityContext = this.context
globalThis.abilityContext2 = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/second", null)
commonEvent.publish("ACTS_InterfaceMultiUsers_0100_Start_CommonEvent", PublishCallBackOne);
}
......
......@@ -28,9 +28,9 @@ export default class MainAbility3 extends Ability {
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.log("MainAbility3 onWindowStageCreate")
globalThis.abilityContext = this.context
globalThis.abilityContext3 = this.context
windowStage.setUIContent(this.context, "MainAbility/pages/index/second", null)
globalThis.abilityContext.terminateSelfWithResult(
globalThis.abilityContext3.terminateSelfWithResult(
{
resultCode:1,
want:{
......
......@@ -44,35 +44,33 @@ export default function killProcessWithAccountTest() {
beforeEach(async (done) => {
console.log('======>beforeEach killProcessWithAccountTest<=======');
console.log('======>beforeEach killProcessWithAccountTest<=======' + flag);
if(flag == false){
setTimeout(()=>{
globalThis.abilityContext.startAbilityWithAccount(
setTimeout(async ()=>{
await globalThis.abilityContext.startAbilityWithAccount(
{
bundleName: 'com.acts.killprocesswithaccountpackage',
abilityName: 'com.acts.killprocesswithaccountpackage.MainAbility'
}, ACCOUNT_ID,
{
windowMode: 2,
displayId: 1
}).then(() => {
}, ACCOUNT_ID).then(() => {
console.log(" ====>ACTS_KillProcessWithAccount startability ====> success! ")
done();
}).catch((error) => {
console.log(" ====>ACTS_KillProcessWithAccount startability ====> error: " + JSON.stringify(error))
})
sleep(500);
done();
},1000)
}else{
globalThis.abilityContext.startAbilityWithAccount(
await globalThis.abilityContext.startAbilityWithAccount(
{
bundleName: 'com.acts.killprocesswithaccountpackage',
abilityName: 'com.acts.killprocesswithaccountpackage.MainAbility'
}, ACCOUNT_ID,
{
windowMode: 2,
displayId: 1
}).then(() => {
}, ACCOUNT_ID).then(() => {
console.log(" ====>ACTS_KillProcessWithAccount startability ====> success! ")
done();
}).catch((error) => {
console.log(" ====>ACTS_KillProcessWithAccount startability ====> error: " + JSON.stringify(error))
})
sleep(500);
done();
}
})
......
......@@ -494,12 +494,12 @@ export default function lifecycleTest() {
expect(exlist[0]).assertEqual("MainAbility5 onAbilityCreate");
expect(exlist[1]).assertEqual("MainAbility5 onWindowStageCreate");
expect(exlist[2]).assertEqual("MainAbility5 onAbilityForeground");
expect(exlist[3]).assertEqual("MainAbility2 onAbilityCreate");
expect(exlist[4]).assertEqual("MainAbility2 onWindowStageCreate");
expect(exlist[5]).assertEqual("MainAbility2 onAbilityForeground");
expect(exlist[6]).assertEqual("MainAbility5 onAbilityBackground");
expect(exlist[7]).assertEqual("MainAbility5 onWindowStageDestroy");
expect(exlist[8]).assertEqual("MainAbility5 onAbilityDestroy");
expect(exlist[3]).assertEqual("MainAbility5 onAbilityBackground");
expect(exlist[4]).assertEqual("MainAbility5 onWindowStageDestroy");
expect(exlist[5]).assertEqual("MainAbility5 onAbilityDestroy");
expect(exlist[6]).assertEqual("MainAbility2 onAbilityCreate");
expect(exlist[7]).assertEqual("MainAbility2 onWindowStageCreate");
expect(exlist[8]).assertEqual("MainAbility2 onAbilityForeground");
expect(exlist[9]).assertEqual("MainAbility2 onAbilityBackground");
expect(exlist[10]).assertEqual("MainAbility2 onWindowStageDestroy");
expect(exlist[11]).assertEqual("MainAbility2 onAbilityDestroy");
......
......@@ -730,12 +730,20 @@ export default function UiTest() {
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode1 = await window1.getWindowMode()
expect(mode1 == WindowMode.FULLSCREEN).assertTrue()
await window1.resume()
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode2 = await window2.getWindowMode()
expect(mode2 == WindowMode.FLOATING).assertTrue()
await window2.resume()
await stopApplication('com.uitestScene.acts')
try {
await window1.resume()
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode2 = await window2.getWindowMode()
expect(mode2 == WindowMode.FLOATING).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window1 != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......@@ -778,16 +786,25 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds1 = await window1.getBounds()
await window1.moveTo(100,100)
await driver.delayMs(waitUiReadyMs)
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds2 = await window2.getBounds()
expect(bounds1 != bounds2).assertTrue()
await stopApplication('com.uitestScene.acts')
try{
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds1 = await window1.getBounds()
await window1.moveTo(100,100)
await driver.delayMs(waitUiReadyMs)
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds2 = await window2.getBounds()
expect(bounds1 != bounds2).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......@@ -800,31 +817,40 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds1 = await window1.getBounds()
await window1.resize(600,600,ResizeDirection.RIGHT_DOWN)
await driver.delayMs(waitUiReadyMs)
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds2 = await window2.getBounds()
expect(bounds2 != bounds1).assertTrue()
await window2.resize(400,400,ResizeDirection.RIGHT_UP)
let window3 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds3= await window3.getBounds()
expect(bounds3 != bounds2).assertTrue()
await window3.resize(300,300,ResizeDirection.LEFT_DOWN)
let window4 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds4= await window4.getBounds()
expect(bounds4 != bounds3).assertTrue()
await window4.resize(500,500,ResizeDirection.LEFT_UP)
let window5 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds5= await window5.getBounds()
expect(bounds5 != bounds4).assertTrue()
await stopApplication('com.uitestScene.acts')
try{
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds1 = await window1.getBounds()
await window1.resize(600,600,ResizeDirection.RIGHT_DOWN)
await driver.delayMs(waitUiReadyMs)
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds2 = await window2.getBounds()
expect(bounds2 != bounds1).assertTrue()
await window2.resize(400,400,ResizeDirection.RIGHT_UP)
let window3 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds3= await window3.getBounds()
expect(bounds3 != bounds2).assertTrue()
await window3.resize(300,300,ResizeDirection.LEFT_DOWN)
let window4 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds4= await window4.getBounds()
expect(bounds4 != bounds3).assertTrue()
await window4.resize(500,500,ResizeDirection.LEFT_UP)
let window5 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds5= await window5.getBounds()
expect(bounds5 != bounds4).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
it('testWindowResizeB', 0, async function () {
......@@ -832,32 +858,41 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window5 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds5= await window5.getBounds()
await window5.resize(bounds5.rightX - bounds5.leftX,300,ResizeDirection.DOWN)
let window6 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds6= await window6.getBounds()
expect(bounds6 != bounds5).assertTrue()
await window6.resize(bounds6.rightX - bounds6.leftX,500,ResizeDirection.UP)
let window7 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds7 = await window7.getBounds()
expect(bounds7 != bounds6).assertTrue()
await window7.resize(300,bounds7.bottomY - bounds7.topY,ResizeDirection.LEFT)
let window8 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds8 = await window8.getBounds()
expect(bounds8 != bounds7).assertTrue()
await window8.resize(500,bounds8.bottomY - bounds8.topY,ResizeDirection.RIGHT)
let window9 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds9 = await window9.getBounds()
expect(bounds9 != bounds8).assertTrue()
await stopApplication('com.uitestScene.acts')
try{
await window.resume()
await driver.delayMs(waitUiReadyMs)
let window5 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds5= await window5.getBounds()
await window5.resize(bounds5.rightX - bounds5.leftX,300,ResizeDirection.DOWN)
let window6 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds6= await window6.getBounds()
expect(bounds6 != bounds5).assertTrue()
await window6.resize(bounds6.rightX - bounds6.leftX,500,ResizeDirection.UP)
let window7 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds7 = await window7.getBounds()
expect(bounds7 != bounds6).assertTrue()
await window7.resize(300,bounds7.bottomY - bounds7.topY,ResizeDirection.LEFT)
let window8 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds8 = await window8.getBounds()
expect(bounds8 != bounds7).assertTrue()
await window8.resize(500,bounds8.bottomY - bounds8.topY,ResizeDirection.RIGHT)
let window9 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let bounds9 = await window9.getBounds()
expect(bounds9 != bounds8).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......@@ -886,14 +921,23 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window.resume()
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window2.maximize()
await driver.delayMs(waitUiReadyMs)
let window3 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode = await window3.getWindowMode()
expect(mode == WindowMode.FULLSCREEN).assertTrue()
await stopApplication('com.uitestScene.acts')
try{
await window.resume()
let window2 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window2.maximize()
await driver.delayMs(waitUiReadyMs)
let window3 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
let mode = await window3.getWindowMode()
expect(mode == WindowMode.FULLSCREEN).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......@@ -906,11 +950,20 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
try{
await window.minimize()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
expect(window1 == null).assertTrue()
await stopApplication('com.uitestScene.acts')
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
expect(window1 == null).assertTrue()
await stopApplication('com.uitestScene.acts')
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......@@ -923,11 +976,19 @@ export default function UiTest() {
let driver = UiDriver.create()
await driver.delayMs(waitUiReadyMs)
let window = await driver.findWindow({bundleName:'com.uitestScene.acts'})
await window.close()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
expect(window1 == null).assertTrue()
await stopApplication('com.uitestScene.acts')
try{
await window.close()
await driver.delayMs(waitUiReadyMs)
let window1 = await driver.findWindow({bundleName:'com.uitestScene.acts'})
expect(window1 == null).assertTrue()
}
catch (err) {
if (err.message == 'this device can not support this action') {
expect(window != null).assertTrue()
} else {
expect(false).assertTrue()
}
}
})
/*
......
......@@ -23,7 +23,7 @@ export default function inputMethodJSUnit() {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod((arr) => {
console.info("inputmethoh_test_001 listInputMethod result---" + JSON.stringify(arr));
console.info("appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue();
});
done();
......@@ -32,17 +32,19 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.listInputMethod();
console.info("inputmethoh_test_002 listInputMethod result---" + JSON.stringify(promise));
if (promise.length > 0){
let obj = promise[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
except().assertFail()
}
inputMethodSetting.listInputMethod().then(inputMethodProperty => {
if (inputMethodProperty.length > 0){
let obj = inputMethodProperty[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
expect().assertFail()
}
}).catch(err => {
console.info("inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
});
done();
});
......@@ -58,9 +60,13 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.displayOptionalInputMethod();
console.info("inputmethoh_test_004 displayOptionalInputMethod result---" + JSON.stringify(promise));
expect(promise).assertEqual(undefined)
inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue()
}).catch(err => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
});
......@@ -76,9 +82,13 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
let promise = inputMethodCtrl.stopInput();
console.info("inputmethoh_test_006 inputMethodCtrl stopInput result---" + JSON.stringify(promise));
expect(promise).assertEqual(true)
inputMethodCtrl.stopInput().then(data => {
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue()
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
});
......@@ -96,6 +106,29 @@ export default function inputMethodJSUnit() {
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_001
* @tc.name Test Indicates the input method which will replace the current one.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
}).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
})
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_002
* @tc.name Test Indicates the input method which will replace the current one.
......@@ -119,5 +152,77 @@ export default function inputMethodJSUnit() {
console.info("************* inputmethod_test_switchInputMethod_002 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with calback.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((data)=>{
if(data == undefined){
console.info("showSoftKeyboard callbace success" );
}else{
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
}
});
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with Promise.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{
console.info("showSoftKeyboard promise success" );
}).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
})
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will hide softboard with calback.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((data)=>{
if(data == undefined){
console.info("hideSoftKeyboard callbace success" );
}else{
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
}
});
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will hide softboard with Promise.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
console.info("hideSoftKeyboard promise success" );
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
})
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
});
})
}
......@@ -32,6 +32,7 @@ group("multimedia") {
"image/image_js_standard/imageModifyProperty:image_modifyProperty_js_hap",
"image/image_js_standard/imagePacking:image_packing_js_hap",
"image/image_js_standard/imagePixelMapFramework:image_pixelmapframework_js_hap",
"image/image_js_standard/imageRGBA:image_rgba_js_hap",
"image/image_js_standard/imageReceiver:image_receiver_js_hap",
"image/image_js_standard/imageWebp:image_webp_js_hap",
"image/image_js_standard/imageYUV:image_yuv_js_hap",
......
# Copyright (C) 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_rgba_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_rgba_js_assets",
":image_rgba_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageRGBAJsTest"
}
ohos_js_assets("image_rgba_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_rgba_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.multimedia.image.RGBA",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageRGBAJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
]
},
{
"type": "ShellKit",
"run-command": [
"hilog -Q pidoff",
"hilog -b D"
],
"teardown-command":[
]
}
]
}
\ No newline at end of file
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.RGBA",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.RGBA.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.RGBA.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name": "ohos.permission.MEDIA_LOCATION",
"reason":"use ohos.permission.MEDIA_LOCATION"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason":"use ohos.permission.READ_MEDIA"
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason":"use ohos.permission.WRITE_MEDIA"
}
],
"package": "ohos.acts.multimedia.image.RGBA",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core, ExpectExtend} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./RGBA.test.js')
\ No newline at end of file
/*
* Copyright (C) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import image from '@ohos.multimedia.image'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe('Image', function () {
beforeAll(function () {
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
/**
* @tc.number : RGBA_001
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_001', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 7, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_001 err' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_002
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_002', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 7, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.info('RGBA_002 err: ' + err);
expect(false).assertTrue();
done();
return;
}
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_003
* @tc.name : create pixelmap-promise (editable: false, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_003', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: false, pixelFormat: 7, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_003 err' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_004
* @tc.name : create pixelmap-callback (editable: false, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_004', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: false, pixelFormat: 7, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.info('RGBA_002 err: ' + err);
expect(false).assertTrue();
done();
return;
}
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_005
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: ALPHA_8,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_005', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 6, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_005 err' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_006
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: RGB_565,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_006', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 2, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_006 err' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_007
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: ARGB_8888,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_007', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 1, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_007 err' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_008
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: ALPHA_8,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_008', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 6, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.info('RGBA_008 err: ' + err);
expect(false).assertTrue();
done();
return;
}
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_009
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: RGB_565,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_009', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 2, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.info('RGBA_009 err: ' + err);
expect(false).assertTrue();
done();
return;
}
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_010
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: ARGB_8888,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_010', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 1, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.info('RGBA_010 err: ' + err);
expect(false).assertTrue();
done();
return;
}
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_011
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: unkonwn, size: { height: -1, width: 8 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_011', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 0, size: { height: -1, width: 8 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err) {
console.info('RGBA_011 err: ' + err);
expect(pixelmap == undefined).assertTrue();
console.info('RGBA_011 pass');
done();
} else {
expect(false).assertTrue();
done();
}
})
})
/**
* @tc.number : RGBA_012
* @tc.name : create pixelmap-callback(editable: true, pixelFormat: ARGB_8888, size: { height: 6, width: -1 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_012', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 1, size: { height: 6, width: -1 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err) {
console.info('RGBA_012 err: ' + err);
expect(pixelmap == undefined).assertTrue();
console.info('RGBA_012 pass');
done();
} else {
expect(false).assertTrue();
done();
}
})
})
/**
* @tc.number : RGBA_013
* @tc.name : create pixelmap-promise(editable: true, pixelFormat: unkonwn, size: { height: -1, width: 8 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_013', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 0, size: { height: -1, width: 8 } }
image.createPixelMap(Color, opts).then(pixelmap => {
expect(false).assertTrue();
console.info('RGBA_013 failed');
done();
}).catch(error => {
console.log('RGBA_013 err: ' + error);
expect(true).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_014
* @tc.name : create pixelmap-promise(editable: true, pixelFormat: unkonwn, size: { height: 6, width: -1 })
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_014', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 0, size: { height: 6, width: -1 } }
image.createPixelMap(Color, opts).then(pixelmap => {
expect(false).assertTrue();
console.info('RGBA_014 failed');
done();
}).catch(error => {
console.log('RGBA_014 error: ' + error);
expect(true).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_015
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: BGRA8888,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_015', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 4, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts)
.then(pixelmap => {
console.log('RGBA_015 pixelFormat: 4');
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
.catch(error => {
console.log('RGBA_015 err: ' + error);
expect(false).assertTrue();
done();
})
})
/**
* @tc.number : RGBA_016
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: BGRA8888,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it('RGBA_016', 0, async function (done) {
const Color = new ArrayBuffer(96);
let opts = { editable: true, pixelFormat: 4, size: { height: 4, width: 6 } }
image.createPixelMap(Color, opts, (err, pixelmap) => {
if (err != undefined) {
console.log('RGBA_016 err: ' + err);
expect(false).assertTrue();
done();
return;
}
console.log('RGBA_016 pixelFormat: image.PixelMapFormat.BGRA_8888');
expect(pixelmap != undefined).assertTrue();
expect(pixelmap.isEditable == opts.editable).assertTrue();
done();
})
})
})
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "ImageJSTestMain"
},
{
"name": "mainability_description",
"value": "ImageJSTestMain Ability"
}
]
}
\ No newline at end of file
......@@ -38,7 +38,7 @@ describe('AudioPlayerHLSTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_PLAYER_HLS
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_PLAYER_HLS_0100
* @tc.name : 001.test hls audio only
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
......@@ -50,14 +50,14 @@ describe('AudioPlayerHLSTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_PLAYER_HLS_VARIANT
* @tc.number : SUB_MULTIMEDIA_MEDIA_AUDIO_PLAYER_HLS_VARIANT_0100
* @tc.name : 001.test hls audio variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AUDIO_PLAYER_HLS_0100Variant', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_AUDIO_PLAYER_HLS_VARIANT_0100', 0, async function (done) {
playAudioSource(HTTP_PATH + '05.hls/hls_variant_audio/index.m3u8', 219600, PLAY_TIME, false, done);
})
})
......@@ -60,66 +60,66 @@ describe('VideoPlayerHLSTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEEK_SEPARATE
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_Separate_0100
* @tc.name : 001.test hls audio video separate
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_0100Separate', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_Separate_0100', 0, async function (done) {
await testVideoSeek(HTTP_PATH + '05.hls/2/index.m3u8', 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEEK_AUDIOONLY
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_AudioOnly_0100
* @tc.name : 001.test hls audio only
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_0100AudioOnly', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_AudioOnly_0100', 0, async function (done) {
await testVideoSeek(HTTP_PATH + '05.hls/audio_only/index.m3u8', 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEEK_VARIANT
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_Variant_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_0100Variant', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_Variant_0100', 0, async function (done) {
await testVideoSeek(HTTP_PATH + '05.hls/hls_variant/index.m3u8', 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEEK_AUDIOOFF
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_AudioOff_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_0100VariantAudioOff', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_AudioOff_0100', 0, async function (done) {
await testVideoSeek(HTTP_PATH + '05.hls/hls_variant2/index.m3u8', 10080, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEEK_CODEC_CHAGNGE
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_CodecChange_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_0100CodecChange', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_SEEK_CodecChange_0100', 0, async function (done) {
await testVideoSeek(HTTP_PATH + '05.hls/hls_variant3/index.m3u8', 10080, PLAY_TIME, done);
done();
})
......
......@@ -60,66 +60,66 @@ describe('VideoPlayerHLSTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_SEPARATE
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_Separate_0100
* @tc.name : 001.test hls audio video separate
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_0100Separate', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_Separate_0100', 0, async function (done) {
await playVideoSource(HTTP_PATH + '05.hls/2/index.m3u8', 640, 320, 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_AUDIOONLY
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_AudioOnly_0100
* @tc.name : 001.test hls audio only
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_0100AudioOnly', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_AudioOnly_0100', 0, async function (done) {
await playVideoSource(HTTP_PATH + '05.hls/audio_only/index.m3u8', 0, 0, 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_VARIANT
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_Variant_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_0100Variant', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_Variant_0100', 0, async function (done) {
await playVideoSource(HTTP_PATH + '05.hls/hls_variant/index.m3u8', null, null, 10033, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_AUDIOOFF
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_AudioOff_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level1
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_0100VariantAudioOff', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_AudioOff_0100', 0, async function (done) {
await playVideoSource(HTTP_PATH + '05.hls/hls_variant2/index.m3u8', null, null, 10080, PLAY_TIME, done);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_PLAYER_HLS_CODEC_CHAGNGE
* @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_CodecChange_0100
* @tc.name : 001.test hls variant
* @tc.desc : HLS Video playback control test
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_0100CodecChange', 0, async function (done) {
it('SUB_MULTIMEDIA_MEDIA_VIDEO_PLAYER_HLS_CodecChange_0100', 0, async function (done) {
await playVideoSource(HTTP_PATH + '05.hls/hls_variant3/index.m3u8', null, null, 10080, PLAY_TIME, done);
done();
})
......
......@@ -102,17 +102,17 @@ describe('MultimodalInput_test', function () {
inputDevice.getDevice(data[i], (res, err) => {
console.info(`getDevice:data ${JSON.stringify(data)}`);
arr = Object.keys(res);
expect(res.id).assertInstanceOf('number');
expect(res.name).assertInstanceOf('string');
expect(res.id).assertInstanceOf('Number');
expect(res.name).assertInstanceOf('String');
expect(res.sources).assertInstanceOf('Array');
expect(res.axisRanges).assertInstanceOf('Array');
expect(res.bus).assertInstanceOf('number');
expect(res.product).assertInstanceOf('number');
expect(res.vendor).assertInstanceOf('number');
expect(res.version).assertInstanceOf('number');
expect(res.phys).assertInstanceOf('string');
expect(res.uniq).assertInstanceOf('string');
expect(res).assertInstanceOf('InputDeviceData');
expect(res.bus).assertInstanceOf('Number');
expect(res.product).assertInstanceOf('Number');
expect(res.vendor).assertInstanceOf('Number');
expect(res.version).assertInstanceOf('Number');
expect(res.phys).assertInstanceOf('String');
expect(res.uniq).assertInstanceOf('String');
expect(res).assertInstanceOf('Object');
for(let j = 0;j < res.axisRanges.length; j++ ){
expect(res.axisRanges[j].source == 'keyboard' || res.axisRanges[j].source == 'mouse'
|| res.axisRanges[j].source == 'touchpad' || res.axisRanges[j].source == 'touchscreen'
......@@ -122,15 +122,14 @@ describe('MultimodalInput_test', function () {
|| res.axisRanges[j].axis == 'y' || res.axisRanges[j].axis == 'pressure'
|| res.axisRanges[j].axis == 'toolMinor' || res.axisRanges[j].axis == 'touchMajor'
|| res.axisRanges[j].axis == 'NULL').assertTrue();
expect(res.axisRanges[j].max).assertInstanceOf('number');
expect(res.axisRanges[j].max).assertInstanceOf('Number');
expect(res.axisRanges[j]).assertInstanceOf('AxisRange');
expect(res.axisRanges[j].min).assertInstanceOf('number');
expect(res.axisRanges[j].fuzz).assertInstanceOf('number');
expect(res.axisRanges[j].flat).assertInstanceOf('number');
expect(res.axisRanges[j].resolution).assertInstanceOf('number');
expect(res.axisRanges[j].min).assertInstanceOf('Number');
expect(res.axisRanges[j].fuzz).assertInstanceOf('Number');
expect(res.axisRanges[j].flat).assertInstanceOf('Number');
expect(res.axisRanges[j].resolution).assertInstanceOf('Number');
}
})
expect(arr.length > 0).assertTrue();
}
}
console.info(`inputDevice::getDevice_test-02 exit`);
......@@ -176,7 +175,7 @@ describe('MultimodalInput_test', function () {
} else {
for (let i = 0; i < data.length; ++i) {
inputDevice.getKeyboardType(data[i], (res, err) => {
expect(res).assertInstanceOf('number');
expect(res).assertInstanceOf('Number');
});
}
}
......@@ -204,8 +203,7 @@ describe('MultimodalInput_test', function () {
} else {
for (let i = 0; i < data.length; ++i) {
inputDevice.getKeyboardType(data[i]).then((res) => {
expect(res).assertInstanceOf('number');
done();
expect(res).assertInstanceOf('Number');
});
}
}
......@@ -282,13 +280,15 @@ describe('MultimodalInput_test', function () {
* @tc.name MultimodalInputDevice_getDeviceIds_Promise_test
* @tc.desc inputdevice interface getDeviceIds & supportKeys test
*/
it("MultimodalInputDevice_getDeviceIds_Promise_test", 0, async function () {
console.info(`inputDevice::supportKeys_test-01 enter`);
await inputDevice.getDeviceIds().then((data, err) => {
it("MultimodalInputDevice_getDeviceIds_Promise_test", 0, async function (done) {
console.info(`MultimodalInputDevice_getDeviceIds_Promise_test enter`);
inputDevice.getDeviceIds().then((data, err) => {
if (err) {
console.info(`MultimodalInputDevice_getDeviceIds_Promise_test err`);
expect(false).assertTrue();
done();
} else {
console.info(`MultimodalInputDevice_getDeviceIds_Promise_test data`);
for (let i = 0; i < data.length; ++i) {
inputDevice.supportKeys(data[i], [17, 22, 2055]).then((res, err) => {
expect(res).assertInstanceOf('Array');
......@@ -296,7 +296,7 @@ describe('MultimodalInput_test', function () {
}
done();
}
console.info(`inputDevice::supportKeys_test-01 exit`);
console.info(`MultimodalInputDevice_getDeviceIds_Promise_test exit`);
});
})
......@@ -305,18 +305,20 @@ describe('MultimodalInput_test', function () {
* @tc.name MultimodalInputDevice_getDevice_Promise_test
* @tc.desc inputdevice interface getDevice test
*/
it("MultimodalInputDevice_getDevice_Promise_test", 0, async function () {
console.info(`inputDevice::getDevice_test-01 enter`);
await inputDevice.getDevice(-1).then((data, err) => {
it("MultimodalInputDevice_getDevice_Promise_test", 0, async function (done) {
console.info(`MultimodalInputDevice_getDevice_Promise_test enter`);
inputDevice.getDevice(-1).then((data, err) => {
if (err) {
console.info(`MultimodalInputDevice_getDevice_Promise_test err`);
expect(false).assertTrue();
console.info(`inputDevice::getDevice_test-01 ${JSON.stringify(err)}`);
console.info(`MultimodalInputDevice_getDevice_Promise_test ${JSON.stringify(err)}`);
done();
} else {
console.info(`MultimodalInputDevice_getDevice_Promise_test data`);
expect(JSON.stringify(data) !== "{}").assertTrue();
done();
}
console.info(`inputDevice::getDevice_test-01 exit`);
console.info(`MultimodalInputDevice_getDevice_Promise_test exit`);
});
})
......
......@@ -26,6 +26,7 @@ var time = 1000
export default function ActsAnsGetWantAgentInfoTest() {
describe('ActsAnsGetWantAgentInfoTest', function () {
console.info('----ActsGetWantAgentInfoTest----');
/*
* @tc.number: ACTS_SetWantInfo_0100
* @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel()
......@@ -107,6 +108,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
}, time);
console.info('----getWantAgenta after----');
})
/*
* @tc.number: ACTS_SetWantInfo_0200
* @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel()
......@@ -170,6 +172,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_0200====>");
}, time)
})
/*
* @tc.number: ACTS_SetWantInfo_0300
* @tc.name: equal(normal)
......@@ -372,6 +375,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
}, 1000);
})
/*
* @tc.number: ACTS_SetWantInfo_0500
* @tc.name: equal(),cancel()
......@@ -472,6 +476,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
}, 1000);
})
/*
* @tc.number: ACTS_SetWantInfo_0600
* @tc.name: equal()
......@@ -494,20 +499,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_0600====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_0700
* @tc.name: equal()
* @tc.desc: verify the function of equal("$%$%^$%^","$%$%^$%^")promise
*/
it('ACTS_SetWantInfo_0700', 0, async function (done) {
var promise = await wantAgent.equal("$%$%^$%^","$%$%^$%^")
console.info('----equali success!----'+promise)
expect(promise).assertEqual(undefined);
wantAgent.equal("$%$%^$%^","$%$%^$%^").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0700====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_0800
* @tc.name: equal()
......@@ -525,20 +534,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_0800====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_0900
* @tc.name: equal()
* @tc.desc: verify the function of equal({},{})promise
*/
it('ACTS_SetWantInfo_0900', 0, async function (done) {
var promise = wantAgent.equal({},{})
console.info('----equalk success!----'+promise)
expect(promise).assertEqual(null);
wantAgent.equal({},{}).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0900====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_1000
* @tc.name: equal()
......@@ -556,20 +569,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_1000====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_2200
* @tc.number: ACTS_SetWantInfo_1100
* @tc.name: equal()
* @tc.desc: verify the function of equal(100,100)promise
*/
it('ACTS_SetWantInfo_1100', 0, async function (done) {
var promise = await wantAgent.equal(100,100)
console.info('----equaln success!----'+promise)
expect(promise).assertEqual(undefined);
wantAgent.equal(100,100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_1100====>");
}, time);
});
/*
* @tc.number: ACTS_SetWantInfo_1200
* @tc.name: getWantAgent()
......@@ -584,6 +601,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_1200====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1300
* @tc.name: getWantAgent()
......@@ -591,14 +609,17 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
*/
it('ACTS_SetWantInfo_1300', 0, async function (done) {
console.info('----ACTS_SetWantInfo_0300 begin----');
var promise = wantAgent.getWantAgent("")
console.log("===getWantAgentb==="+promise)
expect(promise).assertEqual(null);
wantAgent.getWantAgent("").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_1300====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1400
* @tc.name: getBundleName()
......@@ -613,20 +634,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_1400====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1500
* @tc.name: getBundleName()
* @tc.desc: verify the function of getBundleName("")promise
*/
it('ACTS_SetWantInfo_1500', 0, async function (done) {
var promise = await wantAgent.getBundleName("")
console.info('----getBundleNameb success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getBundleName("").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_1500====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1600
* @tc.name: getUid()
......@@ -641,20 +666,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_1600====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1700
* @tc.name: getUid()
* @tc.desc: verify the function of getUid("")promise
*/
it('ACTS_SetWantInfo_1700', 0, async function (done) {
var promise =await wantAgent.getUid("")
console.info('----getUidb success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getUid("").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_1700====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1800
* @tc.name: getWant()
......@@ -670,20 +699,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_1800====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_1900
* @tc.name: getWant()
* @tc.desc: verify the function of getWant("")promise
*/
it('ACTS_SetWantInfo_1900', 0, async function (done) {
var promise = await wantAgent.getWant("")
console.info('----getWantb success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getWant("").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_1900====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2000
* @tc.name: getWantAgent()
......@@ -699,20 +732,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_2000====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2100
* @tc.name: getWantAgent()
* @tc.desc: verify the function of getWantAgent(100)promises
*/
it('ACTS_SetWantInfo_2100', 0, async function (done) {
var promise = wantAgent.getWantAgent(100)
console.log("----getWantAgentb success!----"+promise)
expect(promise).assertEqual(null)
wantAgent.getWantAgent(100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done();
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_2100====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2200
* @tc.name: getBundleName()
......@@ -728,20 +765,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_2200====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2300
* @tc.name: getBundleName()
* @tc.desc: verify the function of getBundleName(100)promise
*/
it('ACTS_SetWantInfo_2300', 0, async function (done) {
var promise =await wantAgent.getBundleName(100)
console.info('----getBundleNamed success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getBundleName(100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_2300====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2400
* @tc.name: getUid()
......@@ -756,20 +797,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_2400====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2500
* @tc.name: getUid()
* @tc.desc: verify the function of getUid(100)promise
*/
it('ACTS_SetWantInfo_2500', 0, async function (done) {
var promise =await wantAgent.getUid(100)
console.info('----getUidd success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getUid(100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_2500====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2600
* @tc.name: getWant()
......@@ -785,20 +830,24 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
console.debug("====>time out ACTS_SetWantInfo_2600====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2700
* @tc.name: getWant()
* @tc.desc: verify the function of getWant(100)promise
*/
it('ACTS_SetWantInfo_2700', 0, async function (done) {
var promise = await wantAgent.getWant(100)
console.info('----getWantd success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.getWant(100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_2700====>");
}, time);
})
/*
* @tc.number: ACTS_SetWantInfo_2800
* @tc.name: getWantAgent()
......@@ -811,6 +860,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
})
done();
})
/*
* @tc.number: ACTS_SetWantInfo_2900
* @tc.name: getWantAgent()
......@@ -824,6 +874,7 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
})
done();
})
/*
* @tc.number: ACTS_SetWantInfo_3000
* @tc.name: getBundleName()
......@@ -836,17 +887,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3100
* @tc.name: getBundleName()
* @tc.desc: verify the function of getBundleName({})promise
*/
it('ACTS_SetWantInfo_3100', 0, async function (done) {
var promise = wantAgent.getBundleName({})
console.info('----getBundleNamef success!----'+promise);
expect(promise).assertEqual(null)
done()
wantAgent.getBundleName({}).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3200
* @tc.name: getUid()
......@@ -858,17 +913,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3300
* @tc.name: getUid()
* @tc.desc: verify the function of getUid({})promise
*/
it('ACTS_SetWantInfo_3300', 0, async function (done) {
var promise = wantAgent.getUid({})
console.info('----getUidf success!----'+promise);
expect(promise).assertEqual(null)
done()
wantAgent.getUid({}).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3400
* @tc.name: getWant()
......@@ -880,17 +939,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3500
* @tc.name: getWant()
* @tc.desc: verify the function of getWant({})promise
*/
it('ACTS_SetWantInfo_3500', 0, async function (done) {
var promise = wantAgent.getWant({})
console.info('----getWantf success!----'+promise);
expect(promise).assertEqual(null)
done()
wantAgent.getWant({}).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3600
* @tc.name: cancel()
......@@ -902,17 +965,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3700
* @tc.name: cancel()
* @tc.desc: verify the function of cancel({})promise
*/
it('ACTS_SetWantInfo_3700', 0, async function (done) {
var promise = await wantAgent.cancel({})
console.info('----cancelb success!----'+promise);
expect(promise).assertEqual(null)
done()
wantAgent.cancel({}).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3800
* @tc.name: cancel()
......@@ -924,17 +991,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_3900
* @tc.name: cancel()
* @tc.desc: verify the function of cancel(100)promise
*/
it('ACTS_SetWantInfo_3900', 0, async function (done) {
var promise =await wantAgent.cancel(100)
console.info('----canceld success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.cancel(100).then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_4000
* @tc.name: getWant()
......@@ -946,17 +1017,21 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_4100
* @tc.name: cancel()
* @tc.desc: verify the function of cancel("")promise
*/
it('ACTS_SetWantInfo_4100', 0, async function (done) {
var promise = await wantAgent.cancel("")
console.info('----cancelf success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.cancel("").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
/*
* @tc.number: ACTS_SetWantInfo_4200
* @tc.name: cancel()
......@@ -968,15 +1043,18 @@ describe('ActsAnsGetWantAgentInfoTest', function () {
});
done()
})
/*
* @tc.number: ACTS_SetWantInfo_4300
* @tc.name: cancel()
* @tc.desc: verify the function of cancel("%^%^%^")promise
*/
it('ACTS_SetWantInfo_4300', 0, async function (done) {
var promise =await wantAgent.cancel("%^%^%^")
console.info('----cancelh success!----'+promise);
expect(promise).assertEqual(undefined)
wantAgent.cancel("%^%^%^").then((error, data)=>{
if(error.code) {
expect(error.code).assertEqual(-1)
}
})
done()
})
})
......
......@@ -47,7 +47,7 @@ describe('ActsAnsWantAgentFiveTest', function () {
}
},
],
// operationType: wantAgent.OperationType.START_ABILITY,
operationType: wantAgent.OperationType.START_ABILITY,
requestCode: 0,
wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
}
......@@ -75,9 +75,7 @@ describe('ActsAnsWantAgentFiveTest', function () {
}
);
} else {
console.info('----getWantAgent failed!----');
console.info(data);
expect(typeof(data)).assertEqual("object");
expect(err.code).assertEqual(-1)
}
done();
......
......@@ -67,15 +67,17 @@ describe('ActsAnsWantAgentFiveProTest', function () {
console.info('----trigger success!----');
console.info('== trigger data ' + JSON.stringify(data) );
} else {
console.info('----trigger failed!----');
console.info('== trigger data ' + JSON.stringify(data) );
expect(err.code).assertEqual(-1)
}
done();
}
);
done();
}
);
).catch((err)=>{
expect(err.code).assertEqual(-1)
done()
})
setTimeout(function(){
console.debug("====>time out ACTS_SetWant_1000====>");
}, time);
......
......@@ -477,9 +477,14 @@ describe('ActsSubscriberTestOrder', function () {
expect(data.event).assertEqual('publish_event0500');
expect(data.code).assertEqual(10);
expect(data.data).assertEqual('publish_event0500_init');
commonEventSubscriber0500.finishCommonEvent().then(() => {
console.info('===============>subscriberCallBack0500 finishCommonEvent promise');
});
commonEventSubscriber0500.finishCommonEvent((err) => {
if (err.code) {
console.info("===============>finishCommonEvent AsyncCallback failed " + JSON.stringify(err));
} else {
console.info("===============>FinishCommonEvent AsyncCallback success");
}
done()
})
}
async function subscriberCallBack0501(err, data) {
......@@ -489,10 +494,14 @@ describe('ActsSubscriberTestOrder', function () {
expect(data.event).assertEqual('publish_event0500');
expect(data.code).assertEqual(10);
expect(data.data).assertEqual('publish_event0500_init');
commonEventSubscriber0501.finishCommonEvent().then(() => {
console.info('===============>subscriberCallBack0501 finishCommonEvent promise');
done();
});
commonEventSubscriber0501.finishCommonEvent((err) => {
if (err.code) {
console.info("===============>finishCommonEvent AsyncCallback failed " + JSON.stringify(err));
} else {
console.info("===============>FinishCommonEvent AsyncCallback success");
}
done()
})
}
Subscriber.createSubscriber(
......
......@@ -13,11 +13,9 @@
* limitations under the License.
*/
import DeviceInfoTest from './DeviceInfoJsUnit.test.js'
import SystemParameterTest from './ParametersJsUnit.test.js'
import SystemDeviceTest from './SystemDeviceApi.test.js'
export default function testsuite() {
DeviceInfoTest()
SystemParameterTest()
SystemDeviceTest()
SystemDeviceTest()
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册