提交 cb81f65e 编写于 作者: M mayunteng_1

Merge branch 'master' of gitee.com:openharmony/xts_acts

Change-Id: Ieaad6982b7daf1a800363da9325f5f103c919bae
......@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
......@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapC') {
......
......@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
......@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startHapB') {
......
......@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
......@@ -48,6 +57,7 @@ export default class MainAbility extends Ability {
}
onForeground() {
sleep(1000)
// Ability has brought to foreground
console.log("ACTS_NewWant MainAbility onForeground")
if (globalThis.abilityWant.action == 'startStandard0400') {
......
......@@ -16,6 +16,15 @@
import Ability from '@ohos.application.Ability'
import commonEvent from '@ohos.commonEvent'
function sleep(delay) {
let start = new Date().getTime();
while (true) {
if (new Date().getTime() - start > delay) {
break;
}
}
}
export default class SecondAbility extends Ability {
onCreate(want, launchParam) {
......@@ -48,6 +57,7 @@ export default class SecondAbility extends Ability {
}
onForeground() {
sleep(1000)
// Ability has brought to foreground
var connId;
console.log("ACTS_NewWant SecondAbility onForeground")
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import account from '@ohos.account.appAccount'
import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
const NAMELIMIT = 512;
......@@ -22,6 +23,18 @@ const owner = 'com.example.accountauthenticator'
export default function ActsAccountAppAccess() {
describe('ActsAccountAuthenticator', function () {
function sleep(delay) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, delay)
}).then(() => {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
done();
});
/*
* @tc.number : ActsAccountCheckAccountLabels_0100
* @tc.name : Check Account Labels callback form
......@@ -568,7 +581,21 @@ export default function ActsAccountAppAccess() {
* @tc.desc :
*/
it('ActsAccountSelectAccountByOptions_0100', 0, async function (done) {
it('ActsAccountSelectAccountByOptions_0100', 0, async function (done) {
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
},
)
await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0100 start====");
var appAccountManager = account.createAppAccountManager();
var select_options = {allowedAccounts:[{"name":name,"owner":owner}]}
......@@ -579,9 +606,9 @@ export default function ActsAccountAppAccess() {
try {
var data = await appAccountManager.selectAccountsByOptions(select_options)
console.debug("====>ActsAccountSelectAccountByOptions_0100 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
expect(data.length).assertEqual(1)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......@@ -593,7 +620,7 @@ export default function ActsAccountAppAccess() {
console.debug('====>ActsAccountSelectAccountByOptions_0100 deleteAccount_err')
expect().assertFail()
done();
}
}
});
});
......@@ -604,6 +631,20 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSelectAccountByOptions_0200', 0, async function (done) {
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
},
)
await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0200 start====");
var appAccountManager = account.createAppAccountManager();
var select_options = {allowedOwners: [owner]}
......@@ -616,7 +657,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0200 data:" + JSON.stringify(data));
expect(data.length).assertEqual(3)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......@@ -640,6 +681,20 @@ export default function ActsAccountAppAccess() {
*/
it('ActsAccountSelectAccountByOptions_0300', 0, async function (done) {
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.example.accountauthenticator",
abilityName: "com.example.accountauthenticator.MainAbility",
action: "action1",
parameters:
{},
},
},
)
await sleep(1000)
console.debug("====>ActsAccountSelectAccountByOptions_0300 start====");
var appAccountManager = account.createAppAccountManager();
var options = {requiredLabels: ["male", "30-40"]}
......@@ -652,7 +707,7 @@ export default function ActsAccountAppAccess() {
console.debug("====>ActsAccountSelectAccountByOptions_0300 data:" + JSON.stringify(data));
expect(data.length).assertEqual(1)
} catch(err) {
onsole.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
console.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
expect(err).assertEqual(null)
}
try{
......
......@@ -33,7 +33,7 @@
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"name": "com.example.accountauthenticator.MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
......
......@@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import account_appAccount from '@ohos.account.appAccount';
import featureAbility from '@ohos.ability.featureAbility'
export default {
data: {
......@@ -20,4 +22,29 @@ export default {
onInit() {
this.title = this.$t('strings.world');
},
}
onShow() {
console.info('ServiceAbility onStart');
var accountMgr = account_appAccount.createAppAccountManager();
console.info('ServiceAbility lcc addAccount 01 onStart');
accountMgr.addAccount("zhangsan", "",(data)=>{
console.info('ServiceAbility lcc enableAppAccess 01 onStart');
accountMgr.enableAppAccess("zhangsan", "com.example.actsaccounttest");
console.info('ServiceAbility lcc addAccount 02 onStart');
accountMgr.addAccount("lisi", "",(err)=>{
console.info('ServiceAbility lcc enableAppAccess 02 onStart');
accountMgr.enableAppAccess("lisi", "com.example.actsaccounttest");
console.info('ServiceAbility lcc addAccount 03 onStart');
accountMgr.addAccount("wangwu", "",(err)=>{
console.info('ServiceAbility lcc enableAppAccess 03 onStart');
accountMgr.enableAppAccess("wangwu", "com.example.actsaccounttest",(err)=>{
featureAbility.terminateSelf();
console.info('ServiceAbility add end');
});
});
});
});
console.info('ServiceAbility onStart end');
},
onReady() {
},
}
\ No newline at end of file
......@@ -13,25 +13,14 @@
* limitations under the License.
*/
import account_appAccount from '@ohos.account.appAccount';
import featureAbility from '@ohos.ability.featureAbility'
import {MyAuthenticator} from '../Common/utils'
var TAG = "[AccountTest]"
var authenticator = null
export default {
async onStart(want) {
onStart(want) {
console.info('ServiceAbility onStart');
var accountMgr = account_appAccount.createAppAccountManager();
try {
await accountMgr.addAccount("zhangsan", "");
await accountMgr.enableAppAccess("zhangsan", "com.example.actsaccounttest");
await accountMgr.addAccount("lisi", "");
await accountMgr.enableAppAccess("lisi", "com.example.actsaccounttest");
await accountMgr.addAccount("wangwu", "");
await accountMgr.enableAppAccess("wangwu", "com.example.actsaccounttest");
} catch(err) {
console.error(TAG + "addAccount or enableAppAccess failed, error: " + JSON.stringify(err))
}
console.info('ServiceAbility onStart end');
},
async onStop() {
console.info('ServiceAbility onStop');
......
......@@ -25,6 +25,7 @@ group("arkui") {
"ace_ets_test:ActsAceEtsTest",
"ace_ets_third_test:ActsAceEtsThirdTest",
"ace_ets_web_dev:ActsAceWebDevTest",
"ace_ets_web_dev_two:ActsAceWebDevTwoTest",
"ace_ets_xcomponent:ActsAceXComponentEtsTest",
"ace_js_attribute_api:ActsAceJsApiTest",
"ace_napi_test:ActsAceNapiEtsTest",
......
......@@ -75,7 +75,26 @@
"pages/alphabetIndexer",
"pages/checkBoxGroup",
"pages/circle",
"pages/ellipse"
"pages/ellipse",
"pages/grid",
"pages/gridItem",
"pages/inspector",
"pages/lazyForEach",
"pages/navigator",
"pages/path",
"pages/polygon",
"pages/polyLine",
"pages/progress",
"pages/rect",
"pages/scroll",
"pages/search",
"pages/swiper",
"pages/tabs",
"pages/text",
"pages/textArea",
"pages/textInput",
"pages/textPicker",
"pages/video"
],
"name": ".MainAbility",
"window": {
......
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct GridMaxCount {
@State Number: String[] = ['5', '6', '7', '8', '9']
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear GridMaxCount start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear GridMaxCount end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("grid-MaxCount")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("maxCountText")
Column({ space: 5 }) {
Grid() {
ForEach(this.Number, (day: string) => {
ForEach(this.Number, (day: string) => {
GridItem() {
Text(day)
.fontSize(16)
.backgroundColor(0xF9CF93)
.width('100%')
.height('100%')
.textAlign(TextAlign.Center)
}
}, day => day)
}, day => day)
}
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.rowsTemplate('1fr 1fr 1fr 1fr 1fr')
.columnsGap(10)
.rowsGap(10)
.width('90%')
.backgroundColor(0xFAEEE0)
.height(300)
.maxCount(5)
.key("maxCountTest")
}
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
import events_emitter from '@ohos.events.emitter';
@Entry
@Component
export default
struct GridItemOnSelect {
@State Number: String[] = ['5', '6', '7', '8', '9']
@State isSelect: boolean = false;
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear GridItemOnSelect start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear GridItemOnSelect end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("gridItem-OnSelect")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onSelectText")
Column({ space: 5 }) {
Grid() {
ForEach(this.Number, (day: string) => {
ForEach(this.Number, (day: string) => {
GridItem() {
Text(day)
.fontSize(16)
.backgroundColor(0xF9CF93)
.width('100%')
.height('100%')
.textAlign(TextAlign.Center)
.key("onSelected")
}.onSelect((isSelect)=>{
console.info("Select:" + isSelect)
//this.showToast("onSelect() " + index)
this.isSelect = true;
try {
var backData = {
data: {
"STATUS": this.isSelect
}
}
let backEvent = {
eventId: 10200,
priority: events_emitter.EventPriority.LOW
}
console.info("onSelect start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("onSelect emit action state err: " + JSON.stringify(err))
}
})
}, day => day)
}, day => day)
}
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.rowsTemplate('1fr 1fr 1fr 1fr 1fr')
.columnsGap(10)
.rowsGap(10)
.width('90%')
.backgroundColor(0xFAEEE0)
.height(300)
}
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
import events_emitter from '@ohos.events.emitter';
@Entry
@Component
export default
struct Inspector {
@State message: string = 'test'
@State setColor:string = '#F9CF93'
@State catchStatus:string = "success"
onPageShow() {
console.info('[inspector] page show called');
var stateChangeEvent = {
eventId: 103,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEvent, this.stateChangCallBack);
}
private stateChangCallBack = (eventData) => {
console.info("[inspector] page stateChangCallBack");
if (eventData != null) {
console.info("[inspector] page state change called:" + JSON.stringify(eventData));
if (eventData.data.setColor != null) {
this.setColor = eventData.data.setColor;
}
}
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("inspector")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
Row() {
Column() {
Text(this.message)
.key("inspectorApiOne")
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
let getInspectorNodesObj = JSON.stringify(getInspectorNodes())
try {
var backData = {
data: {
"getInspectorNodes": getInspectorNodesObj,
"result":"success"
}
}
let backEvent = {
eventId: 101,
priority: events_emitter.EventPriority.LOW
}
console.info("inspector_101 onClick start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("inspector_101 onClick emit action state err: " + JSON.stringify(err.message))
}
})
Text("inspectorApiTwo")
.key("inspectorApiTwo")
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
// let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(1))
try {
var backData1 = {
data: {
"result": "success",
"getInspectorNodeById":"getInspectorNodeByIdObj"
}
}
let backEvent1 = {
eventId: 102,
priority: events_emitter.EventPriority.LOW
}
console.info("inspector_102 onClick start to emit action state")
events_emitter.emit(backEvent1, backData1)
} catch (err) {
console.info("inspector_102 onClick emit action state err: " + JSON.stringify(err.message))
}
})
Text("inspectorApiThree")
.key("inspectorApiThree")
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
setAppBgColor('#F9CF93');
})
Text("inspectorApiFour")
.key("inspectorApiFour")
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
try{
Profiler.registerVsyncCallback((info: string) => {
console.info("VsyncCallback" + info)
});
Profiler.unregisterVsyncCallback();
this.catchStatus = "callBackSuccess"
}catch(err){
console.info("inspector_103 onClick err: " + JSON.stringify(err.message))
this.catchStatus = "callBackFail"
}
try {
var backData2 = {
data: {
"catchStatus": this.catchStatus,
}
}
let backEvent2 = {
eventId: 103,
priority: events_emitter.EventPriority.LOW
}
console.info("inspector_103 onClick start to emit action state")
events_emitter.emit(backEvent2, backData2)
} catch (err) {
console.info("inspector_103 onClick emit action state err: " + JSON.stringify(err.message))
}
})
}
.width('100%')
}
.height('100%')
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
import Log from '../common/Log.ets';
class BasicDataSource implements IDataSource {
private listeners: DataChangeListener[] = []
public totalCount(): number {
return 0
}
public getData(index: number): any {
return undefined
}
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
console.info('add listener')
this.listeners.push(listener)
}
}
unregisterDataChangeListener(listener: DataChangeListener): void {
const pos = this.listeners.indexOf(listener);
if (pos >= 0) {
console.info('remove listener')
this.listeners.splice(pos, 1)
}
}
notifyDataReload(): void {
this.listeners.forEach(listener => {
listener.onDataReloaded()
})
}
notifyDataAdd(index: number): void {
this.listeners.forEach(listener => {
listener.onDataAdd(index)
})
}
notifyDataChange(index: number): void {
this.listeners.forEach(listener => {
listener.onDataChange(index)
})
}
notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDataDelete(index)
})
}
notifyDataMove(from: number, to: number): void {
this.listeners.forEach(listener => {
listener.onDataMove(from, to)
})
}
}
class MyDataSource extends BasicDataSource {
private dataArray: string[] = ['/path/image0', '/path/image1', '/path/image2', '/path/image3']
public totalCount(): number {
return this.dataArray.length
}
public getData(index: number): any {
return this.dataArray[index]
}
public addData(index: number, data: string): void {
this.dataArray.splice(index, 0, data)
var datatest=this.dataArray.length
console.info('lenghth = '+ datatest)
for(var i = 0; i<datatest; i++){
console.info('after adding: '+ this.dataArray[i])
}
this.notifyDataAdd(index)
this.notifyDataChange(index)
}
public pushData(data: string): void {
this.dataArray.push(data)
this.notifyDataAdd(this.dataArray.length - 1)
var datatest=this.dataArray.length
console.info('lenghth = '+ datatest)
for(var i = 0; i<datatest; i++){
console.info('after adding: '+ this.dataArray[i])
}
}
public moveData(index1:number,index2:number):void{
if(index1 < index2){
var temp = this.dataArray[index1]
for(var i = index1; i < index2 ;i++){
this.dataArray[i] = this.dataArray[i+1]
}
this.dataArray[index2] = temp
for(var j = 0 ; j < this.dataArray.length ; j++){
console.info('after moving :' + this.dataArray[j])
}
}
else if (index1 > index2){
var temp = this.dataArray[index1]
for(var i = index1 ; i > index2; i--){
this.dataArray[i] = this.dataArray[i-1]
}
this.dataArray[index2] = temp
for(var j = 0 ; j < this.dataArray.length ; j++){
console.info('after moving :' + this.dataArray[j])
}
}
this.notifyDataMove(index1,index2)
}
public popData(): void {
this.dataArray.pop()
this.notifyDataDelete(this.dataArray.length)
var datatest=this.dataArray.length
console.info('lenghth = '+ datatest)
for(var i = 0; i<datatest; i++){
console.info('after deleting: '+ this.dataArray[i])
}
}
public changeData(index: number): void {
this.dataArray[index] = 'apple'
var datatest=this.dataArray.length
console.info('lenghth = '+ datatest)
for(var i = 0; i<datatest; i++){
console.info('after changing: '+ this.dataArray[i])
}
this.notifyDataChange(index)
}
}
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct LazyForEachOnDataAdd {
private data: MyDataSource = new MyDataSource()
private scroller: Scroller = new Scroller()
@State result_101:boolean = true
@State result_102:boolean = true
@State result_103:boolean = true
@State result_104:boolean = true
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear LazyForEachOnDataAdd start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear LazyForEachOnDataAdd end`)
}
build() {
Column() {
Stack({ alignContent: Alignment.End }) {
Scroll(this.scroller) {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Start,
justifyContent: FlexAlign.SpaceBetween
}) {
Text("lazyForEach-OnDataAdd")
.width(300)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onDataAddText")
List({ space: 3 }) {
LazyForEach(this.data, (item: string) => {
ListItem() {
Row() {
Image(item).width("30%").height(50)
Text(item).fontSize(20).margin({ left: 10 })
}.margin({ left: 10, right: 10 })
}
.key("listItemOne")
.onClick(() => {
try{
this.data.pushData('/path/image' + this.data.totalCount())
console.info("this.data.totalCount() is :" + this.data.totalCount())
}catch(err){
this.result_101 = false
console.info("LazyForEachOnDataAdd_101 onClick emit action err: " + JSON.stringify(err.message))
}
try {
var backData1 = {
data: {
"result1": this.result_101,
}
}
let backEvent1 = {
eventId: 201,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_101 onClick start to emit action")
events_emitter.emit(backEvent1, backData1)
} catch (err) {
console.info("LazyForEachOnDataAdd_101 onClick emit action err: " + JSON.stringify(err.message))
}
})
}, item => item)
}
Text("lazyForEach-OnDataMove")
.width(300)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onDataMoveText")
List({ space: 3 }) {
LazyForEach(this.data, (item: string) => {
ListItem() {
Row() {
Image(item).width("30%").height(50)
Text(item).fontSize(20).margin({ left: 10 })
}.margin({ left: 10, right: 10 })
}
.key("listItemTwo")
.onClick(() => {
try{
this.data.moveData(3, 1)
}catch(err){
this.result_102 = false
console.info("LazyForEachOnDataAdd_102 onClick emit action err: " + JSON.stringify(err.message))
}
try {
var backData2 = {
data: {
"result2": this.result_102,
}
}
let backEvent2 = {
eventId: 202,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_102 onClick start to emit action")
events_emitter.emit(backEvent2, backData2)
} catch (err) {
console.info("LazyForEachOnDataAdd_102 onClick emit action err: " + JSON.stringify(err.message))
}
})
}, item => item)
}
Text("lazyForEach-OnDataDelete")
.width(300)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onDataDeleteText")
List({ space: 3 }) {
LazyForEach(this.data, (item: string) => {
ListItem() {
Row() {
Image(item).width("30%").height(50)
Text(item).fontSize(20).margin({ left: 10 })
}.margin({ left: 10, right: 10 })
}
.key("listItemThree")
.onClick(() => {
try{
this.data.popData()
}catch(err){
this.result_103 = false
console.info("LazyForEachOnDataAdd_103 onClick emit action err: " + JSON.stringify(err.message))
}
try {
var backData3 = {
data: {
"result3": this.result_103,
}
}
let backEvent3 = {
eventId: 203,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_103 onClick start to emit action")
events_emitter.emit(backEvent3, backData3)
} catch (err) {
console.info("LazyForEachOnDataAdd_103 onClick emit action err: " + JSON.stringify(err.message))
}
})
}, item => item)
}
Text("lazyForEach-OnDataChange")
.width(300)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onDataChangeText")
List({ space: 3 }) {
LazyForEach(this.data, (item: string) => {
ListItem() {
Row() {
Image(item).width("30%").height(50)
Text(item).fontSize(20).margin({ left: 10 })
}.margin({ left: 10, right: 10 })
}
.key("listItemFour")
.onClick(() => {
try{
this.data.changeData(2)
}catch(err){
this.result_104 = false
console.info("LazyForEachOnDataAdd_104 onClick emit action err: " + JSON.stringify(err.message))
}
try {
var backData4 = {
data: {
"result4": this.result_104,
}
}
let backEvent4 = {
eventId: 204,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_104 onClick start to emit action")
events_emitter.emit(backEvent4, backData4)
} catch (err) {
console.info("LazyForEachOnDataAdd_104 onClick emit action err: " + JSON.stringify(err.message))
}
})
}, item => item)
}
}.width("100%").height("100%")
}
}
}
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct NavigatorTarget {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear NavigatorTarget start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear NavigatorTarget end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("navigator-Target")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("targetText")
Navigator({ target: '', type: NavigationType.Push }) {
Text('Go to target page')
.width('100%').textAlign(TextAlign.Center)
}.params({ text: 'target' }).target('pages/index')
.key("Navigator")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct PathNew {
private path: any = new Path({
width: 100,
height: 100,
commands: 'M150 0 L300 300 L0 300 Z'
})
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear PathNew start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear PathNew end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("path-New")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
Path().width(100).height(100).commands('M150 0 L300 300 L0 300 Z')
.key("Path")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct PolyLineNe {
private polyline: PolylineAttribute = new Polyline({
width: 100,
height: 100
})
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear PolyLineNe start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear PolyLineNe end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("polyLine-Ne")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
Polyline().width(100).height(100).points([[0, 0], [0, 100], [100, 100]])
.key("Polyline")
}.width("100%").height("100%")
}
}
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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
* 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,
......@@ -12,38 +12,47 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ACTSVIDEODECENC_NDK_FUNC_TEST_H
#define ACTSVIDEODECENC_NDK_FUNC_TEST_H
#include "gtest/gtest.h"
#include "VDecEncNdkSample.h"
namespace OHOS {
namespace Media {
class ActsVideoDecEncNdkTest : public testing::Test {
public:
// Preset action of the test suite, which is executed before the first test case
static void SetUpTestCase(void)
{
printf("ActsVideoDecEncNdkTest::SetUpTestCase");
}
// Test suite cleanup action, which is executed after the last test case
static void TearDownTestCase(void)
{
printf("ActsVideoDecEncNdkTest::TearDownTestCase");
}
// Preset action of the test case
void SetUp(void)
{
printf("ActsVideoDecEncNdkTest::SetUp");
}
// Cleanup action of the test case
virtual void TearDown(void)
{
printf("ActsVideoDecEncNdkTest::TearDown");
}
};
}
import Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct PolygonNe {
private polygon: PolygonAttribute = new Polygon({
width: 100,
height: 100
})
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear PolygonNe start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear PolygonNe end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("polygon-Ne")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
Polygon({ width: 100, height: 100 }).points([[0, 0], [50, 100], [100, 0]])
.key("Polygon")
}.width("100%").height("100%")
}
}
#endif // ACTSVIDEODECENC_NDK_FUNC_TEST_H
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct ProgressStyle {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear ProgressStyle start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear ProgressStyle end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("progress-Style")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("styleText")
Row({ space: 40 }) {
Progress({ value: 20, total: 150, type: ProgressType.Ring })
.color(Color.Green).value(50).width(100)
.style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 20 })
.key("Progress")
}
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct RectNe {
private rect: RectAttribute = new Rect({
width: '90%',
height: 50,
radiusHeight: 20,
radiusWidth: 20
})
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear RectNe start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear RectNe end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("rect-Ne")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
Rect({ width: '90%', height: 50 }).radiusHeight(20).radiusWidth(20)
.key("Rect")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct ScrollOnScrollBegin {
scroller: Scroller = new Scroller()
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear ScrollOnScrollBegin start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear ScrollOnScrollBegin end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("scroll-OnScrollBegin")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onScrollBeginText")
Scroll(this.scroller) {
Column() {
ForEach(this.arr, (item) => {
Text(item.toString())
.width('90%')
.height(150)
.backgroundColor(0xFFFFFF)
.borderRadius(15)
.fontSize(16)
.textAlign(TextAlign.Center)
.margin({ top: 10 })
}, item => item)
}.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.onScrollBegin((dx: number, dy: number) => {
console.info('dx=' + dx + ",dy=" + dy)
return { dxRemain: dx, dyRemain: dy }
})
.scrollBar(BarState.On)
.scrollBarColor(Color.Gray)
.scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
.onScrollEdge((side: Edge) => {
console.info('To the edge')
})
.onScrollEnd(() => {
console.info('Scroll Stop')
})
.key("Scroll")
.width("100%")
.height("100%")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct SearchOnCut {
controller: SearchController = new SearchController()
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear SearchOnCut start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear SearchOnCut end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("search-OnCut")
.width(320)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onCutText")
Search({ value: '', placeholder: 'search-OnCut', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
.onCut((value: string) => {
console.log('onCut: ' + value)
})
.key("OnCut")
Text("search-OnPaste")
.width(320)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onPasteText")
Search({ value: '', placeholder: 'search-OnPaste', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
.onPaste((value: string) => {
console.log('onPaste: ' + value)
})
.key("OnPaste")
Text("search-CopyOption")
.width(320)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("copyOptionText")
Search({ value: '', placeholder: 'search-CopyOption', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
// 编译报错
// .copyOption(CopyOption.InApp)
.key("CopyOption")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
class MyDataSource implements IDataSource {
private list: number[] = []
private listener: DataChangeListener
constructor(list: number[]) {
this.list = list
}
totalCount(): number {
return this.list.length
}
getData(index: number): any {
return this.list[index]
}
registerDataChangeListener(listener: DataChangeListener): void {
this.listener = listener
}
unregisterDataChangeListener() {
}
}
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct SwiperCurve {
private swiperController: SwiperController = new SwiperController()
private data: MyDataSource = new MyDataSource([])
aboutToAppear(): void {
Log.showInfo(TAG, `aboutToAppear SwiperCurve start`)
let list = []
for (var i = 1; i <= 10; i++) {
list.push(i.toString());
}
this.data = new MyDataSource(list)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear SwiperCurve end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Column({ space: 5 }) {
Swiper(this.swiperController) {
LazyForEach(this.data, (item: string) => {
Text(item).width('90%').height(160).backgroundColor(0xAFEEEE).textAlign(TextAlign.Center).fontSize(20)
}, item => item)
}
.cachedCount(2)
.index(1)
.autoPlay(true)
.interval(4000)
.indicator(true) // 默认开启指示点
.loop(false) // 默认开启循环播放
.duration(1000)
.vertical(false) // 默认横向切换
.itemSpace(0)
.curve(Curve.Linear) // 动画曲线
.onChange((index: number) => {
console.info(index.toString())
})
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('next')
.onClick(() => {
this.swiperController.showNext()
})
Button('preview')
.onClick(() => {
this.swiperController.showPrevious()
})
}
}.margin({ top: 5 })
Text("swiper-Curve")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("curveText")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TabsBarPosition {
private controller: TabsController = new TabsController()
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TabsBarPosition start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TabsBarPosition end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("tabs-BarPosition")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("barPositionText")
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Pink)
}.tabBar('pink')
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Yellow)
}.tabBar('yellow')
}
.vertical(true).scrollable(true).barMode(BarMode.Fixed)
.barWidth(70).barHeight(150).animationDuration(400)
.onChange((index: number) => {
console.info(index.toString())
})
.width('90%').backgroundColor(0xF5F5F5)
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextMinFontSize {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextMinFontSize start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextMinFontSize end `)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("text-MinFontSize")
.width(100)
.height(70)
.fontSize('30px')
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("minFontSizeText")
.minFontSize('50px')
Text("text-CopyOption")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("copyOptionText")
.copyOption(0)
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextAreaOnCut {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextAreaOnCut start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextAreaOnCut end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextArea({placeholder: "textArea-OnCut" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的文字被剪切时触发
.onCut(() => {
console.log('onCut method is triggered');
})
.key("onCutText")
TextArea({placeholder: "textArea-OnPaste" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的粘贴文字时触发
.onPaste(() => {
console.log("onPaste method is triggered")
})
.key("onPasteText")
TextArea({placeholder: "textArea-CopyOption" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
/**copyOption(value: boolean | CopyOption):
* 设置复制选项时调用
* InApp = 0,Share in app.
* LocalDevice = 1,Share in local device.
* CrossDevice = 2,Share cross device.
*/
.copyOption(0)
.key("copyOptionText")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextInputOnEditChange {
@State num: number = 0
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextInputOnEditChange start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextInputOnEditChange end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextInput({placeholder: "textInput-OnEditChange" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.onEditChange(() => {
console.log(`Input state changed ${this.num++}`)
})
.key("onEditChangeText")
TextInput({placeholder:"textInput-OnCut"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的文字被剪切时触发
.onCut(() =>{
console.log("onCut method is triggered")
})
.key("onCutText")
TextInput({placeholder:"textInput-OnPaste"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的粘贴文字时触发
.onPaste(() => {
console.log("onPaste method is triggered")
})
.key("onPasteText")
TextInput({placeholder:"textInput-CopyOption"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//设置复制选项时调用
.copyOption(0)
.key("copyOptionText")
TextInput({placeholder:"textInput-ShowPasswordIcon"})
.type(InputType.Password)
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//设置密码显示/隐藏图标时调用
.showPasswordIcon(true)
.key("showPasswordIconText")
}.width("100%").height("100%")
}
}
/*
* 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.
*/
.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;
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextPickerDefaultPickerItemHeight {
private select: number = 1
private fruits: string[] = ['1.apple', '2.orange','3.peach', '4.grape']
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextPickerDefaultPickerItemHeight start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextPickerDefaultPickerItemHeight end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextPicker({range: this.fruits, selected: this.select})
.onChange((value: string, index: number) => {
console.info('Picker item changed, value: ' + value + ', index: ' + index)
})
.defaultPickerItemHeight('80px')
.key("defaultPickerItemHeightText")
}.width("100%").height("100%")
}
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct VideoOnFullscreenChange {
@State srcs: Resource = $rawfile('videoTest.mp4');
@State currentProgressRates: number = 1;
@State autoPlays: boolean = false;
controller: VideoController = new VideoController();
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear VideoOnFullscreenChange start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear VideoOnFullscreenChange end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Video({
src: this.srcs,
currentProgressRate: this.currentProgressRates,
controller: this.controller
}).width(600).height(400)
.autoPlay(this.autoPlays)
.key("onFullscreenChangeText")
.onStart(() => {
console.error('onStart');
})
.onFullscreenChange(() => {
console.log('screen is changed')
console.info('screen is changed')
console.error('screen is changed')
console.warn('screen is changed')
})
.onPause(() => {
console.error('onPause');
})
.onFinish(() => {
console.error('onFinish');
})
.onError(() => {
console.error('onFinish');
})
.onPrepared((e) => {
console.error('onPrepared is ' + e.duration);
})
.onSeeking((e) => {
console.error('onSeeking is ' + e.time);
})
.onSeeked((e) => {
console.error('onSeekedis ' + e.time);
})
.onUpdate((e) => {
console.error('onUpdateis ' + e.time);
})
Row() {
Button("FullScreen").onClick(() => {
this.controller.requestFullscreen(true)
});
Button("ExitFullScreen").onClick(() => {
this.controller.exitFullscreen()
});
}
Row() {
Button("start").onClick(() => {
this.controller.start();
});
Button("pause").onClick(() => {
this.controller.pause();
});
Button("stop").onClick(() => {
this.controller.stop();
});
}
}.width("100%").height("100%")
}
}
......@@ -17,10 +17,48 @@ import alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
import circleNewJsunit from './circle.test.ets';
import ellipseNeJsunit from './ellipse.test.ets';
import gridMaxCountJsunit from './grid.test.ets';
import gridItemOnSelectJsunit from './gridItem.test.ets';
import inspectorJsunit from './inspector.test.ets'
import lazyForEachOnDataAddJsunit from './lazyForEach.test.ets';
import navigatorTargetJsunit from './navigator.test.ets'
import pathNewTest from './path.test.ets';
import polygonNewJsunit from './polygon.test.ets';
import polyLineNeJsunit from './polyLine.test.ets';
import progressScaleCountJsunit from './progress.test.ets';
import rectNeJsunit from './rect.test.ets';
import scrollOnScrollBeginJsunit from './scroll.test.ets';
import searchOnCutJsunit from './search.test.ets'
import swiperCurveJsunit from './swiper.test.ets';
import tabsBarPositionJsunit from './tabs.test.ets';
import textMinFontSizeJsunit from './text.test.ets';
import textAreaOnCutJsunit from './textArea.test.ets';
import textInputOnEditChangeJsunit from './textInput.test.ets';
import textPickerDefaultPickerItemHeightJsunit from './textPicker.test.ets';
import videoOnFullscreenChangeJsunit from './video.test.ets';
export default function testsuite() {
lazyForEachOnDataAddJsunit()
alphabetIndexerOnSelectJsunit()
checkBoxGroupSelectAllJsunit()
circleNewJsunit()
ellipseNeJsunit()
gridMaxCountJsunit()
gridItemOnSelectJsunit()
inspectorJsunit()
navigatorTargetJsunit()
pathNewTest()
polygonNewJsunit()
polyLineNeJsunit()
progressScaleCountJsunit()
rectNeJsunit()
scrollOnScrollBeginJsunit()
searchOnCutJsunit()
swiperCurveJsunit()
tabsBarPositionJsunit()
textMinFontSizeJsunit()
textAreaOnCutJsunit()
textInputOnEditChangeJsunit()
textPickerDefaultPickerItemHeightJsunit()
videoOnFullscreenChangeJsunit()
}
\ No newline at end of file
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import events_emitter from '@ohos.events.emitter';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function gridMaxCountJsunit() {
describe('gridMaxCountTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/grid',
}
try {
router.clear();
let pages = router.getState();
console.info("get grid state success " + JSON.stringify(pages));
if (!("grid" == pages.name)) {
console.info("get grid state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push grid page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push grid page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("gridMaxCount after each called");
});
it('testcheckgridMaxCount0001', 0, async function (done) {
console.info('testcheckgridMaxCount testcheckgridMaxCount0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('maxCountTest');
console.info("[testcheckgridMaxCount0001] component selectedMaxcount strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Grid');
expect(obj.$attrs.maxCount).assertEqual("5");
console.info("[testcheckgridMaxCount0001] selectedMaxCount value :" + obj.$attrs.maxCount);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
import events_emitter from '@ohos.events.emitter';
export default function gridItemOnSelectJsunit() {
describe('gridItemOnSelectTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/gridItem',
}
try {
router.clear();
let pages = router.getState();
console.info("get gridItem state success " + JSON.stringify(pages));
if (!("gridItem" == pages.name)) {
console.info("get gridItem state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push gridItem page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push gridItem page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("gridItemOnSelect after each called");
});
it('testgridItemOnSelect0001', 0, async function (done) {
console.info('testgridItemOnSelect testgridItemOnSelect0001 START');
await Utils.sleep(2000);
let callback = (indexEvent) => {
console.info("onSelect_0001 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.STATUS).assertEqual(true);
done();
}
let indexEvent = {
eventId: 10200,
priority: events_emitter.EventPriority.LOW
}
sendEventByKey('onSelected', 10, "")
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("onSelect_0001 on events_emitter err : " + JSON.stringify(err));
}
console.info('testgridItemOnSelect0001 END');
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import events_emitter from '@ohos.events.emitter';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function inspectorJsunit() {
describe('inspectorTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/inspector',
}
try {
router.clear();
let pages = router.getState();
console.info("get inspector state success " + JSON.stringify(pages));
if (!("inspector" == pages.name)) {
console.info("get inspector state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push inspector page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push inspector page error: " + err);
}
done()
});
afterEach(async function () {
console.info("inspectorTest after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testlazyForEachOnDataAdd0001
* @tc.desic acelazyForEachOnDataAddEtsTest0001
*/
it('testInspectorTestAdd0001', 0, async function (done) {
console.info('Inspector testInspectorTestAdd0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('inspectorApiOne');
console.info("[testInspectorTestAdd0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("50.00fp");
console.info("[testInspectorTestAdd0001] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testInspectorTestAdd0002
* @tc.desic aceTestInspectorTestAdd0002
*/
it('testInspectorTestAdd0002', 0, async function (done) {
console.info('Inspector testInspectorTestAdd0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('inspectorApiOne');
console.info("[testInspectorTestAdd0002] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold");
console.info("[testInspectorTestAdd0002] fontWeight value :" + obj.$attrs.fontWeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testInspectorTestAdd0003
* @tc.desic aceTestInspectorTestAdd0003
*/
it('testInspectorTestAdd0003', 0, async function (done) {
console.info("testInspectorTestAdd0003 start test");
var innerEvent1 = {
eventId: 101,
priority: events_emitter.EventPriority.LOW
}
var callback1 = (eventData) => {
console.info("eventData.data.getInspectorNodes result is: " + eventData.data.getInspectorNodes);
try{
console.info("callback1 success" );
console.info("inspector_101 eventData.data.result result is: " + eventData.data.result);
expect(eventData.data.result).assertEqual("success");
console.info("inspector_101 end: ");
if(eventData.data.getInspectorNodes != null){
console.info("eventData.data.result result is: " + eventData.data.result);
expect(eventData.data.result).assertEqual("success");
}
}catch(err){
console.info("inspector_101 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try {
events_emitter.on(innerEvent1, callback1);
console.info("inspector_101 click result is: " + JSON.stringify(sendEventByKey('inspectorApiOne', 10, "")));
} catch (err) {
console.info("inspector_101 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testInspectorTestAdd0004
* @tc.desic aceTestInspectorTestAdd0004
*/
it('testInspectorTestAdd0004', 0, async function (done) {
var innerEvent2 = {
eventId: 102,
priority: events_emitter.EventPriority.LOW
}
var callback2 = (eventData) => {
console.info("eventData.data.getInspectorNodeById result is: " + eventData.data.getInspectorNodeById);
try{
console.info("callback2 success" );
console.info("inspector_102 eventData.data.result result is: " + eventData.data.result);
expect(eventData.data.result).assertEqual("success");
console.info("inspector_102 end");
}catch(err){
console.info("inspector_102 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("inspector_102 click result is: " + JSON.stringify(sendEventByKey('inspectorApiTwo', 10, "")));
events_emitter.on(innerEvent2, callback2);
}catch(err){
console.info("inspector_102 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testInspectorTestAdd0005
* @tc.desic aceTestInspectorTestAdd0005
*/
it('testInspectorTestAdd0005', 0, async function (done) {
console.info('testInspectorTestAdd0005 START');
try {
var eventData = {
data: {
"setColor": 'red'
}
}
var innerEvent = {
eventId: 103,
priority: events_emitter.EventPriority.LOW
}
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testInspectorTestAdd0005] change component data error: " + err.message);
}
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testInspectorTestAdd0006
* @tc.desic aceTestInspectorTestAdd0006
*/
it('testInspectorTestAdd0006', 0, async function (done) {
var innerEvent3 = {
eventId: 103,
priority: events_emitter.EventPriority.LOW
}
var callback3 = (eventData) => {
try{
console.info("callback2 success" );
console.info("inspector_103 eventData.data.result result is: " + eventData.data.catchStatus);
expect(eventData.data.catchStatus).assertEqual("callBackSuccess");
console.info("inspector_103 end");
}catch(err){
console.info("inspector_103 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("inspector_103 click result is: " + JSON.stringify(sendEventByKey('inspectorApiFour', 10, "")));
events_emitter.on(innerEvent3, callback3);
}catch(err){
console.info("inspector_103 on events_emitter err : " + JSON.stringify(err));
}
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function lazyForEachOnDataAddJsunit() {
describe('lazyForEachOnDataAddTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/lazyForEach',
}
try {
router.clear();
let pages = router.getState();
console.info("get lazyForEach state success " + JSON.stringify(pages));
if (!("lazyForEach" == pages.name)) {
console.info("get lazyForEach state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push lazyForEach page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push lazyForEach page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("lazyForEachOnDataAdd after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testlazyForEachOnDataAdd0001
* @tc.desic acelazyForEachOnDataAddEtsTest0001
*/
it('testlazyForEachOnDataAdd0001', 0, async function (done) {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 START');
var innerEvent1 = {
eventId: 201,
priority: events_emitter.EventPriority.LOW
}
var callback1 = (eventData) => {
console.info("eventData.data.result1 result is: " + eventData.data.result1);
try{
console.info("callback1 success" );
console.info("Lazy_101 eventData.data.result1 result is: " + eventData.data.result1);
expect(eventData.data.result1).assertEqual(true);
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 END');
}catch(err){
console.info("Lazy_101 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("Lazy_101 click result is:" + JSON.stringify(sendEventByKey('listItemOne', 10, "")));
events_emitter.on(innerEvent1, callback1);
}catch(err){
console.info("Lazy_101 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testlazyForEachOnDataAdd0002
* @tc.desic acelazyForEachOnDataAddEtsTest0002
*/
it('testlazyForEachOnDataAdd0002', 0, async function (done) {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 START');
var innerEvent2 = {
eventId: 202,
priority: events_emitter.EventPriority.LOW
}
var callback2 = (eventData) => {
console.info("eventData.data.result2 result is: " + eventData.data.result2);
try{
console.info("callback2 success" );
console.info("Lazy_102 eventData.data.result2 result is: " + eventData.data.result2);
expect(eventData.data.result2).assertEqual(true);
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 END');
}catch(err){
console.info("Lazy_102 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("Lazy_102 click result is:" + JSON.stringify(sendEventByKey('listItemTwo', 10, "")));
events_emitter.on(innerEvent2, callback2);
}catch(err){
console.info("Lazy_102 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testlazyForEachOnDataAdd0003
* @tc.desic acelazyForEachOnDataAddEtsTest0003
*/
it('testlazyForEachOnDataAdd0003', 0, async function (done) {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 START');
var innerEvent3 = {
eventId: 203,
priority: events_emitter.EventPriority.LOW
}
var callback3 = (eventData) => {
console.info("eventData.data.result3 result is: " + eventData.data.result3);
try{
console.info("callback3 success" );
console.info("Lazy_103 eventData.data.result3 result is: " + eventData.data.result3);
expect(eventData.data.result3).assertEqual(true);
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 END');
}catch(err){
console.info("Lazy_103 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("Lazy_103 click result is:" + JSON.stringify(sendEventByKey('listItemThree', 10, "")));
events_emitter.on(innerEvent3, callback3);
}catch(err){
console.info("Lazy_103 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testlazyForEachOnDataAdd0004
* @tc.desic acelazyForEachOnDataAddEtsTest0004
*/
it('testlazyForEachOnDataAdd0004', 0, async function (done) {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 START');
var innerEvent4 = {
eventId: 204,
priority: events_emitter.EventPriority.LOW
}
var callback4 = (eventData) => {
console.info("eventData.data.result4 result is: " + eventData.data.result4);
try{
console.info("callback4 success" );
console.info("Lazy_104 eventData.data.result4 result is: " + eventData.data.result4);
expect(eventData.data.result4).assertEqual(true);
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 END');
}catch(err){
console.info("Lazy_104 on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("Lazy_104 click result is:" + JSON.stringify(sendEventByKey('listItemFour', 10, "")));
events_emitter.on(innerEvent4, callback4);
}catch(err){
console.info("Lazy_104 on events_emitter err : " + JSON.stringify(err));
}
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function navigatorTargetJsunit() {
describe('navigatorTargetTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/navigator',
}
try {
router.clear();
let pages = router.getState();
console.info("get navigator state success " + JSON.stringify(pages));
if (!("navigator" == pages.name)) {
console.info("get navigator state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push navigator page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push navigator page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("navigatorTarget after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testnavigatorTarget0001
* @tc.desic acenavigatorTargetEtsTest0001
*/
it('testnavigatorTarget0001', 0, async function (done) {
console.info('navigatorTarget testnavigatorTarget0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Navigator');
console.info("[testnavigatorTarget0001] component strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Navigator');
expect(obj.$attrs.target).assertEqual("pages/index");
console.info("[testnavigatorTarget0001] target value :" + obj.$attrs.target);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function pathNewTest() {
describe('pathNewTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/path',
}
try {
router.clear();
let pages = router.getState();
console.info("get path state success " + JSON.stringify(pages));
if (!("path" == pages.name)) {
console.info("get path state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push path page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push path page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("pathNe after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testpathNe0001
* @tc.desic acepathNeEtsTest0001
*/
it('testpathNe0001', 0, async function (done) {
console.info('pathNe testpathNe0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Path');
console.info("[testpathNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.width).assertEqual("150.00px");
console.info("[testpathNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testpathNe0002
* @tc.desic acepathNeEtsTest0002
*/
it('testpathNe0002', 0, async function (done) {
console.info('pathNe testpathNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Path');
console.info("[testpathNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.height).assertEqual("150.00px");
console.info("[testpathNe0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testpathNe0003
* @tc.desic acepathNeEtsTest0003
*/
it('testpathNe0003', 0, async function (done) {
console.info('pathNe testpathNe0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Path');
console.info("[testpathNe0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.commands).assertEqual("M150 0 L300 300 L0 300 Z");
console.info("[testpathNe0003] commands value :" + obj.$attrs.commands);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function polyLineNeJsunit() {
describe('polyLineNeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/polyLine',
}
try {
router.clear();
let pages = router.getState();
console.info("get polyLine state success " + JSON.stringify(pages));
if (!("polyLine" == pages.name)) {
console.info("get polyLine state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push polyLine page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push polyLine page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("polyLineNe after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testpolyLineNe0001
* @tc.desic acepolyLineNeEtsTest0001
*/
it('testpolyLineNe0001', 0, async function (done) {
console.info('polyLineNe testpolyLineNe0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Polyline');
console.info("[testpolyLineNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.width).assertEqual("150.00px");
console.info("[testpolyLineNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testpolyLineNe0002
* @tc.desic acepolyLineNeEtsTest0002
*/
it('testpolyLineNe0002', 0, async function (done) {
console.info('polyLineNe testpolyLineNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Polyline');
console.info("[testpolyLineNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.height).assertEqual("150.00px");
console.info("[testpolyLineNe0002] height value :" + obj.$attrs.height);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function polygonNewJsunit() {
describe('polygonNewJsunit', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/polygon',
}
try {
router.clear();
let pages = router.getState();
console.info("get polygon state success " + JSON.stringify(pages));
if (!("polygon" == pages.name)) {
console.info("get polygon state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push polygon page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push polygon page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("polygonNe after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testpolygonNe0001
* @tc.desic acepolygonNeEtsTest0001
*/
it('testpolygonNe0001', 0, async function (done) {
console.info('polygonNe testpolygonNe0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Polygon');
console.info("[testpolygonNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.width).assertEqual("150.00px");
console.info("[testpolygonNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testpolygonNe0002
* @tc.desic acepolygonNeEtsTest0002
*/
it('testpolygonNe0002', 0, async function (done) {
console.info('polygonNe testpolygonNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Polygon');
console.info("[testpolygonNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.height).assertEqual("150.00px");
console.info("[testpolygonNe0002] height value :" + obj.$attrs.height);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function progressStyleJsunit() {
describe('progressStyleTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/progress',
}
try {
router.clear();
let pages = router.getState();
console.info("get progress state success " + JSON.stringify(pages));
if (!("progress" == pages.name)) {
console.info("get progress state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push progress page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push progress page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("progressStyle after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testprogressStyle0001
* @tc.desic aceprogressStyleEtsTest0001
*/
it('testprogressStyle0001', 0, async function (done) {
console.info('progressStyle testprogressStyle0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testprogressStyle0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testprogressStyle0002
* @tc.desic aceprogressStyleEtsTest0002
*/
it('testprogressStyle0002', 0, async function (done) {
console.info('progressStyle testprogressStyle0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0002] component color strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.color).assertEqual("#FF008000");
console.info("[testprogressStyle0002] color value :" + obj.$attrs.color);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testprogressStyle0003
* @tc.desic aceprogressStyleEtsTest0003
*/
it('testprogressStyle0003', 0, async function (done) {
console.info('progressStyle testprogressStyle0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0003] component value strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.value).assertEqual("50.000000");
console.info("[testprogressStyle0003] value value :" + obj.$attrs.value);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testprogressStyle0004
* @tc.desic aceprogressStyleEtsTest0004
*/
it('testprogressStyle0004', 0, async function (done) {
console.info('progressStyle testprogressStyle0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0004] component style strokeWidth strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.strokeWidth).assertEqual("20.00vp");
console.info("[testprogressStyle0004] style strokeWidth value :" + obj.$attrs.style.strokeWidth);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testprogressStyle0005
* @tc.desic aceprogressStyleEtsTest0005
*/
it('testprogressStyle0005', 0, async function (done) {
console.info('progressStyle testprogressStyle0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0005] component style scaleCount strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.scaleCount).assertEqual("30");
console.info("[testprogressStyle0005] style scaleCount value :" + obj.$attrs.style.scaleCount);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testprogressStyle0006
* @tc.desic aceprogressStyleEtsTest0006
*/
it('testprogressStyle0006', 0, async function (done) {
console.info('progressStyle testprogressStyle0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0006] component style scaleWidth strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.scaleWidth).assertEqual("20.00vp");
console.info("[testprogressStyle0006] style scaleWidth value :" + obj.$attrs.style.scaleWidth);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function rectNeJsunit() {
describe('rectNeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/rect',
}
try {
router.clear();
let pages = router.getState();
console.info("get rect state success " + JSON.stringify(pages));
if (!("rect" == pages.name)) {
console.info("get rect state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push rect page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push rect page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("rectNe after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testrectNe0001
* @tc.desic acerectNeEtsTest0001
*/
it('testrectNe0001', 0, async function (done) {
console.info('rectNe testrectNe0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Rect');
console.info("[testrectNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.width).assertEqual("90.00%");
console.info("[testrectNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testrectNe0002
* @tc.desic acerectNeEtsTest0002
*/
it('testrectNe0002', 0, async function (done) {
console.info('rectNe testrectNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Rect');
console.info("[testrectNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.height).assertEqual("75.00px");
console.info("[testrectNe0002] height value :" + obj.$attrs.height);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
import events_emitter from '@ohos.events.emitter';
export default function scrollOnScrollBeginJsunit() {
describe('scrollOnScrollBeginTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/scroll',
}
try {
router.clear();
let pages = router.getState();
console.info("get scroll state success " + JSON.stringify(pages));
if (!("scroll" == pages.name)) {
console.info("get scroll state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push scroll page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push scroll page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("scrollOnScrollBegin after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testscrollOnScrollBegin0001
* @tc.desic acescrollOnScrollBeginEtsTest0001
*/
it('testscrollOnScrollBegin0001', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Scroll');
console.info("[testscrollOnScrollBegin0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.width).assertEqual("100.00%");
console.info("[testscrollOnScrollBegin0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testscrollOnScrollBegin0002
* @tc.desic acescrollOnScrollBeginEtsTest0002
*/
it('testscrollOnScrollBegin0002', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Scroll');
console.info("[testscrollOnScrollBegin0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.height).assertEqual("100.00%");
console.info("[testscrollOnScrollBegin0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testscrollOnScrollBegin0003
* @tc.desic acescrollOnScrollBeginEtsTest0003
*/
it('testscrollOnScrollBegin0003', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Scroll');
console.info("[testscrollOnScrollBegin0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.scrollBar).assertEqual("BarState.On");
console.info("[testscrollOnScrollBegin0003] scrollBar value :" + obj.$attrs.scrollBar);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testscrollOnScrollBegin0004
* @tc.desic acescrollOnScrollBeginEtsTest0004
*/
it('testscrollOnScrollBegin0004', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Scroll');
console.info("[testscrollOnScrollBegin0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.scrollBarColor).assertEqual("#FF808080");
console.info("[testscrollOnScrollBegin0004] scrollBarColor value :" + obj.$attrs.scrollBarColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testscrollOnScrollBegin0005
* @tc.desic acescrollOnScrollBeginEtsTest0005
*/
it('testscrollOnScrollBegin0005', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Scroll');
console.info("[testscrollOnScrollBegin0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Scroll');
expect(obj.$attrs.scrollBarWidth).assertEqual("30.00px");
console.info("[testscrollOnScrollBegin0005] scrollBarWidth value :" + obj.$attrs.scrollBarWidth);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0012
* @tc.name testscrollOnScrollBegin0005
* @tc.desic acescrollOnScrollBeginEtsTest0006
*/
it('testscrollOnScrollBegin0006', 0, async function (done) {
console.info('scrollOnScrollBegin testscrollOnScrollBegin0006 START');
await Utils.sleep(2000);
let callback = (indexEvent) => {
console.info("scrollOnScrollBegin get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.STATUS).assertEqual(true);
}
let indexEvent = {
eventId: 10086,
priority: events_emitter.EventPriority.LOW
}
sendEventByKey('Scroll', 10, "")
try {
events_emitter.on(indexEvent, callback);
} catch (err) {
console.info("scrollOnScrollBegin on events_emitter err : " + JSON.stringify(err));
}
console.info('testscrollOnScrollBegin0006 END');
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function searchOnCutJsunit() {
describe('searchOnCutTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/search',
}
try {
router.clear();
let pages = router.getState();
console.info("get search state success " + JSON.stringify(pages));
if (!("search" == pages.name)) {
console.info("get search state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push search page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push search page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("searchOnCut after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testsearchOnCut0001
* @tc.desic acesearchOnCutEtsTest0001
*/
it('testsearchOnCut0001', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("320.00vp");
console.info("[testsearchOnCut0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testsearchOnCut0002
* @tc.desic acesearchOnCutEtsTest0002
*/
it('testsearchOnCut0002', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testsearchOnCut0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testsearchOnCut0003
* @tc.desic acesearchOnCutEtsTest0003
*/
it('testsearchOnCut0003', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testsearchOnCut0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testsearchOnCut0004
* @tc.desic acesearchOnCutEtsTest0004
*/
it('testsearchOnCut0004', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testsearchOnCut0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testsearchOnCut0005
* @tc.desic acesearchOnCutEtsTest0005
*/
it('testsearchOnCut0005', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testsearchOnCut0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testsearchOnCut0006
* @tc.desic acesearchOnCutEtsTest0006
*/
it('testsearchOnCut0006', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testsearchOnCut0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testsearchOnCut0007
* @tc.desic acesearchOnCutEtsTest0007
*/
it('testsearchOnCut0007', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testsearchOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testsearchOnCut0009
* @tc.desic acesearchOnCutEtsTest0009
*/
it('testsearchOnCut0009', 0, async function (done) {
console.info('searchOnCut testsearchOnCut009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testsearchOnCut0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testsearchOnCut0010
* @tc.desic acesearchOnCutEtsTest0010
*/
it('testsearchOnCut0010', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testsearchOnCut0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function swiperCurveJsunit() {
describe('swiperCurveTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/swiper',
}
try {
router.clear();
let pages = router.getState();
console.info("get swiper state success " + JSON.stringify(pages));
if (!("swiper" == pages.name)) {
console.info("get swiper state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push swiper page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push swiper page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("swiperCurve after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testswiperCurve0001
* @tc.desic aceswiperCurveEtsTest0001
*/
it('testswiperCurve0001', 0, async function (done) {
console.info('swiperCurve testswiperCurve0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testswiperCurve0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testswiperCurve0002
* @tc.desic aceswiperCurveEtsTest0002
*/
it('testswiperCurve0002', 0, async function (done) {
console.info('swiperCurve testswiperCurve0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testswiperCurve0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testswiperCurve0003
* @tc.desic aceswiperCurveEtsTest0003
*/
it('testswiperCurve0003', 0, async function (done) {
console.info('swiperCurve testswiperCurve0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testswiperCurve0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testswiperCurve0004
* @tc.desic aceswiperCurveEtsTest0004
*/
it('testswiperCurve0004', 0, async function (done) {
console.info('swiperCurve testswiperCurve0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testswiperCurve0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testswiperCurve0005
* @tc.desic aceswiperCurveEtsTest0005
*/
it('testswiperCurve0005', 0, async function (done) {
console.info('swiperCurve testswiperCurve0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testswiperCurve0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testswiperCurve0006
* @tc.desic aceswiperCurveEtsTest0006
*/
it('testswiperCurve0006', 0, async function (done) {
console.info('swiperCurve testswiperCurve0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testswiperCurve0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testswiperCurve0007
* @tc.desic aceswiperCurveEtsTest0007
*/
it('testswiperCurve0007', 0, async function (done) {
console.info('swiperCurve testswiperCurve0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testswiperCurve0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testswiperCurve0009
* @tc.desic aceswiperCurveEtsTest0009
*/
it('testswiperCurve0009', 0, async function (done) {
console.info('swiperCurve testswiperCurve009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testswiperCurve0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testswiperCurve0010
* @tc.desic aceswiperCurveEtsTest0010
*/
it('testswiperCurve0010', 0, async function (done) {
console.info('swiperCurve testswiperCurve0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testswiperCurve0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function tabsBarPositionJsunit() {
describe('tabsBarPositionTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/tabs',
}
try {
router.clear();
let pages = router.getState();
console.info("get tabs state success " + JSON.stringify(pages));
if (!("tabs" == pages.name)) {
console.info("get tabs state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push tabs page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push tabs page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("tabsBarPosition after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtabsBarPosition0001
* @tc.desic acetabsBarPositionEtsTest0001
*/
it('testtabsBarPosition0001', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtabsBarPosition0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtabsBarPosition0002
* @tc.desic acetabsBarPositionEtsTest0002
*/
it('testtabsBarPosition0002', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtabsBarPosition0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtabsBarPosition0003
* @tc.desic acetabsBarPositionEtsTest0003
*/
it('testtabsBarPosition0003', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtabsBarPosition0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtabsBarPosition0004
* @tc.desic acetabsBarPositionEtsTest0004
*/
it('testtabsBarPosition0004', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtabsBarPosition0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtabsBarPosition0005
* @tc.desic acetabsBarPositionEtsTest0005
*/
it('testtabsBarPosition0005', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtabsBarPosition0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtabsBarPosition0006
* @tc.desic acetabsBarPositionEtsTest0006
*/
it('testtabsBarPosition0006', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtabsBarPosition0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtabsBarPosition0007
* @tc.desic acetabsBarPositionEtsTest0007
*/
it('testtabsBarPosition0007', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testtabsBarPosition0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtabsBarPosition0009
* @tc.desic acetabsBarPositionEtsTest0009
*/
it('testtabsBarPosition0009', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testtabsBarPosition0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtabsBarPosition0010
* @tc.desic acetabsBarPositionEtsTest0010
*/
it('testtabsBarPosition0010', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function textMinFontSizeJsunit() {
describe('textMinFontSizeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/text',
}
try {
router.clear();
let pages = router.getState();
console.info("get text state success " + JSON.stringify(pages));
if (!("text" == pages.name)) {
console.info("get text state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push text page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push text page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textMinFontSize after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextMinFontSize0001
* @tc.desic acetextMinFontSizeEtsTest0001
*/
it('testtextMinFontSize0001', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextMinFontSize0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextMinFontSize0002
* @tc.desic acetextMinFontSizeEtsTest0002
*/
it('testtextMinFontSize0002', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextMinFontSize0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextMinFontSize0003
* @tc.desic acetextMinFontSizeEtsTest0003
*/
it('testtextMinFontSize0003', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("30.00px");
console.info("[testtextMinFontSize0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextMinFontSize0004
* @tc.desic acetextMinFontSizeEtsTest0004
*/
it('testtextMinFontSize0004', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextMinFontSize0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextMinFontSize0005
* @tc.desic acetextMinFontSizeEtsTest0005
*/
it('testtextMinFontSize0005', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextMinFontSize0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextMinFontSize0006
* @tc.desic acetextMinFontSizeEtsTest0006
*/
it('testtextMinFontSize0006', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextMinFontSize0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextMinFontSize0007
* @tc.desic acetextMinFontSizeEtsTest0007
*/
it('testtextMinFontSize0007', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testtextMinFontSize0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextMinFontSize0009
* @tc.desic acetextMinFontSizeEtsTest0009
*/
it('testtextMinFontSize0009', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testtextMinFontSize0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextMinFontSize0010
* @tc.desic acetextMinFontSizeEtsTest0010
*/
it('testtextMinFontSize0010', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testtextMinFontSize0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function textAreaOnCutJsunit() {
describe('textAreaOnCutTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textArea',
}
try {
router.clear();
let pages = router.getState();
console.info("get textArea state success " + JSON.stringify(pages));
if (!("textArea" == pages.name)) {
console.info("get textArea state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textArea page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textArea page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textAreaOnCut after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextAreaOnCut0001
* @tc.desic acetextAreaOnCutEtsTest0001
*/
it('testtextAreaOnCut0001', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextAreaOnCut0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextAreaOnCut0002
* @tc.desic acetextAreaOnCutEtsTest0002
*/
it('testtextAreaOnCut0002', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextAreaOnCut0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextAreaOnCut0003
* @tc.desic acetextAreaOnCutEtsTest0003
*/
it('testtextAreaOnCut0003', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtextAreaOnCut0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextAreaOnCut0004
* @tc.desic acetextAreaOnCutEtsTest0004
*/
it('testtextAreaOnCut0004', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextAreaOnCut0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextAreaOnCut0005
* @tc.desic acetextAreaOnCutEtsTest0005
*/
it('testtextAreaOnCut0005', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextAreaOnCut0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextAreaOnCut0006
* @tc.desic acetextAreaOnCutEtsTest0006
*/
it('testtextAreaOnCut0006', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextAreaOnCut0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextAreaOnCut0007
* @tc.desic acetextAreaOnCutEtsTest0007
*/
it('testtextAreaOnCut0007', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextAreaOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextAreaOnCut0009
* @tc.desic acetextAreaOnCutEtsTest0009
*/
it('testtextAreaOnCut0009', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextAreaOnCut0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextAreaOnCut0010
* @tc.desic acetextAreaOnCutEtsTest0010
*/
it('testtextAreaOnCut0010', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center");
console.info("[testtextAreaOnCut0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function textInputOnEditChangeJsunit() {
describe('textInputOnEditChangeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textInput',
}
try {
router.clear();
let pages = router.getState();
console.info("get textInput state success " + JSON.stringify(pages));
if (!("textInput" == pages.name)) {
console.info("get textInput state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textInput page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textInput page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textInputOnEditChange after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextInputOnEditChange0001
* @tc.desic acetextInputOnEditChangeEtsTest0001
*/
it('testtextInputOnEditChange0001', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextInputOnEditChange0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextInputOnEditChange0002
* @tc.desic acetextInputOnEditChangeEtsTest0002
*/
it('testtextInputOnEditChange0002', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextInputOnEditChange0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextInputOnEditChange0003
* @tc.desic acetextInputOnEditChangeEtsTest0003
*/
it('testtextInputOnEditChange0003', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtextInputOnEditChange0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextInputOnEditChange0004
* @tc.desic acetextInputOnEditChangeEtsTest0004
*/
it('testtextInputOnEditChange0004', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextInputOnEditChange0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextInputOnEditChange0005
* @tc.desic acetextInputOnEditChangeEtsTest0005
*/
it('testtextInputOnEditChange0005', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextInputOnEditChange0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextInputOnEditChange0006
* @tc.desic acetextInputOnEditChangeEtsTest0006
*/
it('testtextInputOnEditChange0006', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextInputOnEditChange0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextInputOnEditChange0007
* @tc.desic acetextInputOnEditChangeEtsTest0007
*/
it('testtextInputOnEditChange0007', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextInputOnEditChange0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextInputOnEditChange0009
* @tc.desic acetextInputOnEditChangeEtsTest0009
*/
it('testtextInputOnEditChange0009', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextInputOnEditChange0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextInputOnEditChange0010
* @tc.desic acetextInputOnEditChangeEtsTest0010
*/
it('testtextInputOnEditChange0010', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.textAlign).assertEqual(undefined);
console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function textPickerDefaultPickerItemHeightJsunit() {
describe('textPickerDefaultPickerItemHeightTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textPicker',
}
try {
router.clear();
let pages = router.getState();
console.info("get textPicker state success " + JSON.stringify(pages));
if (!("textPicker" == pages.name)) {
console.info("get textPicker state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textPicker page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textPicker page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textPickerDefaultPickerItemHeight after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextPickerDefaultPickerItemHeight0001
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0001
*/
it('testtextPickerDefaultPickerItemHeight0001', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.width).assertEqual("-");
console.info("[testtextPickerDefaultPickerItemHeight0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextPickerDefaultPickerItemHeight0002
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0002
*/
it('testtextPickerDefaultPickerItemHeight0002', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.height).assertEqual("-");
console.info("[testtextPickerDefaultPickerItemHeight0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextPickerDefaultPickerItemHeight0003
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0003
*/
it('testtextPickerDefaultPickerItemHeight0003', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.fontSize).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextPickerDefaultPickerItemHeight0004
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0004
*/
it('testtextPickerDefaultPickerItemHeight0004', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextPickerDefaultPickerItemHeight0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextPickerDefaultPickerItemHeight0005
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0005
*/
it('testtextPickerDefaultPickerItemHeight0005', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.align).assertEqual("Alignment.Center");
console.info("[testtextPickerDefaultPickerItemHeight0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextPickerDefaultPickerItemHeight0006
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0006
*/
it('testtextPickerDefaultPickerItemHeight0006', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.fontColor).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextPickerDefaultPickerItemHeight0007
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0007
*/
it('testtextPickerDefaultPickerItemHeight0007', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextPickerDefaultPickerItemHeight0009
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0009
*/
it('testtextPickerDefaultPickerItemHeight0009', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextPickerDefaultPickerItemHeight0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextPickerDefaultPickerItemHeight0010
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0010
*/
it('testtextPickerDefaultPickerItemHeight0010', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.textAlign).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
......@@ -231,7 +231,7 @@ export default function spanJsunit() {
console.info("[testSpan009] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testSpan009] fontColor:" + obj);
expect(obj.$attrs.fontColor).assertEqual('#FFFFFFFF');
expect(obj.$attrs.fontColor).assertEqual('#FF000000');
done();
});
})
......
此差异已折叠。
{
"string":[
{
"name":"app_name",
"value":"ohosProject"
}
]
}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册