提交 c3e9d57b 编写于 作者: W wang-xupeng2

update Grid and Rating

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 874ba95b
...@@ -180,6 +180,11 @@ export default function GridJsunit() { ...@@ -180,6 +180,11 @@ export default function GridJsunit() {
let strJson1 = getInspectorByKey('grid_default'); let strJson1 = getInspectorByKey('grid_default');
let obj = JSON.parse(strJson1); let obj = JSON.parse(strJson1);
console.info("[GridJsunit_0500] component obj is: " + JSON.stringify(obj)); console.info("[GridJsunit_0500] component obj is: " + JSON.stringify(obj));
console.info("[GridJsunit_0500] columnsGap: " + JSON.stringify(obj.$attrs.columnsGap));
console.info("[GridJsunit_0500] rowsGap: " + JSON.stringify(obj.$attrs.rowsGap));
console.info("[GridJsunit_0500] scrollBar: " + JSON.stringify(obj.$attrs.scrollBar));
console.info("[GridJsunit_0500] cachedCount: " + JSON.stringify(obj.$attrs.cachedCount));
console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation));
expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.columnsGap).assertEqual('0.00vp');
expect(obj.$attrs.rowsGap).assertEqual('0.00vp'); expect(obj.$attrs.rowsGap).assertEqual('0.00vp');
expect(obj.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj.$attrs.scrollBar).assertEqual('BarState.Off');
......
...@@ -105,6 +105,7 @@ export default function RatingJsunit() { ...@@ -105,6 +105,7 @@ export default function RatingJsunit() {
console.info('[RatingJsunit_0400] START'); console.info('[RatingJsunit_0400] START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'stars',value:7}) globalThis.value.message.notify({name:'stars',value:7})
await CommonFunc.sleep(2000);
// Get the stars value of the Rating component // Get the stars value of the Rating component
let strJson = getInspectorByKey('rating1'); let strJson = getInspectorByKey('rating1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -140,12 +141,12 @@ export default function RatingJsunit() { ...@@ -140,12 +141,12 @@ export default function RatingJsunit() {
let driver = await UiDriver.create() let driver = await UiDriver.create()
let textComponent1 = await driver.findComponent(BY.key('text')); let textComponent1 = await driver.findComponent(BY.key('text'));
let text1 = await textComponent1.getText(); let text1 = await textComponent1.getText();
console.info("[TimePickerJsunit_0100] text1: " + JSON.stringify(text1)); console.info("[RatingJsunit_0600] text1: " + JSON.stringify(text1));
expect(text1).assertEqual('no change'); expect(text1).assertEqual('no change');
// Get the rating value of the Rating component // Get the rating value of the Rating component
let strJson = getInspectorByKey('rating1'); let strJson1 = getInspectorByKey('rating1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson1);
console.info("[RatingJsunit_0600] component obj is: " + JSON.stringify(obj)); console.info("[RatingJsunit_0600] component obj is: " + JSON.stringify(obj));
let rating1 = obj.$attrs.rating let rating1 = obj.$attrs.rating
console.info("[RatingJsunit_0600] rating1: " + JSON.stringify(rating1)); console.info("[RatingJsunit_0600] rating1: " + JSON.stringify(rating1));
...@@ -154,12 +155,15 @@ export default function RatingJsunit() { ...@@ -154,12 +155,15 @@ export default function RatingJsunit() {
let textComponent = await driver.findComponent(BY.key('rating1')); let textComponent = await driver.findComponent(BY.key('rating1'));
await textComponent.click(); await textComponent.click();
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let rating2 = obj.$attrs.rating let strJson2 = getInspectorByKey('rating1');
let obj2 = JSON.parse(strJson2);
let rating2 = obj2.$attrs.rating
console.info("[RatingJsunit_0600] rating2: " + JSON.stringify(rating2)); console.info("[RatingJsunit_0600] rating2: " + JSON.stringify(rating2));
expect(rating1 == rating2).assertFalse(); expect(rating1 == rating2).assertFalse();
let text2 = await textComponent1.getText(); let textComponent2 = await driver.findComponent(BY.key('text'));
console.info("[TimePickerJsunit_0100] text2: " + JSON.stringify(text2)); let text2 = await textComponent2.getText();
console.info("[RatingJsunit_0600] text2: " + JSON.stringify(text2));
expect(text2).assertEqual('change succ'); expect(text2).assertEqual('change succ');
console.info('[RatingJsunit_0600] END'); console.info('[RatingJsunit_0600] END');
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册