提交 6b798bc2 编写于 作者: B bayanxing

change testcase position

Signed-off-by: Nbayanxing <bayanxing@kaihongdigi.com>
上级 ed5eb721
...@@ -27,25 +27,25 @@ describe('switchPropsJsTest', function () { ...@@ -27,25 +27,25 @@ describe('switchPropsJsTest', function () {
}).then(() => { }).then(() => {
console.info(`sleep ${time} over...`) console.info(`sleep ${time} over...`)
}) })
}; }
async function backToIndex() { async function backToIndex() {
let backToIndexPromise = new Promise((resolve, reject) => { let backToIndexPromise = new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
router.back({ router.back({
uri: 'pages/index/index' uri: 'pages/index/index'
}); });
resolve(); resolve()
}, 500); }, 500)
}); })
let clearPromise = new Promise((resolve, reject) => { let clearPromise = new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
router.clear(); router.clear()
resolve(); resolve()
}, 500); }, 500)
}); })
await backToIndexPromise.then(() => { await backToIndexPromise.then(() => {
return clearPromise; return clearPromise
}); })
} }
/** /**
...@@ -66,16 +66,16 @@ describe('switchPropsJsTest', function () { ...@@ -66,16 +66,16 @@ describe('switchPropsJsTest', function () {
} }
await sleep(4000) await sleep(4000)
done() done()
}); })
/** /**
* run after testcase * run after testcase
*/ */
afterAll(async function () { afterAll(async function () {
console.info('[switchPropsJsTest] after each called') console.info('[switchPropsJsTest] after each called')
await backToIndex(); await backToIndex()
await sleep(1000) await sleep(1000)
}); })
/** /**
* @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100
...@@ -672,7 +672,7 @@ describe('switchPropsJsTest', function () { ...@@ -672,7 +672,7 @@ describe('switchPropsJsTest', function () {
expect(obj.$type).assertEqual('switch') expect(obj.$type).assertEqual('switch')
expect(obj.$attrs.id).assertEqual('checkedNone') expect(obj.$attrs.id).assertEqual('checkedNone')
expect(obj.$attrs.checked).assertEqual(undefined) expect(obj.$attrs.checked).assertEqual('false')
console.info("[switchProps] get checked value is: " + JSON.stringify(obj.$attrs.checked)); console.info("[switchProps] get checked value is: " + JSON.stringify(obj.$attrs.checked));
done(); done();
}); });
...@@ -732,7 +732,7 @@ describe('switchPropsJsTest', function () { ...@@ -732,7 +732,7 @@ describe('switchPropsJsTest', function () {
expect(obj.$type).assertEqual('switch') expect(obj.$type).assertEqual('switch')
expect(obj.$attrs.id).assertEqual('showTextNone') expect(obj.$attrs.id).assertEqual('showTextNone')
expect(obj.$attrs.showtext).assertEqual(undefined) expect(obj.$attrs.showtext).assertEqual('false')
console.info("[switchProps] get showtext value is: " + JSON.stringify(obj.$attrs.showtext)); console.info("[switchProps] get showtext value is: " + JSON.stringify(obj.$attrs.showtext));
done(); done();
}); });
...@@ -772,7 +772,7 @@ describe('switchPropsJsTest', function () { ...@@ -772,7 +772,7 @@ describe('switchPropsJsTest', function () {
expect(obj.$type).assertEqual('switch') expect(obj.$type).assertEqual('switch')
expect(obj.$attrs.id).assertEqual('textOnNone') expect(obj.$attrs.id).assertEqual('textOnNone')
expect(obj.$attrs.texton).assertEqual(undefined) expect(obj.$attrs.texton).assertEqual('On')
console.info("[switchProps] get texton value is: " + JSON.stringify(obj.$attrs.texton)); console.info("[switchProps] get texton value is: " + JSON.stringify(obj.$attrs.texton));
done(); done();
}); });
...@@ -812,7 +812,7 @@ describe('switchPropsJsTest', function () { ...@@ -812,7 +812,7 @@ describe('switchPropsJsTest', function () {
expect(obj.$type).assertEqual('switch') expect(obj.$type).assertEqual('switch')
expect(obj.$attrs.id).assertEqual('textOffNone') expect(obj.$attrs.id).assertEqual('textOffNone')
expect(obj.$attrs.textoff).assertEqual(undefined) expect(obj.$attrs.textoff).assertEqual('Off')
console.info("[switchProps] get textoff value is: " + JSON.stringify(obj.$attrs.textoff)); console.info("[switchProps] get textoff value is: " + JSON.stringify(obj.$attrs.textoff));
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册