Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
53d89e3d
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
53d89e3d
编写于
6月 08, 2023
作者:
H
huangdong57
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
animator&navigation
Signed-off-by:
N
huangdong57
<
huangdong57@huawei.com
>
上级
8b3f8dca
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
765 addition
and
2 deletion
+765
-2
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/navigationType.ets
...pletion/src/main/ets/TestAbility/pages/navigationType.ets
+334
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/stageAnimator.ets
...mpletion/src/main/ets/TestAbility/pages/stageAnimator.ets
+69
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
...component_wholeCompletion/src/main/ets/test/List.test.ets
+5
-1
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/navigationType.test.ets
...wholeCompletion/src/main/ets/test/navigationType.test.ets
+196
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageAnimator.test.ets
..._wholeCompletion/src/main/ets/test/stageAnimator.test.ets
+158
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
...ompletion/src/main/resources/base/profile/test_pages.json
+3
-1
未找到文件。
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/navigationType.ets
0 → 100644
浏览文件 @
53d89e3d
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 navigationType {
@State strokeWidthStr: string = '10px'
@State dividerColorStr: string = '#000000'
@State startMarginStr: string = '5px'
@State endMarginStr: string = '5px'
@State nullFlag: boolean = false
@State dividerColor: Color = Color.Red
private arr: number[] = [1, 2, 3];
normalIcon : Resource = $r("app.media.icon")
selectedIcon: Resource = $r("app.media.icon")
build() {
Column() {
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1600")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Auto)
.minContentWidth(50)
.navBarWidth(100)
.navBarWidthRange([50, 300])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1700")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Stack)
.minContentWidth(20000)
.navBarWidth(15000)
.navBarWidthRange([10000, 30000])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1800")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth(30)
.navBarWidth(100)
.navBarWidthRange([10, 20])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1900")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.navBarWidth(100)
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_2000")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth(100)
.navBarWidth(100)
.navBarWidthRange([100, 100])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_2100")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth("40%")
.navBarWidth("30%")
.navBarWidthRange(["20%", "50%"])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
}
.height('100%')
.width('100%')
.backgroundColor('#F1F3F5')
}
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/TestAbility/pages/stageAnimator.ets
0 → 100644
浏览文件 @
53d89e3d
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 stageAnimator {
private TAG: string = '[AnimatorTest]'
private backAnimator: any = undefined
private flag: boolean = false
@State wid: number = 100
@State hei: number = 100
create() {
let _this = this
this.backAnimator = globalThis.uiContent.createAnimator({
duration: 1500,
easing: "friction",
delay: 0,
fill: "forwards",
direction: "normal",
iterations: 3,
begin: 200,
end: 400
})
this.backAnimator.onfinish = function () {
_this.flag = true
console.info(_this.TAG, 'backAnimator onfinish')
}
this.backAnimator.onrepeat = function () {
console.info(_this.TAG, 'backAnimator repeat')
}
this.backAnimator.oncancel = function () {
console.info(_this.TAG, 'backAnimator cancel')
}
this.backAnimator.onframe = function (value) {
_this.wid = value
_this.hei = value
}
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Button('animator-play')
.width(100)
.height(70)
.fontSize(30)
.fontColor(Color.Black)
.onClick(() => {
this.flag = false
this.backAnimator.play()
})
.key("animator")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/List.test.ets
浏览文件 @
53d89e3d
...
...
@@ -27,7 +27,9 @@ import bindPopupOffsetTest from './bindPopupOffset.test';
import animationCurveTest from './animationCurve.test';
import hoverTest from './hover.test';
import textObscuredTest from './textObscuredTest.test';
import imageObscuredTest from './imageObscuredTest.test'
import imageObscuredTest from './imageObscuredTest.test';
import stageAnimatorTest from './stageAnimator.test';
import navigationTypeTest from './navigationType.test'
export default function testsuite() {
stageFontTest()
...
...
@@ -45,4 +47,6 @@ export default function testsuite() {
hoverTest()
textObscuredTest()
imageObscuredTest()
stageAnimatorTest()
navigationTypeTest()
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/navigationType.test.ets
0 → 100644
浏览文件 @
53d89e3d
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 "@ohos/hypium"
export default function navigationTypeTest() {
describe('navigationTypeTest', function () {
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'TestAbility/pages/navigationType',
}
try {
router.clear();
let pages = router.getState();
console.info("get navigationType state success " + JSON.stringify(pages));
if (!("navigationType" == pages.name)) {
console.info("get navigationType state success " + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push navigationType page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push navigationType page error: " + err);
}
done()
});
it('ArkUX_Navigation_1600', 0, async function (done) {
console.info('ArkUX_Navigation_1600 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1600');
console.info('ArkUX_Navigation_1600 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1600 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("50.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("50.00vp, 300.00vp");
console.info('ArkUX_Navigation_1600 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1600 ERR '+ JSON.stringify(err));
}
done();
},500)
})
it('ArkUX_Navigation_1700', 0, async function (done) {
console.info('ArkUX_Navigation_1700 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1700');
console.info('ArkUX_Navigation_1700 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1700 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.STACK");
expect(minContentWidth).assertEqual("20000.00vp");
expect(navBarWidth).assertEqual("15000.00vp");
expect(navBarWidthRange).assertEqual("10000.00vp, 30000.00vp");
console.info('ArkUX_Navigation_1700 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1700 ERR '+ JSON.stringify(err));
}
done();
},500)
})
it('ArkUX_Navigation_1800', 0, async function (done) {
console.info('ArkUX_Navigation_1800 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1800');
console.info('ArkUX_Navigation_1800 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1800 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("30.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("10.00vp, 20.00vp");
console.info('ArkUX_Navigation_1800 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1800 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_1900', 0, async function (done) {
console.info('ArkUX_Navigation_1900 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1900');
console.info('ArkUX_Navigation_1900 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1900 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.STACK");
expect(minContentWidth).assertEqual("360.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("240.00vp, 280.00vp");
console.info('ArkUX_Navigation_1900 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1900 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_2000', 0, async function (done) {
console.info('ArkUX_Navigation_2000 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_2000');
console.info('ArkUX_Navigation_2000 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_2000 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("100.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("100.00vp, 100.00vp");
console.info('ArkUX_Navigation_2000 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_2000 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_2100', 0, async function (done) {
console.info('ArkUX_Navigation_2100 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_2100');
console.info('ArkUX_Navigation_2100 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_2100 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("40.00%");
expect(navBarWidth).assertEqual("30.00%");
expect(navBarWidthRange).assertEqual("20.00%, 50.00%");
console.info('ArkUX_Navigation_2100 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_2100 ERR '+ JSON.stringify(err));
}
done();
},500)
});
});
};
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageAnimator.test.ets
0 → 100644
浏览文件 @
53d89e3d
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import router from '@system.router';
export default function stageAnimatorTest() {
describe('stageAnimatorTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'TestAbility/pages/stageAnimator',
}
try {
router.clear();
let pages = router.getState();
console.info("get stageAnimator state success " + JSON.stringify(pages));
if (!("stageAnimator" == pages.name)) {
console.info("get stageAnimator state success " + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push stageAnimator page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push stageAnimator page error: " + err);
}
done()
});
afterEach(function () {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('testanimatorstage0001', 0, async function (done) {
console.info('testanimatorstage0001 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('animator');
sendEventByKey("animator", 10, "")
console.info("[testanimatorstage0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Button');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testanimatorstage0001] width value :" + obj.$attrs.width);
console.info('testanimatorstage0001 END ');
} catch(err) {
expect().assertFail()
console.info('testanimatorstage0001 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('testanimatorstage0002', 0, async function (done) {
let animator = globalThis.uiContent;
console.info('testanimatorstage0002 START');
try {
let options = animator.createAnimator({
duration: 1500,
easing: "friction",
delay: 0,
fill: "forwards",
direction: "normal",
iterations: 3,
begin: 200,
end: 400
})
expect(typeof(options)).assertEqual('object');
} catch (err) {
console.error("push button page error " + JSON.stringify(err));
}
console.info('testanimatorstage0002 END');
done();
});
it('testanimatorstage0003', 0, async function (done) {
let animator = globalThis.uiContent;
console.info('testanimatorstage0003 START');
try {
let options = animator.createAnimator()
expect(typeof(options)).assertEqual('object');
} catch (err) {
console.error("push button page error " + JSON.stringify(err));
}
console.info('testanimatorstage0002 END');
done();
});
it('testanimatorstage0004', 0, async function (done) {
let animator = globalThis.uiContent;
console.info('testanimatorstage0004 START');
try {
let options = animator.createAnimator(null)
expect(typeof(options)).assertEqual('object');
} catch (err) {
console.error("push button page error " + JSON.stringify(err));
}
console.info('testanimatorstage0004 END');
done();
});
it('testanimatorstage0005', 0, async function (done) {
let animator = globalThis.uiContent;
console.info('testanimatorstage0005 START');
try {
let options = animator.createAnimator({
duration: 1500,
easing: "friction",
delay: 0
})
expect(typeof(options)).assertEqual('object');
} catch (err) {
console.error("push button page error " + JSON.stringify(err));
}
console.info('testanimatorstage0005 END');
done();
});
it('testanimatorstage0006', 0, async function (done) {
let animator = globalThis.uiContent;
console.info('testanimatorstage0006 START');
try {
let options = animator.createAnimator({
duration: 1500
})
expect(typeof(options)).assertEqual('object');
} catch (err) {
console.error("push button page error " + JSON.stringify(err));
}
console.info('testanimatorstage0006 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/resources/base/profile/test_pages.json
浏览文件 @
53d89e3d
...
...
@@ -16,6 +16,8 @@
"TestAbility/pages/animationCurve"
,
"TestAbility/pages/hover"
,
"TestAbility/pages/textObscured"
,
"TestAbility/pages/imageObscuredTest"
"TestAbility/pages/imageObscuredTest"
,
"TestAbility/pages/stageAnimator"
,
"TestAbility/pages/navigationType"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录