提交 4e48836b 编写于 作者: B bayanxing

代码同步

Signed-off-by: Nbayanxing <bayanxing@kaihong.com>
上级 79085da5
......@@ -78,7 +78,10 @@
"pages/circle",
"pages/common",
"pages/common_ts_ets_api",
"pages/curves",
"pages/ellipse",
"pages/featureAbility",
"pages/form_component",
"pages/gauge",
"pages/grid",
"pages/grid_col",
......@@ -98,9 +101,11 @@
"pages/progress",
"pages/prompt",
"pages/rect",
"pages/router",
"pages/scroll",
"pages/search",
"pages/select",
"pages/shape",
"pages/sideBar",
"pages/stack",
"pages/stateManagement",
......@@ -110,6 +115,7 @@
"pages/textArea",
"pages/textInput",
"pages/textPicker",
"pages/uiAppearance",
"pages/video",
"pages/web",
"pages/xcomponent"
......
......@@ -112,7 +112,7 @@ export default struct CommonBackgroundBlurStyle {
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("hoverEffectText")
.key("hoverEffectScaleText")
.hoverEffect(HoverEffect.Scale)
Text("common-OnKeyEvent")
......
......@@ -90,6 +90,22 @@ export default struct Common_ts_ets_apiStaticClear {
.onClick(() => {
var enable = AppStorage.Get("accessibilityEnabled");
console.log(enable.toString())
try {
var backData = {
data: {
"Result": (enable != null)
}
}
let backEvent = {
eventId: 60231,
priority: events_emitter.EventPriority.LOW
}
console.info("PersistProp start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("PersistProp emit action state err: " + JSON.stringify(err.message))
}
})
Text(`common_ts_ets_api-PersistProp : ${this.highScore}`)
......@@ -107,6 +123,21 @@ export default struct Common_ts_ets_apiStaticClear {
.key("PersistPropText")
.onClick(() => {
this.highScore = this.highScore + 1
try {
var backData = {
data: {
"Score": this.highScore
}
}
let backEvent = {
eventId: 60230,
priority: events_emitter.EventPriority.LOW
}
console.info("PersistProp start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("PersistProp emit action state err: " + JSON.stringify(err.message))
}
})
}.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';
import Curves from '@ohos.curves'
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct CurvesSteps {
@State curveApi:string = "success"
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear CurvesSteps start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear CurvesSteps end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("curves-Steps")
.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("stepsText")
.onClick(() => {
try{
let curve = Curves.steps(1, true)
console.info("curve is" + curve)
this.curveApi = "callBackSuccess"
}catch(err){
console.info("curve onClick err: " + JSON.stringify(err.message))
this.curveApi = "callBackFail"
}
try {
var backData = {
data: {
"curveApi": this.curveApi,
}
}
let backEvent = {
eventId: 60229,
priority: events_emitter.EventPriority.LOW
}
console.info("curveApi onClick start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("curveApi onClick emit action state err: " + JSON.stringify(err.message))
}
})
}.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 FeatureAbilityStartAbility {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear FeatureAbilityStartAbility start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear FeatureAbilityStartAbility end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("featureAbility-StartAbility")
.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("startAbilityText")
.onClick(() => {
FeatureAbility.startAbility({
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility"
})
})
Text("featureAbility-StartAbilityForResult")
.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("startAbilityForResultText")
.onClick(() => {
FeatureAbility.startAbilityForResult({
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility" })
})
Text("featureAbility-FinishWithResult")
.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("finishWithResultText")
.onClick(() => {
FeatureAbility.finishWithResult({ code: 200, result: null })
})
Text("featureAbility-GetDeviceList")
.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("getDeviceListText")
.onClick(() => {
FeatureAbility.getDeviceList(1)
})
Text("featureAbility-CallAbility")
.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("callAbilityText")
.onClick(() => {
FeatureAbility.callAbility({
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility",
messageCode: 200,
abilityType: 1
})
})
Text("featureAbility-ContinueAbility")
.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("continueAbilityText")
.onClick(() => {
FeatureAbility.continueAbility()
})
Text("featureAbility-SubscribeAbilityEvent")
.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("subscribeAbilityEventText")
.onClick(() => {
FeatureAbility.subscribeAbilityEvent({
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility",
messageCode: 200,
abilityType: 1
}, () => {
})
})
Text("featureAbility-UnsubscribeAbilityEvent")
.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("unsubscribeAbilityEventText")
.onClick(() => {
FeatureAbility.unsubscribeAbilityEvent({
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility",
messageCode: 200,
abilityType: 1
})
})
Text("featureAbility-SendMsg")
.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("sendMsgText")
.onClick(() => {
FeatureAbility.sendMsg({
deviceId: '1001',
bundleName: "com.example.testapp",
abilityName: "com.example.testApp.MainAbility",
message: 'success',
success: () => {
Log.showInfo(TAG, `FeatureAbility.sendMsg success`)
},
fail: (data, code) => {
Log.showInfo(TAG, `FeatureAbility.sendMsg fail: data: ${data},code: ${code}`)
},
complete: () => {
Log.showInfo(TAG, `FeatureAbility.sendMsg complete`)
}
})
})
Text("featureAbility-SubscribeMsg")
.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("subscribeMsgText")
.onClick(() => {
FeatureAbility.subscribeMsg({
success: (data) => {
Log.showInfo(TAG, `FeatureAbility.subscribeMsg success: data: ${JSON.stringify(data)}`)
},
fail: (data, code) => {
Log.showInfo(TAG, `FeatureAbility.subscribeMsg fail: data: ${data},code: ${code}`)
}
})
})
Text("featureAbility-UnsubscribeMsg")
.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("unsubscribeMsgText")
.onClick(() => {
FeatureAbility.unsubscribeMsg()
})
}.width("100%").height("100%")
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct Index {
@State formId: number = 0;
@State bundle: string = "com.form.formsystemtestservicea.hmservice";
@State ability: string = "com.form.formsystemtestservicea.hmservice.MainAbility";
@State moduleName: string = "entry";
@State name: string = "Form_Js001";
@State allowUpate: boolean = true;
@State isShowing: boolean = true;
private dimension: FormDimension = FormDimension.Dimension_1_2;
private deleteForm = false;
private deleteId = "-1";
private temporaryId="-1";
private temporary = false;
private castForm = false;
build() {
Column() {
Text('form component test begin')
Column() {
FormComponent({
id: this.formId,
name: this.name,
bundle: this.bundle,
ability: this.ability,
module: this.moduleName,
dimension: this.dimension,
temporary: this.temporary,
})
.allowUpdate(this.allowUpate)
.visibility(this.isShowing ? Visibility.Visible : Visibility.Hidden)
.onUninstall((info) => {
console.log("[FormComponent] onUninstall:" + JSON.stringify(info));
})
.onError((error) => {
console.log("[FormComponent.host] error code:" + error.errcode);
console.log("[FormComponent.host] error msg:" + error.msg);
})
}
.backgroundColor(Color.White)
Text('form component test end')
}
.backgroundColor(Color.White)
}
}
/**
* 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 router1 from '@ohos.router'
import router2 from '@system.router'
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct RouterEnableAlertBeforeBackPage {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear RouterEnableAlertBeforeBackPage start`)
router1.enableAlertBeforeBackPage({
message: 'Message Info'
})
router2.enableAlertBeforeBackPage({
message: 'Message Info',
success: function () {
console.log('success')
},
cancel: function () {
console.log('fail')
},
})
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear RouterEnableAlertBeforeBackPage end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("ohos-router-EnableAlertBeforeBackPage")
.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("enableAlertBeforeBackPageText")
.onClick(() => {
router1.back()
})
Text("router-DisableAlertBeforeBackPage")
.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("disableAlertBeforeBackPageText")
.onClick(() => {
router1.disableAlertBeforeBackPage()
})
Text("router-EnableAlertBeforeBackPage")
.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("enableAlertBeforeBackPageText1")
.onClick(() => {
router2.back()
})
Text("router-DisableAlertBeforeBackPage")
.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("disableAlertBeforeBackPageText")
.onClick(() => {
router2.disableAlertBeforeBackPage()
})
}.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';
let my_shape = new Shape()
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct ShapeNe {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear ShapeNe start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear ShapeNe end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("shape-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")
}.width("100%").height("100%")
}
}
......@@ -68,36 +68,37 @@ struct SwiperCurve {
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 })
Swiper(this.swiperController) {
LazyForEach(this.data, (item: string) => {
Text(item).width('90%').height(160).backgroundColor(0xAFEEEE).textAlign(TextAlign.Center).fontSize(20)
}, item => item)
}
.key("swiper")
.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")
......@@ -113,7 +114,7 @@ struct SwiperCurve {
.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 uiAppearanceSetDarkMode {
xcomponentController: XComponentController = new XComponentController()
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear uiAppearanceSetDarkMode start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear uiAppearanceSetDarkMode end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("uiAppearance-setDarkMode1")
.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("uiAppearance-setDarkMode1Text")
.onClick(() => {
uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK, (err) => {
console.info(`uiAppearance.setDarkMode: ${err}`);
})
})
Text("uiAppearance-getDarkMode")
.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("uiAppearance-getDarkModeText")
.onClick(() => {
console.log('uiAppearance.getDarkMode: ' + JSON.stringify(uiAppearance.getDarkMode()))
})
Text("uiAppearance-setDarkMode2")
.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("uiAppearance-setDarkMode2Text")
.onClick(() => {
uiAppearance.setDarkMode(uiAppearance.DarkMode.ALWAYS_DARK)
})
}.width("100%").height("100%")
}
}
......@@ -16,8 +16,11 @@
import alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
import circleNewJsunit from './circle.test.ets';
import curvesStepsJsunit from './curves.test.ets';
import commonBackgroundBlurStyleJsunit from './common.test.ets';
import common_ts_ets_apiStaticClearJsunit from './common_ts_ets_api.test.ets';
import ellipseNeJsunit from './ellipse.test.ets';
import featureAbilityStartAbilityJsunit from './featureAbility.test.ets';
import gaugeColorsJsunit from './gauge.test.ets';
import gestureSetDirectionJsunit from './gesture.test.ets';
import gridMaxCountJsunit from './grid.test.ets';
......@@ -31,6 +34,7 @@ import listNewJsunit from './listTest.test.ets';
import list_itemOnSelectJsunit from './list_item.test.ets';
import mediaQueryOffJsunit from './mediaQuery.test.ets';
import navigatorTargetJsunit from './navigator.test.ets'
import panelBackgroundMaskJsunit from './panel.test.ets';
import pathNewTest from './path.test.ets';
import polygonNewJsunit from './polygon.test.ets';
import polyLineNeJsunit from './polyLine.test.ets';
......@@ -54,42 +58,45 @@ import webGetTitleJsunit from './web.test.ets';
import xcomponentGetXComponentContextJsunit from './xcomponent.test.ets';
export default function testsuite() {
lazyForEachOnDataAddJsunit()
alphabetIndexerOnSelectJsunit()
checkBoxGroupSelectAllJsunit()
circleNewJsunit()
// lazyForEachOnDataAddJsunit()
// alphabetIndexerOnSelectJsunit()
// checkBoxGroupSelectAllJsunit()
// circleNewJsunit()
curvesStepsJsunit()
common_ts_ets_apiStaticClearJsunit()
commonBackgroundBlurStyleJsunit()
ellipseNeJsunit()
gaugeColorsJsunit()
gestureSetDirectionJsunit()
grid_rowOnBreakpointChangeJsunit()
gridMaxCountJsunit()
gridItemOnSelectJsunit()
inspectorJsunit()
lineNeJsunit()
listNewJsunit()
list_itemOnSelectJsunit()
mediaQueryOffJsunit()
navigatorTargetJsunit()
pathNewTest()
polygonNewJsunit()
polyLineNeJsunit()
progressScaleCountJsunit()
promptShowDialogJsunit()
rectNeJsunit()
scrollOnScrollBeginJsunit()
searchOnCutJsunit()
selectOnSelectJsunit()
sideBarShowSideBarJsunit()
stackAlignContentJsunit()
stateManagementGetSharedJsunit()
// ellipseNeJsunit()
featureAbilityStartAbilityJsunit()
// gaugeColorsJsunit()
// gestureSetDirectionJsunit()
// gridMaxCountJsunit()
// gridItemOnSelectJsunit()
// inspectorJsunit()
// lineNeJsunit()
// listNewJsunit()
// list_itemOnSelectJsunit()
// mediaQueryOffJsunit()
// navigatorTargetJsunit()
panelBackgroundMaskJsunit()
// pathNewTest()
// polygonNewJsunit()
// polyLineNeJsunit()
// progressScaleCountJsunit()
// promptShowDialogJsunit()
// rectNeJsunit()
// scrollOnScrollBeginJsunit()
// searchOnCutJsunit()
// selectOnSelectJsunit()
// sideBarShowSideBarJsunit()
// stackAlignContentJsunit()
// stateManagementGetSharedJsunit()
swiperCurveJsunit()
tabsBarPositionJsunit()
textMinFontSizeJsunit()
// textMinFontSizeJsunit()
textAreaOnCutJsunit()
textInputOnEditChangeJsunit()
textPickerDefaultPickerItemHeightJsunit()
videoOnFullscreenChangeJsunit()
webGetTitleJsunit()
xcomponentGetXComponentContextJsunit()
// videoOnFullscreenChangeJsunit()
// webGetTitleJsunit()
// xcomponentGetXComponentContextJsunit()
}
\ No newline at end of file
......@@ -164,5 +164,37 @@ export default function commonBackgroundBlurStyleJsunit() {
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testcommonHoverEffectHighlight0006
* @tc.desic acecommonHoverEffectHighlightEtsTest0006
*/
it('testcommonHoverEffectHighlight0001', 0, async function (done) {
console.info('commonHoverEffectHighlight testcommonHoverEffectHighlight0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('hoverEffectText');
console.info("[testcommonHoverEffectHighlight0001] component hoverEffect strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$attrs.hoverEffect).assertEqual("HoverEffect.Highlight");
console.info("[testcommonHoverEffectHighlight0001] hoverEffect value :" + obj.$attrs.hoverEffect);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testcommonHoverEffectScale0007
* @tc.desic acecommonHoverEffectScaleEtsTest0007
*/
it('testcommonHoverEffectScale0001', 0, async function (done) {
console.info('commonHoverEffectScale testcommonHoverEffectScale0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('hoverEffectScaleText');
console.info("[testcommonHoverEffectScale0001] component hoverEffect strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$attrs.hoverEffect).assertEqual("HoverEffect.Scale");
console.info("[testcommonHoverEffectScale0001] hoverEffect value :" + obj.$attrs.hoverEffect);
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 common_ts_ets_apiStaticClearJsunit() {
describe('common_ts_ets_apiStaticClearTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/common_ts_ets_api',
}
try {
router.clear();
let pages = router.getState();
console.info("get common_ts_ets_api state success " + JSON.stringify(pages));
if (!("common_ts_ets_api" == pages.name)) {
console.info("get common_ts_ets_api state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push common_ts_ets_api page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push common_ts_ets_api page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("common_ts_ets_apiStaticClear after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testcommon_ts_ets_apiPersistProp0001
* @tc.desic acecommon_ts_ets_apiPersistPropEtsTest0001
*/
it('testcommon_ts_ets_apiPersistProp0001', 0, async function (done) {
console.info('common_ts_ets_apiPersistProp testcommon_ts_ets_apiPersistProp0001 START');
await Utils.sleep(2000);
try {
var innerEvent = {
eventId: 60230,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
console.info("common_ts_ets_apiPersistProp0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.Score).assertEqual(1);
done()
}
console.info("PersistProp0001 click result is: " + JSON.stringify(sendEventByKey('PersistPropText', 10, "")));
events_emitter.on(innerEvent, callback);
} catch (err) {
console.info("common_ts_ets_apiPersistProp0001 on events_emitter err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testcommon_ts_ets_apiEnvProp0001
* @tc.desic acecommon_ts_ets_apiEnvPropEtsTest0001
*/
it('testcommon_ts_ets_apiEnvProp0001', 0, async function (done) {
console.info('common_ts_ets_apiEnvProp testcommon_ts_ets_apiEnvProp0001 START');
await Utils.sleep(2000);
try {
var innerEvent = {
eventId: 60231,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
console.info("common_ts_ets_apiEnvProp0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.Result).assertEqual(true);
done()
}
console.info("EnvProp0001 click result is: " + JSON.stringify(sendEventByKey('EnvPropText', 10, "")));
events_emitter.on(innerEvent, callback);
} catch (err) {
console.info("common_ts_ets_apiEnvProp0001 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 curvesStepsJsunit() {
describe('curvesStepsTest', function () {
/**
* run before testcase
*/
beforeAll(async function (done) {
console.info('[curvesStepsTest] before each called')
let result;
let options = {
uri: 'pages/curves'
}
try {
result = router.push(options)
console.info("push curves page success " + JSON.stringify(result));
} catch (err) {
console.error("push curves page error " + JSON.stringify(result));
}
await Utils.sleep(4000)
done()
});
/**
* run after testcase
*/
afterAll(async function () {
console.info('[curvesStepsTest] after each called')
await Utils.sleep(1000)
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testcurvesSteps0001
* @tc.desic acecurvesStepsEtsTest0001
*/
it('testcurvesSteps0001', 0, async function (done) {
console.info('curvesSteps testcurvesSteps0001 START');
var innerEvent = {
eventId: 60229,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
try{
console.info("callback success" );
console.info("curveApi eventData.data.curveApi result is: " + eventData.data.curveApi);
expect(eventData.data.curveApi).assertEqual("callBackSuccess");
console.info("curveApi end");
}catch(err){
console.info("curveApi on events_emitter err : " + JSON.stringify(err));
}
done();
}
try{
console.info("curveApi click result is: " + JSON.stringify(sendEventByKey('stepsText', 10, "")));
events_emitter.on(innerEvent, callback);
}catch(err){
console.info("curveApi 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 featureAbilityStartAbilityJsunit() {
describe('featureAbilityStartAbilityTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/featureAbility',
}
try {
router.clear();
let pages = router.getState();
console.info("get featureAbility state success " + JSON.stringify(pages));
if (!("featureAbility" == pages.name)) {
console.info("get featureAbility state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push featureAbility page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push featureAbility page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("featureAbilityStartAbility after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testfeatureAbilityStartAbility0001
* @tc.desic acefeatureAbilityStartAbilityEtsTest0001
*/
it('testfeatureAbilityStartAbility0001', 0, async function (done) {
console.info('featureAbilityStartAbility testfeatureAbilityStartAbility0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('startAbilityText');
console.info("[testfeatureAbilityStartAbility0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("320.00vp");
console.info("[testfeatureAbilityStartAbility0001] width value :" + obj.$attrs.width);
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 panelBackgroundMaskJsunit() {
describe('panelBackgroundMaskTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/panel',
}
try {
router.clear();
let pages = router.getState();
console.info("get panel state success " + JSON.stringify(pages));
if (!("panel" == pages.name)) {
console.info("get panel state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push panel page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push panel page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("panelBackgroundMask after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testpanelBackgroundMask0001
* @tc.desic acepanelBackgroundMaskEtsTest0001
*/
it('testpanelBackgroundMask0001', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testpanelBackgroundMask0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testpanelBackgroundMask0002
* @tc.desic acepanelBackgroundMaskEtsTest0002
*/
it('testpanelBackgroundMask0002', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testpanelBackgroundMask0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testpanelBackgroundMask0003
* @tc.desic acepanelBackgroundMaskEtsTest0003
*/
it('testpanelBackgroundMask0003', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testpanelBackgroundMask0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testpanelBackgroundMask0004
* @tc.desic acepanelBackgroundMaskEtsTest0004
*/
it('testpanelBackgroundMask0004', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testpanelBackgroundMask0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testpanelBackgroundMask0005
* @tc.desic acepanelBackgroundMaskEtsTest0005
*/
it('testpanelBackgroundMask0005', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testpanelBackgroundMask0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testpanelBackgroundMask0006
* @tc.desic acepanelBackgroundMaskEtsTest0006
*/
it('testpanelBackgroundMask0006', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testpanelBackgroundMask0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testpanelBackgroundMask0007
* @tc.desic acepanelBackgroundMaskEtsTest0007
*/
it('testpanelBackgroundMask0007', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testpanelBackgroundMask0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testpanelBackgroundMask0009
* @tc.desic acepanelBackgroundMaskEtsTest0009
*/
it('testpanelBackgroundMask0009', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testpanelBackgroundMask0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testpanelBackgroundMask0010
* @tc.desic acepanelBackgroundMaskEtsTest0010
*/
it('testpanelBackgroundMask0010', 0, async function (done) {
console.info('panelBackgroundMask testpanelBackgroundMask0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('backgroundMaskText');
console.info("[testpanelBackgroundMask0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testpanelBackgroundMask0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
......@@ -53,12 +53,12 @@ export default function swiperCurveJsunit() {
it('testswiperCurve0001', 0, async function (done) {
console.info('swiperCurve testswiperCurve0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
let strJson = getInspectorByKey('swiper');
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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.curve).assertEqual("Curve.Linear");
console.info("[testswiperCurve0001] curve value :" + obj.$attrs.curve);
done();
});
......@@ -70,12 +70,12 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0002] component cachedCount 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.cachedCount).assertEqual(2);
console.info("[testswiperCurve0002] cachedCount value :" + obj.$attrs.cachedCount);
done();
});
......@@ -87,12 +87,12 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0003] component index 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.index).assertEqual(1);
console.info("[testswiperCurve0003] index value :" + obj.$attrs.index);
done();
});
......@@ -104,12 +104,12 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0004] component autoPlay 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.autoPlay).assertEqual(true);
console.info("[testswiperCurve0004] autoPlay value :" + obj.$attrs.autoPlay);
done();
});
......@@ -121,12 +121,12 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0005] component interval 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.interval).assertEqual("4000");
console.info("[testswiperCurve0005] interval value :" + obj.$attrs.interval);
done();
});
......@@ -138,12 +138,12 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0006] component indicator 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.indicator).assertEqual(true);
console.info("[testswiperCurve0006] indicator value :" + obj.$attrs.indicator);
done();
});
......@@ -155,12 +155,29 @@ export default function swiperCurveJsunit() {
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 strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0007] component loop 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual(false);
console.info("[testswiperCurve0007] loop value :" + obj.$attrs.loop);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0008
* @tc.name testswiperCurve0008
* @tc.desic aceswiperCurveEtsTest0008
*/
it('testswiperCurve0008', 0, async function (done) {
console.info('swiperCurve testswiperCurve0008 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0008] component duration strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.duration).assertEqual("1000");
console.info("[testswiperCurve0008] duration value :" + obj.$attrs.duration);
done();
});
......@@ -170,14 +187,14 @@ export default function swiperCurveJsunit() {
* @tc.desic aceswiperCurveEtsTest0009
*/
it('testswiperCurve0009', 0, async function (done) {
console.info('swiperCurve testswiperCurve009 START');
console.info('swiperCurve testswiperCurve0009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0009] component padding strJson:" + strJson);
let strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve0009] component vertical 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);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.vertical).assertEqual(false);
console.info("[testswiperCurve0009] vertical value :" + obj.$attrs.vertical);
done();
});
......@@ -186,15 +203,37 @@ export default function swiperCurveJsunit() {
* @tc.name testswiperCurve0010
* @tc.desic aceswiperCurveEtsTest0010
*/
it('testswiperCurve0010', 0, async function (done) {
console.info('swiperCurve testswiperCurve0010 START');
it('testswiperCurve00010', 0, async function (done) {
console.info('swiperCurve testswiperCurve00010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve00010] component itemSpace strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.itemSpace).assertEqual(0);
console.info("[testswiperCurve00010] itemSpace value :" + obj.$attrs.itemSpace);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0011
* @tc.name testswiperCurve0011
* @tc.desic aceswiperCurveEtsTest0011
*/
/***有问题***/
it('testswiperCurve00011', 0, async function (done) {
console.info('swiperCurve testswiperCurve00011 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0010] component textAlign strJson:" + strJson);
let strJson = getInspectorByKey('swiper');
console.info("[testswiperCurve00011] component onChange 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);
expect(obj.$type).assertEqual('Swiper');
try {
obj.$attrs.isOn = !obj.$attrs.isOn //尝试用isOn的改变来触发Onchange()事件
} catch(err) {
console.info("testswiperCurve00011 on event err : " + JSON.stringify(err));
}
console.info("[testswiperCurve00011] onChange value :" + obj.$attrs.onChange);
done();
});
})
......
......@@ -197,5 +197,22 @@ export default function tabsBarPositionJsunit() {
console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0011
* @tc.name testtabsBarPosition0011
* @tc.desic acetabsBarPositionEtsTest0011
*/
it('testtabsBarPosition0011', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0011 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionTabs');
console.info("[testtabsBarPosition0011] component barPosition strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Tabs');
expect(obj.$attrs.barPosition).assertEqual("BarPosition.Start");
console.info("[testtabsBarPosition0011] barPosition value :" + obj.$attrs.barPosition);
done();
});
})
}
......@@ -198,6 +198,23 @@ export default function textAreaOnCutJsunit() {
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0011
* @tc.name testtextAreaOnCut0011
* @tc.desic acetextAreaOnCutEtsTest0011
*/
it('testtextAreaCopyOption0011', 0, async function (done) {
console.info('textAreaCopyOption testtextAreaCopyOption0011 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('copyOptionText');
console.info("[testtextAreaCopyOption0011] component copyOption strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('copyOptionText');
expect(obj.$attrs.copyOption).assertEqual(0);
console.info("[testtextAreaCopyOption0011] copyOption value :" + obj.$attrs.copyOption);
done();
});
})
}
......@@ -197,5 +197,29 @@ export default function textInputOnEditChangeJsunit() {
console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
it('testtextInputCopyOption0001', 0, async function (done) {
console.info('textInputCopyOption testtextInputCopyOption0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('copyOptionText');
console.info("[testtextInputCopyOption0001] component copyOption strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.copyOption).assertEqual(0);
console.info("[testtextInputCopyOption0001] copyOption value :" + obj.$attrs.copyOption);
done();
});
it('testtextInputShowPasswordIcon0001', 0, async function (done) {
console.info('textInputShowPasswordIcon testtextInputShowPasswordIcon0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('showPasswordIconText');
console.info("[testtextInputShowPasswordIcon0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.showPasswordIcon).assertEqual(true);
console.info("[testtextInputShowPasswordIcon0001] showPasswordIcon value :" + obj.$attrs.showPasswordIcon);
done();
});
})
}
......@@ -197,5 +197,22 @@ export default function textPickerDefaultPickerItemHeightJsunit() {
console.info("[testtextPickerDefaultPickerItemHeight0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0011
* @tc.name testtextPickerDefaultPickerItemHeight0011
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0011
*/
it('testtextPickerDefaultPickerItemHeight0011', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0011 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0011] component defaultPickerItemHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.defaultPickerItemHeight).assertEqual("80px");
console.info("[testtextPickerDefaultPickerItemHeight0011] defaultPickerItemHeight value :" + obj.$attrs.defaultPickerItemHeight);
done();
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册