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

!8431 【ACE子系统】优化UI测试套因延时导致的偶现失败

Merge pull request !8431 from 王旭鹏/master
......@@ -101,17 +101,18 @@ export default function TimePickerJsunit() {
let switchButton = await driver.findComponent(BY.key('button'));
await switchButton.click();
await CommonFunc.sleep(1000);
let modeComponent = await driver.findComponent(BY.key('mode'));
let mode = await modeComponent.getText();
console.info("[TimePickerJsunit_0200] mode: " + JSON.stringify(mode));
expect(mode).assertEqual('24hour:true');
let strJson = getInspectorByKey('mode');
let obj = JSON.parse(strJson);
console.info("[TimePickerJsunit_0200] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('24hour:true');
// Verify switch 12-hour
await switchButton.click();
await CommonFunc.sleep(1000);
let mode1 = await modeComponent.getText();
console.info("[TimePickerJsunit_0200] mode1: " + JSON.stringify(mode1));
expect(mode1).assertEqual('24hour:false');
let strJson1 = getInspectorByKey('mode');
let obj1 = JSON.parse(strJson1);
console.info("[TimePickerJsunit_0200] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('24hour:false');
console.info('[TimePickerJsunit_0200] END');
done();
});
......@@ -123,21 +124,20 @@ export default function TimePickerJsunit() {
let switchButton = await driver.findComponent(BY.key('button'));
await switchButton.click();
await CommonFunc.sleep(1000);
let timePickerTop = CommonFunc.getComponentRect('timePicker');
let top = timePickerTop.top
let timePickerBottom = CommonFunc.getComponentRect('timePicker');
let bottom = timePickerBottom.bottom
let timePickerRight = CommonFunc.getComponentRect('timePicker');
let right = timePickerRight.right
let timePicker = CommonFunc.getComponentRect('timePicker');
let top = timePicker.top
let bottom = timePicker.bottom
let right = timePicker.right
let middle = (top + bottom) / 2
// Verify hour
let hour = await driver.findComponent(BY.key('hour'));
let hour1 = await hour.getText();
console.info("[TimePickerJsunit_0300] hour1: " + JSON.stringify(hour1));
await driver.swipe(Math.round(right * 0.23), Math.round(middle + 100), Math.round(right * 0.23), Math.round(middle - 100));
await driver.swipe(Math.round(right * 0.24), Math.round(middle + 100), Math.round(right * 0.24), Math.round(middle - 100));
await CommonFunc.sleep(1000);
let hour2 = await hour.getText();
let hourComponent = await driver.findComponent(BY.key('hour'));
let hour2 = await hourComponent.getText();
console.info("[TimePickerJsunit_0300] hour2: " + JSON.stringify(hour2));
expect(hour1 == hour2).assertFalse();
......
......@@ -79,14 +79,14 @@ export default function imageAniamtorJsunit() {
expect(obj.$attrs.state).assertEqual('AnimationStatus.Running');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Paused})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(2000);
let strJson2 = getInspectorByKey('imageAnimator');
let obj2 = JSON.parse(strJson2);
console.info('[imageAniamtorJsunit_0200] component obj2 is: ' + obj2.$attrs.state);
expect(obj2.$attrs.state).assertEqual('AnimationStatus.Paused');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Stopped})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(2000);
let strJson3 = getInspectorByKey('imageAnimator');
let obj3 = JSON.parse(strJson3);
console.info('[imageAniamtorJsunit_0200] component obj3 is: ' + obj3.$attrs.state);
......
......@@ -36,7 +36,7 @@ export default function imageOneJsunit() {
}
} catch (err) {
console.error("push imageOneJsunit page error:" + err);
expect().assertFail();
expect().assertFail();
}
done();
});
......@@ -114,42 +114,42 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000);
// test the enum of objectFit
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson = getInspectorByKey('objectFit');
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Auto})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson2 = getInspectorByKey('objectFit');
let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit);
expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson3 = getInspectorByKey('objectFit');
let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit);
expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson4 = getInspectorByKey('objectFit');
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit);
expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.None})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson5 = getInspectorByKey('objectFit');
let obj5 = JSON.parse(strJson5);
console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit);
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.None');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain})
await CommonFunc.sleep(100);
await CommonFunc.sleep(500);
let strJson6 = getInspectorByKey('objectFit');
let obj6 = JSON.parse(strJson6);
console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit);
......@@ -217,4 +217,4 @@ export default function imageOneJsunit() {
done();
});
})
}
\ No newline at end of file
}
......@@ -200,7 +200,7 @@ export default function sliderJsunit() {
let strJson = getInspectorByKey('tex');
let obj = JSON.parse(strJson);
console.info("[sliderJsunit_0800] obj: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('30');
expect(Math.round(obj.$attrs.content)).assertEqual(50);
let strJson1 = getInspectorByKey('modeT');
let obj1 = JSON.parse(strJson1);
console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1));
......@@ -241,4 +241,4 @@ export default function sliderJsunit() {
done();
});
})
}
\ No newline at end of file
}
......@@ -37,14 +37,14 @@ export default function textAreaJsunit() {
}
} catch (err) {
console.error("push textAreaJsunit page error:" + err);
expect().assertFail();
expect().assertFail();
}
done();
});
it('textAreaJsunit_0100', 0, async function (done) {
console.info('textAreaJsunit_0100');
await CommonFunc.sleep(30000);
await CommonFunc.sleep(1000);
// get the textArea component and test attribute
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册