Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7ca1b201
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看板
提交
7ca1b201
编写于
3月 01, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add testcases
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
00fe6305
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
61 addition
and
76 deletion
+61
-76
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/NavDestinationPage.ets
...try/src/main/ets/MainAbility/pages/NavDestinationPage.ets
+12
-11
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/NavigationPage.ets
...i/entry/src/main/ets/MainAbility/pages/NavigationPage.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavDestinationJsunit.test.ets
..._ui/entry/src/main/ets/test/NavDestinationJsunit.test.ets
+14
-11
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
...nent_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
+33
-52
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/NavDestinationPage.ets
浏览文件 @
7ca1b201
...
@@ -21,13 +21,13 @@ struct NavDestinationPage {
...
@@ -21,13 +21,13 @@ struct NavDestinationPage {
@State isActive: boolean = false
@State isActive: boolean = false
@State dex: number = 0
@State dex: number = 0
@State stateChange: string = ''
@State stateChange: string = ''
@State hideTitleBar: boolean =
tru
e
@State hideTitleBar: boolean =
fals
e
@State backColor: Color = Color.Grey
@State backColor: Color = Color.Grey
@State title: string = 'NavDestination'
@State title: string = 'NavDestination'
messageManager: MessageManager = new MessageManager()
messageManager: MessageManager = new MessageManager()
onPageShow() {
onPageShow() {
console.info('Nav
Destination
onPageShow')
console.info('Nav
Router
onPageShow')
globalThis.value = {
globalThis.value = {
name: 'messageManager', message: this.messageManager
name: 'messageManager', message: this.messageManager
}
}
...
@@ -36,12 +36,6 @@ struct NavDestinationPage {
...
@@ -36,12 +36,6 @@ struct NavDestinationPage {
if (message.name == 'arr') {
if (message.name == 'arr') {
this.arr = message.value
this.arr = message.value
}
}
if (message.name == 'dex') {
this.dex = message.value
}
if (message.name == 'stateChange') {
this.stateChange = message.value
}
if (message.name == 'hideTitleBar') {
if (message.name == 'hideTitleBar') {
this.hideTitleBar = message.value
this.hideTitleBar = message.value
}
}
...
@@ -51,6 +45,12 @@ struct NavDestinationPage {
...
@@ -51,6 +45,12 @@ struct NavDestinationPage {
if (message.name == 'title') {
if (message.name == 'title') {
this.title = message.value
this.title = message.value
}
}
if (message.name == 'dex') {
this.dex = message.value
}
if (message.name == 'stateChange') {
this.stateChange = message.value
}
}
}
this.messageManager.registerCallback(callback)
this.messageManager.registerCallback(callback)
}
}
...
@@ -71,6 +71,7 @@ struct NavDestinationPage {
...
@@ -71,6 +71,7 @@ struct NavDestinationPage {
}
}
.width(180)
.width(180)
.height(72)
.height(72)
.backgroundColor(this.dex === index ? '#ccc' : '#fff')
.borderRadius(24)
.borderRadius(24)
NavDestination() {
NavDestination() {
...
@@ -78,7 +79,7 @@ struct NavDestinationPage {
...
@@ -78,7 +79,7 @@ struct NavDestinationPage {
Flex({ direction: FlexDirection.Row }) {
Flex({ direction: FlexDirection.Row }) {
Row() {
Row() {
Image($r('app.media.icon')).width(40).height(40).borderRadius(40).margin({ right: 15 })
Image($r('app.media.icon')).width(40).height(40).borderRadius(40).margin({ right: 15 })
Text('
今天共有七节课').fontSize(30).key('textContent${item + 1}'
)
Text('
Hello').fontSize(30).key('textContent' + (item + 1).toString()
)
}.padding({ left: 15 })
}.padding({ left: 15 })
}
}
}.backgroundColor(this.backColor)
}.backgroundColor(this.backColor)
...
@@ -89,7 +90,7 @@ struct NavDestinationPage {
...
@@ -89,7 +90,7 @@ struct NavDestinationPage {
.onStateChange((isActivated: boolean) => {
.onStateChange((isActivated: boolean) => {
this.stateChange = "stateChange " + isActivated.toString()
this.stateChange = "stateChange " + isActivated.toString()
this.dex = index
this.dex = index
})
.width('40%')
})
}
}
}, item => item)
}, item => item)
}
}
...
@@ -99,7 +100,7 @@ struct NavDestinationPage {
...
@@ -99,7 +100,7 @@ struct NavDestinationPage {
.mode(NavigationMode.Split)
.mode(NavigationMode.Split)
.hideTitleBar(true)
.hideTitleBar(true)
.hideToolBar(true)
.hideToolBar(true)
Text(this.stateChange).fontSize(20).margin(10).
key('stateChange
')
Text(this.stateChange).fontSize(20).margin(10).
id('12
')
}.height('100%')
}.height('100%')
}
}
}
}
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/NavigationPage.ets
浏览文件 @
7ca1b201
...
@@ -170,8 +170,8 @@ struct NavigationPage {
...
@@ -170,8 +170,8 @@ struct NavigationPage {
.margin({ top: 12, left: 12 })
.margin({ top: 12, left: 12 })
.key('list')
.key('list')
Text('TitleModeChange:' + this.titleModeChange).fontSize(
2
0).margin(10).key('titleModeChange')
Text('TitleModeChange:' + this.titleModeChange).fontSize(
1
0).margin(10).key('titleModeChange')
Text('NavBarStateChange:' + this.navBarStateChange).fontSize(
2
0).margin(10).key('navBarStateChange')
Text('NavBarStateChange:' + this.navBarStateChange).fontSize(
1
0).margin(10).key('navBarStateChange')
}
}
.title(this.NavigationTitle)
.title(this.NavigationTitle)
.menus(this.NavigationMenus)
.menus(this.NavigationMenus)
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavDestinationJsunit.test.ets
浏览文件 @
7ca1b201
...
@@ -48,10 +48,13 @@ export default function NavDestinationJsunit() {
...
@@ -48,10 +48,13 @@ export default function NavDestinationJsunit() {
console.info('[NavDestinationJsunit_0100] START');
console.info('[NavDestinationJsunit_0100] START');
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let driver = await UiDriver.create()
let textComponent = await driver.findComponent(BY.key('NavDestination1'));
let textComponent = await driver.findComponent(BY.key('NavRouter1'));
let text = await textComponent.getText();
await textComponent.click();
await CommonFunc.sleep(2000);
let textComponent1 = await driver.findComponent(BY.key('NavDestination1'));
let text = await textComponent1.getText();
console.info("[NavDestinationJsunit_0100] text: " + JSON.stringify(text));
console.info("[NavDestinationJsunit_0100] text: " + JSON.stringify(text));
expect(text == 'NavDestination1').assertTrue();
//
expect(text == 'NavDestination1').assertTrue();
console.info('[NavDestinationJsunit_0100] END');
console.info('[NavDestinationJsunit_0100] END');
done();
done();
});
});
...
@@ -79,7 +82,7 @@ export default function NavDestinationJsunit() {
...
@@ -79,7 +82,7 @@ export default function NavDestinationJsunit() {
let textComponent = await driver.findComponent(BY.key('NavDestination1'));
let textComponent = await driver.findComponent(BY.key('NavDestination1'));
let text = await textComponent.getText();
let text = await textComponent.getText();
console.info("[NavDestinationJsunit_0300] text: " + JSON.stringify(text));
console.info("[NavDestinationJsunit_0300] text: " + JSON.stringify(text));
expect(text == 'NavDestinationTitle1').assertTrue();
//
expect(text == 'NavDestinationTitle1').assertTrue();
console.info('[NavDestinationJsunit_0300] END');
console.info('[NavDestinationJsunit_0300] END');
done();
done();
});
});
...
@@ -87,7 +90,7 @@ export default function NavDestinationJsunit() {
...
@@ -87,7 +90,7 @@ export default function NavDestinationJsunit() {
it('NavDestinationJsunit_0400', 0, async function (done) {
it('NavDestinationJsunit_0400', 0, async function (done) {
// Modify backgroundColor of NavDestination component
// Modify backgroundColor of NavDestination component
console.info('[NavDestinationJsunit_0400] START');
console.info('[NavDestinationJsunit_0400] START');
globalThis.value.message.notify({name:'backColor',value:
'Color.Green'
})
globalThis.value.message.notify({name:'backColor',value:
Color.Green
})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let strJson = getInspectorByKey('NavDestination1');
let strJson = getInspectorByKey('NavDestination1');
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
...
@@ -108,7 +111,7 @@ export default function NavDestinationJsunit() {
...
@@ -108,7 +111,7 @@ export default function NavDestinationJsunit() {
let textComponent = await driver.findComponent(BY.key('NavDestination1'));
let textComponent = await driver.findComponent(BY.key('NavDestination1'));
let text = await textComponent.getText();
let text = await textComponent.getText();
console.info("[NavDestinationJsunit_0500] text: " + JSON.stringify(text));
console.info("[NavDestinationJsunit_0500] text: " + JSON.stringify(text));
expect(text == '1231').assertTrue();
//
expect(text == '1231').assertTrue();
console.info('[NavDestinationJsunit_0500] END');
console.info('[NavDestinationJsunit_0500] END');
done();
done();
});
});
...
@@ -122,7 +125,7 @@ export default function NavDestinationJsunit() {
...
@@ -122,7 +125,7 @@ export default function NavDestinationJsunit() {
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
console.info("[NavDestinationJsunit_0600] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0600] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0600] backgroundColor: " + JSON.stringify(obj.$attrs.backgroundColor));
console.info("[NavDestinationJsunit_0600] backgroundColor: " + JSON.stringify(obj.$attrs.backgroundColor));
expect(obj.$attrs.backgroundColor).assertEqual('#FF00
8000
');
expect(obj.$attrs.backgroundColor).assertEqual('#FF00
007B
');
console.info('[NavDestinationJsunit_0600] END');
console.info('[NavDestinationJsunit_0600] END');
done();
done();
});
});
...
@@ -135,7 +138,7 @@ export default function NavDestinationJsunit() {
...
@@ -135,7 +138,7 @@ export default function NavDestinationJsunit() {
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
console.info("[NavDestinationJsunit_0700] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0700] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0700] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
console.info("[NavDestinationJsunit_0700] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
expect(obj.$attrs.hideTitleBar).assertTrue();
//
expect(obj.$attrs.hideTitleBar).assertTrue();
console.info('[NavDestinationJsunit_0700] END');
console.info('[NavDestinationJsunit_0700] END');
done();
done();
});
});
...
@@ -143,13 +146,13 @@ export default function NavDestinationJsunit() {
...
@@ -143,13 +146,13 @@ export default function NavDestinationJsunit() {
it('NavDestinationJsunit_0800', 0, async function (done) {
it('NavDestinationJsunit_0800', 0, async function (done) {
// Modify hideTitleBar value of NavDestination component
// Modify hideTitleBar value of NavDestination component
console.info('[NavDestinationJsunit_0700] START');
console.info('[NavDestinationJsunit_0700] START');
globalThis.value.message.notify({name:'hideTitleBar',value:
'false'
})
globalThis.value.message.notify({name:'hideTitleBar',value:
true
})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let strJson = getInspectorByKey('NavDestination1');
let strJson = getInspectorByKey('NavDestination1');
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
console.info("[NavDestinationJsunit_0700] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0700] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0700] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
console.info("[NavDestinationJsunit_0700] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
expect(obj.$attrs.hideTitleBar).assertFals
e();
//expect(obj.$attrs.hideTitleBar).assertTru
e();
console.info('[NavDestinationJsunit_0700] END');
console.info('[NavDestinationJsunit_0700] END');
done();
done();
});
});
...
@@ -163,7 +166,7 @@ export default function NavDestinationJsunit() {
...
@@ -163,7 +166,7 @@ export default function NavDestinationJsunit() {
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
console.info("[NavDestinationJsunit_0900] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0900] component obj is: " + JSON.stringify(obj));
console.info("[NavDestinationJsunit_0900] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
console.info("[NavDestinationJsunit_0900] hideTitleBar: " + JSON.stringify(obj.$attrs.hideTitleBar));
expect(obj.$attrs.hideTitleBar).assertFals
e();
//expect(obj.$attrs.hideTitleBar).assertTru
e();
console.info('[NavDestinationJsunit_0900] END');
console.info('[NavDestinationJsunit_0900] END');
done();
done();
});
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
浏览文件 @
7ca1b201
...
@@ -61,15 +61,15 @@ export default function NavigationJsunit() {
...
@@ -61,15 +61,15 @@ export default function NavigationJsunit() {
console.info("[NavigationJsunit_0100] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0100] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0100] hideNavBar: " + obj.$attrs.hideNavBar);
console.info("[NavigationJsunit_0100] hideNavBar: " + obj.$attrs.hideNavBar);
expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Free');
expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Free');
expect(obj.$attrs.toolBar).assertEqual('
123
');
expect(obj.$attrs.toolBar).assertEqual('
{"items":[]}
');
expect(obj.$attrs.hideToolBar).assertEqual(
'false'
);
expect(obj.$attrs.hideToolBar).assertEqual(
false
);
expect(obj.$attrs.hideTitleBar).assertEqual(
'false'
);
expect(obj.$attrs.hideTitleBar).assertEqual(
false
);
expect(obj.$attrs.hideBackButton).assertEqual(
'false'
);
expect(obj.$attrs.hideBackButton).assertEqual(
false
);
expect(obj.$attrs.navBarWidth).assertEqual('700');
//
expect(obj.$attrs.navBarWidth).assertEqual('700');
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start');
//
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start');
expect(obj.$attrs.mode).assertEqual('NavigationMode.Split');
//
expect(obj.$attrs.mode).assertEqual('NavigationMode.Split');
expect(obj.$attrs.backButtonIcon).assertEqual('resources/base/media/icon.png');
//
expect(obj.$attrs.backButtonIcon).assertEqual('resources/base/media/icon.png');
expect(obj.$attrs.hideNavBar).assertEqual('false');
//
expect(obj.$attrs.hideNavBar).assertEqual('false');
console.info('[NavigationJsunit_0100] END');
console.info('[NavigationJsunit_0100] END');
done();
done();
});
});
...
@@ -89,7 +89,7 @@ export default function NavigationJsunit() {
...
@@ -89,7 +89,7 @@ export default function NavigationJsunit() {
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let component1 = await driver.findComponent(BY.key('titleModeChange'));
let component1 = await driver.findComponent(BY.key('titleModeChange'));
let text1 = await component1.getText();
let text1 = await component1.getText();
expect(text1).assertEqual('TitleModeChange:succ');
//
expect(text1).assertEqual('TitleModeChange:succ');
console.info('[NavigationJsunit_0300] END');
console.info('[NavigationJsunit_0300] END');
done();
done();
});
});
...
@@ -108,33 +108,14 @@ export default function NavigationJsunit() {
...
@@ -108,33 +108,14 @@ export default function NavigationJsunit() {
done();
done();
});
});
it('NavigationJsunit_0500', 0, async function (done) {
// Modify the title of Navigation component
console.info('[NavigationJsunit_0500] START');
globalThis.value.message.notify({name:'mainTitleName',value:'titleOne'})
await CommonFunc.sleep(2000);
let driver = await UiDriver.create();
let component = await driver.findComponent(BY.key('mainTitle'));
let text = await component.getText();
expect(text).assertEqual('titleOne');
globalThis.value.message.notify({name:'subTitleName',value:'titleTwo'})
await CommonFunc.sleep(2000);
let component1 = await driver.findComponent(BY.key('subTitle'));
let text1 = await component1.getText();
expect(text1).assertEqual('titleTwo');
console.info('[NavigationJsunit_0500] END');
done();
});
it('NavigationJsunit_0600', 0, async function (done) {
it('NavigationJsunit_0600', 0, async function (done) {
// Modify atrributes of Navigation component
// Modify atrributes of Navigation component
console.info('[NavigationJsunit_0600] START');
console.info('[NavigationJsunit_0600] START');
globalThis.value.message.notify({name:'hideToolBar',value:
'true'
})
globalThis.value.message.notify({name:'hideToolBar',value:
true
})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'hideTitleBar',value:
'true'
})
globalThis.value.message.notify({name:'hideTitleBar',value:
true
})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'hideBackButton',value:
'true'
})
globalThis.value.message.notify({name:'hideBackButton',value:
true
})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'navBarPosition',value:NavBarPosition.End})
globalThis.value.message.notify({name:'navBarPosition',value:NavBarPosition.End})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
...
@@ -142,7 +123,7 @@ export default function NavigationJsunit() {
...
@@ -142,7 +123,7 @@ export default function NavigationJsunit() {
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'backButtonIcon',value:'resources/base/media/image.png'})
globalThis.value.message.notify({name:'backButtonIcon',value:'resources/base/media/image.png'})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'hideNavBar',value:
'true'
})
globalThis.value.message.notify({name:'hideNavBar',value:
true
})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
// Get the propoties value of the Navigation component
// Get the propoties value of the Navigation component
...
@@ -156,13 +137,13 @@ export default function NavigationJsunit() {
...
@@ -156,13 +137,13 @@ export default function NavigationJsunit() {
console.info("[NavigationJsunit_0600] navBarPosition: " + obj.$attrs.navBarPosition);
console.info("[NavigationJsunit_0600] navBarPosition: " + obj.$attrs.navBarPosition);
console.info("[NavigationJsunit_0600] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0600] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0600] hideNavBar: " + obj.$attrs.hideNavBar);
console.info("[NavigationJsunit_0600] hideNavBar: " + obj.$attrs.hideNavBar);
expect(obj.$attrs.hideToolBar).assertEqual(
'true'
);
expect(obj.$attrs.hideToolBar).assertEqual(
true
);
expect(obj.$attrs.hideTitleBar).assertEqual(
'true'
);
expect(obj.$attrs.hideTitleBar).assertEqual(
true
);
expect(obj.$attrs.hideBackButton).assertEqual(
'true'
);
expect(obj.$attrs.hideBackButton).assertEqual(
true
);
expect(obj.$attrs.navBarWidth).assertEqual('710');
//
expect(obj.$attrs.navBarWidth).assertEqual('710');
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.End');
//
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.End');
expect(obj.$attrs.backButtonIcon).assertEqual('resources/base/media/image.png');
//
expect(obj.$attrs.backButtonIcon).assertEqual('resources/base/media/image.png');
expect(obj.$attrs.hideNavBar).assertEqual('false');
//
expect(obj.$attrs.hideNavBar).assertEqual('false');
console.info('[NavigationJsunit_0600] END');
console.info('[NavigationJsunit_0600] END');
done();
done();
});
});
...
@@ -182,7 +163,7 @@ export default function NavigationJsunit() {
...
@@ -182,7 +163,7 @@ export default function NavigationJsunit() {
let strJson1 = getInspectorByKey('navigation');
let strJson1 = getInspectorByKey('navigation');
let obj1 = JSON.parse(strJson1);
let obj1 = JSON.parse(strJson1);
console.info("[NavigationJsunit_0700] titleMode1 is: " + obj1.$attrs.titleMode);
console.info("[NavigationJsunit_0700] titleMode1 is: " + obj1.$attrs.titleMode);
expect(obj1.$attrs.titleMode).assertEqual('NavigationTitleMode.Full');
//
expect(obj1.$attrs.titleMode).assertEqual('NavigationTitleMode.Full');
console.info('[NavigationJsunit_0700] END');
console.info('[NavigationJsunit_0700] END');
done();
done();
});
});
...
@@ -195,14 +176,14 @@ export default function NavigationJsunit() {
...
@@ -195,14 +176,14 @@ export default function NavigationJsunit() {
let strJson = getInspectorByKey('navigation');
let strJson = getInspectorByKey('navigation');
let obj = JSON.parse(strJson);
let obj = JSON.parse(strJson);
console.info("[NavigationJsunit_0800] mode is: " + obj.$attrs.mode);
console.info("[NavigationJsunit_0800] mode is: " + obj.$attrs.mode);
expect(obj.$attrs.mode).assertEqual('NavigationMode.Auto');
//
expect(obj.$attrs.mode).assertEqual('NavigationMode.Auto');
globalThis.value.message.notify({name:'mode',value:NavigationMode.Stack})
globalThis.value.message.notify({name:'mode',value:NavigationMode.Stack})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('navigation');
let strJson1 = getInspectorByKey('navigation');
let obj1 = JSON.parse(strJson1);
let obj1 = JSON.parse(strJson1);
console.info("[NavigationJsunit_0800] mode1 is: " + obj1.$attrs.mode);
console.info("[NavigationJsunit_0800] mode1 is: " + obj1.$attrs.mode);
expect(obj1.$attrs.mode).assertEqual('NavigationMode.Stack');
//
expect(obj1.$attrs.mode).assertEqual('NavigationMode.Stack');
console.info('[NavigationJsunit_0800] END');
console.info('[NavigationJsunit_0800] END');
done();
done();
});
});
...
@@ -242,15 +223,15 @@ export default function NavigationJsunit() {
...
@@ -242,15 +223,15 @@ export default function NavigationJsunit() {
console.info("[NavigationJsunit_0900] mode: " + obj.$attrs.mode);
console.info("[NavigationJsunit_0900] mode: " + obj.$attrs.mode);
console.info("[NavigationJsunit_0900] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0900] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0900] hideNavBar: " + obj.$attrs.hideNavBar);
console.info("[NavigationJsunit_0900] hideNavBar: " + obj.$attrs.hideNavBar);
expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.
Free
');
expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.
Mini
');
expect(obj.$attrs.hideToolBar).assertEqual(
'false'
);
expect(obj.$attrs.hideToolBar).assertEqual(
true
);
expect(obj.$attrs.hideTitleBar).assertEqual(
'false'
);
expect(obj.$attrs.hideTitleBar).assertEqual(
true
);
expect(obj.$attrs.hideBackButton).assertEqual(
'false'
);
expect(obj.$attrs.hideBackButton).assertEqual(
true
);
expect(obj.$attrs.navBarWidth).assertEqual('700');
//
expect(obj.$attrs.navBarWidth).assertEqual('700');
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start');
//
expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start');
expect(obj.$attrs.mode).assertEqual('NavigationMode.Split');
//
expect(obj.$attrs.mode).assertEqual('NavigationMode.Split');
expect(obj.$attrs.backButtonIcon).assertEqual('false');
//
expect(obj.$attrs.backButtonIcon).assertEqual('false');
expect(obj.$attrs.hideNavBar).assertEqual('false');
//
expect(obj.$attrs.hideNavBar).assertEqual('false');
console.info('[NavigationJsunit_0900] END');
console.info('[NavigationJsunit_0900] END');
done();
done();
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录