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

update marquee and textTwo

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 c49867d6
......@@ -72,31 +72,6 @@ export default function marqueeJsunit() {
});
it('marqueeJsunit_0300', 0, async function (done) {
console.info('marqueeJsunit_0300 START');
await CommonFunc.sleep(100);
// modify the values partly attribute illegal value of marguee dynamically
globalThis.value.message.notify({name:'loop',value:-30})
await CommonFunc.sleep(1000);
// check the value of changed attribute
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('2');
done();
});
it('marqueeJsunit_0400', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'step',value:50})
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('50.000000');
done();
});
it('marqueeJsunit_0500', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
await CommonFunc.sleep(1000);
// test event
......@@ -109,19 +84,45 @@ export default function marqueeJsunit() {
// check the test event
let ttx = await driver.findComponent(ON.id('text1'));
let txt = await ttx.getText();
console.info("[marqueeJsunit_0500'] component obj is: " + txt);
console.info("[marqueeJsunit_0300'] component obj is: " + txt);
expect(txt == 'onStart').assertTrue();
let ttxx = await driver.findComponent(ON.id('text2'));
let txtt = await ttxx.getText();
console.info("[marqueeJsunit_0500'] component obj2 is: " + txtt);
console.info("[marqueeJsunit_0300'] component obj2 is: " + txtt);
expect(txtt == 'onBounce').assertTrue();
await driver.delayMs(1000);
let ttxxx = await driver.findComponent(ON.id('text3'));
let txttt = await ttxxx.getText();
console.info("[marqueeJsunit_0500'] component obj3 is: " + txttt);
console.info("[marqueeJsunit_0300'] component obj3 is: " + txttt);
expect(txttt == 'onFinish').assertTrue();
done();
});
it('marqueeJsunit_0400', 0, async function (done) {
console.info('marqueeJsunit_0300 START');
await CommonFunc.sleep(100);
// modify the values partly attribute illegal value of marguee dynamically
globalThis.value.message.notify({name:'loop',value:-30})
await CommonFunc.sleep(1000);
// check the value of changed attribute
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('-30');
done();
});
it('marqueeJsunit_0500', 0, async function (done) {
console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'step',value:50})
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('50.000000');
done();
});
it('marqueeJsunit_0600', 0, async function (done) {
console.info('marqueeJsunit_0600 START');
// modify the values partly attribute illegal value of marguee dynamically
......@@ -130,7 +131,7 @@ export default function marqueeJsunit() {
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
// to confirm
expect(obj.$attrs.step).assertEqual('50.000000');
expect(obj.$attrs.step).assertEqual('-30.000000');
done();
});
......
......@@ -43,60 +43,62 @@ export default function textTwoJsunit() {
});
it('textTwoJsunit_0100', 0, async function (done) {
console.info('imageOneJsunit_0100 START');
console.info('textTwoJsunit_0200 START');
// test the illegal value of decoration
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:undefined})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:undefined})
await CommonFunc.sleep(1000);
// get the image component and test attribute
let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration);
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}');
done();
});
it('textTwoJsunit_0200', 0, async function (done) {
console.info('imageOneJsunit_0200 START');
await CommonFunc.sleep(500);
// get the image component and test attribute
let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0200 component obj is: ' + obj.$attrs.decoration);
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.LineThrough","color":"#FFFFEEAF"}');
await CommonFunc.sleep(1000);
// to modify the atrribute
globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'color',value:Color.Green})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:Color.Green})
await CommonFunc.sleep(200);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0100 component obj2 is: ' + obj2.$attrs.decoration);
console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Overline","color":"#FF008000"}');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:TextDecorationType.Underline})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'})
await CommonFunc.sleep(200);
let strJson3 = getInspectorByKey('text1');
let obj3 = JSON.parse(strJson3);
console.info('textTwoJsunit_0100 component obj3 is: ' + obj3.$attrs.decoration);
console.info('textTwoJsunit_0200 component obj3 is: ' + obj3.$attrs.decoration);
expect(obj3.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Underline","color":"#FFEE82EE"}');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:TextDecorationType.None})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'color',value:'#FFACEEEE'})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'#FFACEEEE'})
await CommonFunc.sleep(200);
let strJson4 = getInspectorByKey('text1');
let obj4 = JSON.parse(strJson4);
console.info('textTwoJsunit_0100 component obj4 is: ' + obj4.$attrs.decoration);
console.info('textTwoJsunit_0200 component obj4 is: ' + obj4.$attrs.decoration);
expect(obj4.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFACEEEE"}');
done();
});
it('textTwoJsunit_0200', 0, async function (done) {
console.info('textTwoJsunit_0200 START');
// test the illegal value of decoration
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:undefined})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'color',value:undefined})
await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFACEEEE"}');
done();
});
it('textTwoJsunit_0300', 0, async function (done) {
console.info('textTwoJsunit_0300 START');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册