未验证 提交 ab1e4cd5 编写于 作者: O openharmony_ci 提交者: Gitee

!8799 【ACE子系统】适配UI测试套

Merge pull request !8799 from 王旭鹏/master
...@@ -147,7 +147,7 @@ struct NavigationPage { ...@@ -147,7 +147,7 @@ struct NavigationPage {
Column() { Column() {
Navigation() { Navigation() {
TextInput({ placeholder: 'search...' }) TextInput({ placeholder: 'search...' })
.width(336) .width('90%')
.height(40) .height(40)
.backgroundColor('#FFFFFF') .backgroundColor('#FFFFFF')
.margin({ top: 8, left: 12 }) .margin({ top: 8, left: 12 })
...@@ -156,6 +156,7 @@ struct NavigationPage { ...@@ -156,6 +156,7 @@ struct NavigationPage {
ForEach(this.arr, (item) => { ForEach(this.arr, (item) => {
ListItem() { ListItem() {
Text('' + item) Text('' + item)
.width('90%')
.height(72) .height(72)
.backgroundColor('#FFFFFF') .backgroundColor('#FFFFFF')
.borderRadius(24) .borderRadius(24)
......
...@@ -65,11 +65,11 @@ export default function NavigationJsunit() { ...@@ -65,11 +65,11 @@ export default function NavigationJsunit() {
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.00vp');
//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();
}); });
...@@ -78,18 +78,10 @@ export default function NavigationJsunit() { ...@@ -78,18 +78,10 @@ export default function NavigationJsunit() {
// Verify onTitleModeChange event of Navigation component // Verify onTitleModeChange event of Navigation component
console.info('[NavigationJsunit_0300] START'); console.info('[NavigationJsunit_0300] START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let driver = await UiDriver.create(); let strJson = getInspectorByKey('titleModeChange');
let component = await driver.findComponent(BY.key('titleModeChange')); let obj = JSON.parse(strJson);
let text = await component.getText(); console.info("[NavigationJsunit_0300] content is: " + obj.$attrs.content);
expect(text).assertEqual('TitleModeChange:'); expect(obj.$attrs.content).assertEqual('TitleModeChange:');
let driver1 = await Driver.create();
let scrollBar = await driver1.findComponent(ON.id('list'));
await scrollBar.scrollSearch(ON.text('9'));
await CommonFunc.sleep(1000);
let component1 = await driver.findComponent(BY.key('titleModeChange'));
let text1 = await component1.getText();
//expect(text1).assertEqual('TitleModeChange:succ');
console.info('[NavigationJsunit_0300] END'); console.info('[NavigationJsunit_0300] END');
done(); done();
}); });
...@@ -100,10 +92,10 @@ export default function NavigationJsunit() { ...@@ -100,10 +92,10 @@ export default function NavigationJsunit() {
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(3000); await CommonFunc.sleep(3000);
let driver = await UiDriver.create(); let strJson = getInspectorByKey('navBarStateChange');
let component1 = await driver.findComponent(BY.key('navBarStateChange')); let obj = JSON.parse(strJson);
let text1 = await component1.getText(); console.info("[NavigationJsunit_0400] content is: " + obj.$attrs.content);
expect(text1).assertEqual('NavBarStateChange:succ'); expect(obj.$attrs.content).assertEqual('NavBarStateChange:succ');
console.info('[NavigationJsunit_0400] END'); console.info('[NavigationJsunit_0400] END');
done(); done();
}); });
...@@ -140,10 +132,10 @@ export default function NavigationJsunit() { ...@@ -140,10 +132,10 @@ export default function NavigationJsunit() {
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.00vp');
//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(true);
console.info('[NavigationJsunit_0600] END'); console.info('[NavigationJsunit_0600] END');
done(); done();
}); });
...@@ -159,11 +151,11 @@ export default function NavigationJsunit() { ...@@ -159,11 +151,11 @@ export default function NavigationJsunit() {
expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Mini'); expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Mini');
globalThis.value.message.notify({name:'titleMode',value:NavigationTitleMode.Full}) globalThis.value.message.notify({name:'titleMode',value:NavigationTitleMode.Full})
await CommonFunc.sleep(5000); 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_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();
}); });
...@@ -183,7 +175,7 @@ export default function NavigationJsunit() { ...@@ -183,7 +175,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_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();
}); });
......
...@@ -50,7 +50,7 @@ export default function dividerJsunit() { ...@@ -50,7 +50,7 @@ export default function dividerJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("dividerJsunit_0100'] component obj is: " + JSON.stringify(obj)); console.info("dividerJsunit_0100'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.vertical).assertEqual('false'); expect(obj.$attrs.vertical).assertEqual('false');
expect(obj.$attrs.strokeWidth).assertEqual('20.000000'); expect(obj.$attrs.strokeWidth).assertEqual('20.00vp');
// to confirm // to confirm
//expect(obj.$attrs.lineCap).assertEqual('LineCapStyle.Butt'); //expect(obj.$attrs.lineCap).assertEqual('LineCapStyle.Butt');
expect(obj.$attrs.lineCap).assertEqual('BUTT'); expect(obj.$attrs.lineCap).assertEqual('BUTT');
...@@ -72,7 +72,7 @@ export default function dividerJsunit() { ...@@ -72,7 +72,7 @@ export default function dividerJsunit() {
let strJson = getInspectorByKey('divider'); let strJson = getInspectorByKey('divider');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[dividerJsunit_0200'] component obj is: " + JSON.stringify(obj.$attrs.lineCap)); console.info("[dividerJsunit_0200'] component obj is: " + JSON.stringify(obj.$attrs.lineCap));
expect(obj.$attrs.strokeWidth).assertEqual('30.000000'); expect(obj.$attrs.strokeWidth).assertEqual('30.00vp');
expect(obj.$attrs.lineCap).assertEqual('ROUND'); expect(obj.$attrs.lineCap).assertEqual('ROUND');
expect(obj.$attrs.color).assertEqual('#FFFFFFFF'); expect(obj.$attrs.color).assertEqual('#FFFFFFFF');
done(); done();
...@@ -105,7 +105,7 @@ export default function dividerJsunit() { ...@@ -105,7 +105,7 @@ export default function dividerJsunit() {
// check the value of changed attribute // check the value of changed attribute
let strJson = getInspectorByKey('divider'); let strJson = getInspectorByKey('divider');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.strokeWidth).assertEqual('-30.000000'); expect(obj.$attrs.strokeWidth).assertEqual('-30.00vp');
expect(obj.$attrs.lineCap).assertEqual('BUTT'); expect(obj.$attrs.lineCap).assertEqual('BUTT');
// to confirm // to confirm
expect(obj.$attrs.color).assertEqual('#33182431'); expect(obj.$attrs.color).assertEqual('#33182431');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册