提交 8c9ce3d4 编写于 作者: C chensi10

badge part2

Signed-off-by: Nchensi10 <chensi52@huawei.com>
上级 02122f24
......@@ -816,6 +816,376 @@ export default function badgeTest() {
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0100
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to 5
*/
it('ArkUX_Stage_Badge_BorderWidth_0100', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0100 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0100');
console.info('ArkUX_Stage_Badge_BorderWidth_0100 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0100 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0100 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0100 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0200
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to "5"
*/
it('ArkUX_Stage_Badge_BorderWidth_0200', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0200 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0200');
console.info('ArkUX_Stage_Badge_BorderWidth_0200 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0200 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00px");
console.info('ArkUX_Stage_Badge_BorderWidth_0200 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0200 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0300
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property argument to $r("app.string.badge_Size_test")
*/
it('ArkUX_Stage_Badge_BorderWidth_0300', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0300 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0300');
console.info('ArkUX_Stage_Badge_BorderWidth_0300 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0300 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("7.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0300 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0300 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0400
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value ""
*/
it('ArkUX_Stage_Badge_BorderWidth_0400', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0400 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0400');
console.info('ArkUX_Stage_Badge_BorderWidth_0400 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0400 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0400 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0400 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0500
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value null
*/
it('ArkUX_Stage_Badge_BorderWidth_0500', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0500 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0500');
console.info('ArkUX_Stage_Badge_BorderWidth_0500 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0500 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0500 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0500 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0600
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value undefined
*/
it('ArkUX_Stage_Badge_BorderWidth_0600', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0600 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0600');
console.info('ArkUX_Stage_Badge_BorderWidth_0600 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0600 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0600 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0600 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0700
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to 5,
* and set the BorderWidth property parameter to "7fp" again
*/
it('ArkUX_Stage_Badge_BorderWidth_0700', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0700 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0700');
console.info('ArkUX_Stage_Badge_BorderWidth_0700 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0700 component style.borderWidth is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("7.00fp");
console.info('ArkUX_Stage_Badge_BorderWidth_0700 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0700 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0800
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to 5
* and set the BorderWidth property parameter to undefined again
*/
it('ArkUX_Stage_Badge_BorderWidth_0800', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0800 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0800');
console.info('ArkUX_Stage_Badge_BorderWidth_0800 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0800 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0800 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0800 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_0900
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Sets the BorderWidth property parameter to the exception value "asdf%^7"
*/
it('ArkUX_Stage_Badge_BorderWidth_0900', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_0900 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_0900');
console.info('ArkUX_Stage_Badge_BorderWidth_0900 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_0900 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_0900 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_0900 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1000
* @tc.name Tests the BorderWidth property of the badge component
* @tc.desc Set the BorderWidth property parameter to "5lpx"
* and the common property width property value to the outlier value 7
*/
it('ArkUX_Stage_Badge_BorderWidth_1000', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1000');
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1000 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00lpx");
console.info('ArkUX_Stage_Badge_BorderWidth_1000 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1000 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1100
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Set the BorderWidth property argument to 0
*/
it('ArkUX_Stage_Badge_BorderWidth_1100', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1000 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1100');
console.info('ArkUX_Stage_Badge_BorderWidth_1100 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1100 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("0.00vp");
console.info('ArkUX_Stage_Badge_BorderWidth_1100 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1100 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1200
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Simultaneous setting BorderWidth(5) fontWeight(600) BorderColor(#FFFD0000)
*/
it('ArkUX_Stage_Badge_BorderWidth_1200', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1200 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1200');
console.info('ArkUX_Stage_Badge_BorderWidth_1200 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1200 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("5.00vp");
expect(style.fontWeight).assertEqual("FontWeight.600");
expect(style.borderColor).assertEqual("#FFFD0000");
console.info('ArkUX_Stage_Badge_BorderWidth_1200 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1200 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
/**
* @tc.number ArkUX_Stage_Badge_BorderWidth_1300
* @tc.name Combined test all new attributes of the Badge component
* @tc.desc Do not set new attributes
*/
it('ArkUX_Stage_Badge_BorderWidth_1300', 0, async function (done) {
console.info('ArkUX_Stage_Badge_BorderWidth_1300 START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Badge_BorderWidth_1300');
console.info('ArkUX_Stage_Badge_BorderWidth_1300 START :' + JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj is: " + JSON.stringify(obj));
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs is: " + JSON.stringify(obj.$attrs));
console.info("ArkUX_Stage_Badge_BorderWidth_1300 component obj.$attrs.style is: " +
JSON.stringify(obj.$attrs.style));
let style = JSON.parse(obj.$attrs.style);
expect(style.borderWidth).assertEqual("1.00vp");
expect(style.fontWeight).assertEqual("FontWeight.Normal");
expect(style.borderColor).assertEqual("#FFFA2A2D");
console.info('ArkUX_Stage_Badge_BorderWidth_1300 END ');
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Badge_BorderWidth_1300 ERR ' + JSON.stringify(err));
done();
}
}, 500)
});
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册