From e6638ada59864f5459a5bd22e0b059a838df4f46 Mon Sep 17 00:00:00 2001 From: liu-xu01 Date: Fri, 31 Dec 2021 14:16:36 +0800 Subject: [PATCH] fixed 5cdddfc from https://gitee.com/liu-xu01/xts_acts/pulls/1485 ACEcommit Signed-off-by: liu-xu01 --- .../ets/MainAbility/test/BadgeJsunit.test.ets | 34 ++++++++---- .../ets/MainAbility/test/BlankJsunit.test.ets | 35 ++++++++---- .../MainAbility/test/ButtonJsunit.test.ets | 36 ++++++++---- .../MainAbility/test/ColumnJsunit.test.ets | 32 ++++++++--- .../test/ColumnSplitJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/CounterJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/DataPanelJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/DividerJsunit.test.ets | 32 +++++++---- .../ets/MainAbility/test/FlexJsunit.test.ets | 33 +++++++---- .../test/GridContainerJsunit.test.ets | 31 ++++++++--- .../ets/MainAbility/test/ImageJsunit.test.ets | 36 +++++++----- .../ets/MainAbility/test/PanelJsunit.test.ets | 36 +++++++----- .../MainAbility/test/ProgressJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/QrcodeJsunit.test.ets | 33 +++++++---- .../MainAbility/test/RatingJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/RowSplitJsunit.test.ets | 34 ++++++++---- .../MainAbility/test/ScrollJsunit.test.ets | 35 ++++++++---- .../MainAbility/test/SliderJsunit.test.ets | 33 +++++++---- .../ets/MainAbility/test/SpanJsunit.test.ets | 34 ++++++++---- .../ets/MainAbility/test/StackJsunit.test.ets | 40 ++++++++------ .../ets/MainAbility/test/TextJsunit.test.ets | 41 ++++++++------ .../test/AlphabetIndexerJsunit.test.ets | 33 ++++++++--- .../test/AppStorageJsunit.test.ets | 34 +++++++++--- .../ets/MainAbility/test/GridItem.test.ets | 33 ++++++++--- .../ets/MainAbility/test/GridJsnuit.test.ets | 33 ++++++++--- .../MainAbility/test/HyperLinkJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/LinkJsunit.test.ets | 33 ++++++++--- .../MainAbility/test/ListItemJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/ListJsunit.test.ets | 33 ++++++++--- .../MainAbility/test/NavigatorJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/PanelJsunit.test.ets | 32 ++++++++--- .../ets/MainAbility/test/PropJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/RowJsunit.test.ets | 33 ++++++++--- .../MainAbility/test/SwiperJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/TabJsunit.test.ets | 55 ++++++++++--------- .../ets/MainAbility/test/TextJsunit.test.ets | 33 ++++++++--- .../ets/MainAbility/test/VideoJsunit.test.ets | 33 ++++++++--- 37 files changed, 869 insertions(+), 406 deletions(-) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets index 65096d6a4..56c4a67a0 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets @@ -30,6 +30,29 @@ export default function badgeJsunit() { } describe('badgeTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Badge', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Badge state success " + JSON.stringify(pages)); + if(!("Badge" == pages.name)){ + console.info("get Badge state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Badge page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Badge page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0600 @@ -38,16 +61,6 @@ export default function badgeJsunit() { */ it('testBadge010', 0, async function (done) { console.info('new Badge0 START'); - let options = { - uri: 'pages/Badge', - } - try { - let result = await router.push(options) - console.info("push badge page success " + JSON.stringify(result)); - } catch (err) { - console.error("push badge page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('badge'); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Badge'); @@ -91,7 +104,6 @@ export default function badgeJsunit() { */ it('testBadge030', 0, async function (done) { console.info('new Badge2 START'); - let strJson = getInspectorByKey('badge2'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BlankJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BlankJsunit.test.ets index cdf8c5bec..ae127c171 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BlankJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BlankJsunit.test.ets @@ -30,23 +30,36 @@ export default function blankJsunit() { } describe('BlankTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0630 - * @tc.name testBlankGetInspectorByKey010 - * @tc.desc aceEtsTest - */ - it('BlankGetInspectorByKey', 0, async function (done) { - console.info('testGetInspectorByKey START'); + beforeEach(async function{ let options = { uri: 'pages/Blank', } try { - let result = await router.push(options) - console.info("push blank page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Blank state success " + JSON.stringify(pages)); + if(!("Blank" == pages.name)){ + console.info("get Blank state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Blank page success " + JSON.stringify(result)); + } } catch (err) { - console.error("push blan page error " + JSON.stringify(result)); + console.error("push Blank page error " + JSON.stringify(result)); } - await sleep(1) + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0630 + * @tc.name testBlankGetInspectorByKey010 + * @tc.desc aceEtsTest + */ + it('BlankGetInspectorByKey', 0, async function (done) { let strJson = getInspectorByKey('blank'); let obj = JSON.parse(strJson); console.info("cd blank component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets index 9a7164b63..ebaadd53f 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets @@ -30,23 +30,37 @@ export default function buttonJsunit() { } describe('buttonTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0640 - * @tc.name testButtonGetInspectorByKey010 - * @tc.desc aceEtsTest - */ - it('buttonGetInspectorByKey010', 0, async function (done) { - console.info('testGetInspectorByKey START'); + beforeEach(async function{ let options = { uri: 'pages/Button', } try { - let result = await router.push(options) - console.info("push button page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Button state success " + JSON.stringify(pages)); + if(!("Button" == pages.name)){ + console.info("get Button state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Button page success " + JSON.stringify(result)); + } } catch (err) { - console.error("push button page error " + JSON.stringify(result)); + console.error("push Button page error " + JSON.stringify(result)); } await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0640 + * @tc.name testButtonGetInspectorByKey010 + * @tc.desc aceEtsTest + */ + it('buttonGetInspectorByKey010', 0, async function (done) { + console.info('testGetInspectorByKey START'); let strJson = getInspectorByKey('button'); let obj = JSON.parse(strJson); console.info("cd button component obj is: " + JSON.stringify(obj)); @@ -67,7 +81,6 @@ export default function buttonJsunit() { * @tc.desc aceEtsTest */ it('ButtonGetInspectorByKey020', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('button1'); let obj = JSON.parse(strJson); console.info("cd button1 component obj is: " + JSON.stringify(obj)); @@ -86,7 +99,6 @@ export default function buttonJsunit() { * @tc.desc aceEtsTest */ it('ButtonGetInspectorByKey030', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('button2'); let obj = JSON.parse(strJson); console.info("cd button2 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnJsunit.test.ets index a0458493f..ef775c0b6 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnJsunit.test.ets @@ -30,23 +30,37 @@ export default function columnJsunit() { } describe('columnTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0670 - * @tc.name testColumn010 - * @tc.desc aceEtsTest - */ - it('testColumn010', 0, async function (done) { - console.info('new Column0 START'); + beforeEach(async function{ let options = { uri: 'pages/Column', } try { - let result = await router.push(options) - console.info("push Column page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Column state success " + JSON.stringify(pages)); + if(!("Column" == pages.name)){ + console.info("get Column state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Column page success " + JSON.stringify(result)); + } } catch (err) { console.error("push Column page error " + JSON.stringify(result)); } + await sleep(2) + }); + + afterEach(async function{ await sleep(3) + console.info("await 3s "); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0670 + * @tc.name testColumn010 + * @tc.desc aceEtsTest + */ + it('testColumn010', 0, async function (done) { + console.info('new Column0 START'); let strJson = getInspectorByKey('column'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnSplitJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnSplitJsunit.test.ets index 78ed56dd4..b7fea6ddf 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnSplitJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ColumnSplitJsunit.test.ets @@ -30,6 +30,30 @@ export default function columnSplitJsunit() { } describe('columnSplitTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/ColumnSplit', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get ColumnSplit state success " + JSON.stringify(pages)); + if(!("ColumnSplit" == pages.name)){ + console.info("get ColumnSplit state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push ColumnSplit page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push ColumnSplit page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0700 * @tc.name testColumnSplit010 @@ -37,16 +61,6 @@ export default function columnSplitJsunit() { */ it('testColumnSplit010', 0, async function (done) { console.info('new columnSplit0 START'); - let options = { - uri: 'pages/ColumnSplit', - } - try { - let result = await router.push(options) - console.info("push columnSplit page success " + JSON.stringify(result)); - } catch (err) { - console.error("push columnSplit page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('columnSplit') let obj = JSON.parse(strJson) console.info("component obj is: " + JSON.stringify(obj)) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/CounterJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/CounterJsunit.test.ets index 621aa32b3..ae615ebfc 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/CounterJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/CounterJsunit.test.ets @@ -30,6 +30,30 @@ export default function counterJsunit() { } describe('counterTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Counter', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Counter state success " + JSON.stringify(pages)); + if(!("Counter" == pages.name)){ + console.info("get Counter state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Counter page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Counter page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0720 * @tc.name testCounterGetInspectorByKey010 @@ -37,16 +61,6 @@ export default function counterJsunit() { */ it('testCounterGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/Counter', - } - try { - let result = await router.push(options) - console.info("push counter page success " + JSON.stringify(result)); - } catch (err) { - console.error("push counter page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('counter'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets index 11fd18e4e..f9d93071d 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets @@ -30,6 +30,29 @@ export default function datapanelJsunit() { } describe('dataPanelTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/DataPanel', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get DataPanel state success " + JSON.stringify(pages)); + if(!("DataPanel" == pages.name)){ + console.info("get DataPanel state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push DataPanel page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push DataPanel page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0730 @@ -38,16 +61,6 @@ export default function datapanelJsunit() { */ it('testDataPanelGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/DataPanel', - } - try { - let result = await router.push(options) - console.info("push DataPanel success " + JSON.stringify(result)); - } catch (err) { - console.error("push DataPanel page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('DataPanel'); let obj = JSON.parse(strJson); console.info("cd DatePanel component obj is: " + JSON.stringify(obj)); @@ -72,7 +85,6 @@ export default function datapanelJsunit() { */ it('testDataPanelGetInspectorByKey020', 0, async function (done) { console.info('testGetInspectorByKey START'); - await sleep(1) let strJson = getInspectorByKey('DataPanel2'); let obj = JSON.parse(strJson); console.info("cd DatePanel component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DividerJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DividerJsunit.test.ets index 120f087a4..0500326d1 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DividerJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DividerJsunit.test.ets @@ -30,23 +30,35 @@ export default function dividerJsunit() { } describe('dividerTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0750 - * @tc.name testDividerGetInspectorByKey010 - * @tc.desc aceEtsTest - */ - it('testDividerGetInspectorByKey010', 0, async function (done) { - console.info('testGetInspectorByKey START'); + beforeEach(async function{ let options = { uri: 'pages/Divider', } try { - let result = await router.push(options) - console.info("push divider page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get divider state success " + JSON.stringify(pages)); + if(!("Divider" == pages.name)){ + console.info("get divider state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push divider page success " + JSON.stringify(result));} } catch (err) { console.error("push divider page error " + JSON.stringify(result)); } await sleep(1) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0750 + * @tc.name testDividerGetInspectorByKey010 + * @tc.desc aceEtsTest + */ + it('testDividerGetInspectorByKey010', 0, async function (done) { + console.info('testGetInspectorByKey START'); let strJson = getInspectorByKey('divider'); let obj = JSON.parse(strJson); console.info("cd divider component obj is: " + JSON.stringify(obj)); @@ -71,7 +83,6 @@ export default function dividerJsunit() { * @tc.desc aceEtsTest */ it('testDividerGetInspectorByKey020', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('divider1'); let obj = JSON.parse(strJson); console.info(" divider1 component obj is: " + JSON.stringify(obj)); @@ -88,7 +99,6 @@ export default function dividerJsunit() { * @tc.desc aceEtsTest */ it('testDividerGetInspectorByKey030', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('divider2'); let obj = JSON.parse(strJson); console.info(" divider2 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets index c7bf0f935..81e73ae4f 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets @@ -30,23 +30,36 @@ export default function flexJsunit() { } describe('flexTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0770 - * @tc.name testFlex010 - * @tc.desc aceEtsTest - */ - it('testFlex010', 0, async function (done) { - console.info('new Flex0 START'); + beforeEach(async function{ let options = { uri: 'pages/Flex', } try { - let result = await router.push(options) - console.info("push Flex page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Flex state success " + JSON.stringify(pages)); + if(!("Flex" == pages.name)){ + console.info("get Flex state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Flex page success " + JSON.stringify(result)); + } } catch (err) { console.error("push Flex page error " + JSON.stringify(result)); } - await sleep(1) + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0770 + * @tc.name testFlex010 + * @tc.desc aceEtsTest + */ + it('testFlex010', 0, async function (done) { + console.info('new Flex0 START'); let strJson = getInspectorByKey('flex'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/GridContainerJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/GridContainerJsunit.test.ets index db921fd46..da5d01084 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/GridContainerJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/GridContainerJsunit.test.ets @@ -30,23 +30,36 @@ export default function gridContainerJsunit() { } describe('gridContainerTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0830 - * @tc.name testGridContainer010 - * @tc.desc aceEtsTest - */ - it('testGridContainer010', 0, async function (done) { - console.info('new GridContainer0 START'); + beforeEach(async function{ let options = { uri: 'pages/GridContainer', } try { - let result = await router.push(options) - console.info("push GridContainer page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get GridContainer state success " + JSON.stringify(pages)); + if(!("GridContainer" == pages.name)){ + console.info("get GridContainer state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push GridContainer page success " + JSON.stringify(result)); + } } catch (err) { console.error("push GridContainer page error " + JSON.stringify(result)); } await sleep(1) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0830 + * @tc.name testGridContainer010 + * @tc.desc aceEtsTest + */ + it('testGridContainer010', 0, async function (done) { + console.info('new GridContainer0 START'); let strJson = getInspectorByKey('gridContainer'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets index eef93cef8..e77d00d25 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets @@ -30,23 +30,37 @@ export default function imageJsunit() { } describe('imageTest', function () { - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0880 - * @tc.name testGetImageAttr010 - * @tc.desc aceEtsTest - */ - it('testGetImageAttr010', 0, async function (done) { - console.info('testGetImageAttr1 START'); + beforeEach(async function{ let options = { uri: 'pages/Image', } try { - let result = await router.push(options) - console.info("push image page success " + JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Image state success " + JSON.stringify(pages)); + if(!("Image" == pages.name)){ + console.info("get Image state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Image page success " + JSON.stringify(result)); + } } catch (err) { console.error("push image page error " + JSON.stringify(result)); } await sleep(1) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0880 + * @tc.name testGetImageAttr010 + * @tc.desc aceEtsTest + */ + it('testGetImageAttr010', 0, async function (done) { + console.info('testGetImageAttr1 START'); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -73,7 +87,6 @@ export default function imageJsunit() { */ it('testGetImageAttr020', 0, async function (done) { console.info('testGetImageAttr2 START'); - await sleep(1) let strJson = getInspectorByKey('image2'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -94,7 +107,6 @@ export default function imageJsunit() { */ it('testGetImageAttr030', 0, async function (done) { console.info('testGetImageAttr3 START'); - await sleep(1) let strJson = getInspectorByKey('image3'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -114,7 +126,6 @@ export default function imageJsunit() { */ it('testGetImageAttr040', 0, async function (done) { console.info('testGetImageAttr4 START'); - await sleep(1) let strJson = getInspectorByKey('image4'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -134,7 +145,6 @@ export default function imageJsunit() { */ it('testGetImageAttr050', 0, async function (done) { console.info('testGetImageAttr5 START'); - await sleep(1) let strJson = getInspectorByKey('image5'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets index edfbf1003..693446921 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets @@ -30,24 +30,36 @@ export default function panelJsunit() { } describe('panelTest', function () { - - /** - * @tc.number SUB_ACE_BASIC_ETS_API_0930 - * @tc.name testPanelGetInspectorByKey010 - * @tc.desc aceEtsTest - */ - it('testPanelGetInspectorByKey010', 0, async function (done) { - console.info('++++++++++++++++ Panel TestCase 1 START ++++++++++++++++'); + beforeEach(async function{ let options = { uri: 'pages/Panel', } try { - let result = await router.push(options) - console.info(JSON.stringify(result)); + router.clear(); + let pages = router.getState(); + console.info("get Panel state success " + JSON.stringify(pages)); + if(!("Panel" == pages.name)){ + console.info("get Panel state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Panel page success " + JSON.stringify(result)); + } } catch (err) { console.error(JSON.stringify(result)); - } + } await sleep(1) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0930 + * @tc.name testPanelGetInspectorByKey010 + * @tc.desc aceEtsTest + */ + it('testPanelGetInspectorByKey010', 0, async function (done) { + console.info('++++++++++++++++ Panel TestCase 1 START ++++++++++++++++'); let strJson = getInspectorByKey('panel'); let obj = JSON.parse(strJson); console.log(JSON.stringify(obj.$type)) @@ -75,7 +87,6 @@ export default function panelJsunit() { */ it('testPanelGetInspectorByKey020', 0, async function (done) { console.info('++++++++++++++++ Panel TestCase 2 START ++++++++++++++++'); - await sleep(1) let strJson = getInspectorByKey('panel2'); let obj = JSON.parse(strJson); console.log(JSON.stringify(obj.$type)) @@ -97,7 +108,6 @@ export default function panelJsunit() { */ it('testPanelGetInspectorByKey030', 0, async function (done) { console.info('++++++++++++++++ Panel TestCase 3 START ++++++++++++++++'); - await sleep(1) let strJson = getInspectorByKey('panel3'); let obj = JSON.parse(strJson); console.log(JSON.stringify(obj.$type)) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets index cc60be023..84dce5817 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets @@ -30,6 +30,29 @@ export default function progressJsunit() { } describe('progressTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Progress', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Progress state success " + JSON.stringify(pages)); + if(!("Progress" == pages.name)){ + console.info("get Progress state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Progress page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Progress page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0960 @@ -38,16 +61,6 @@ export default function progressJsunit() { */ it('testGetProgressAttr010', 0, async function (done) { console.info('testGetProgressAttr START'); - let options = { - uri: 'pages/Progress', - } - try { - let result = await router.push(options) - console.info("push Progress page success " + JSON.stringify(result)); - } catch (err) { - console.error("push Progress page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('progress'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -76,7 +89,6 @@ export default function progressJsunit() { */ it('testGetProgressAttr020', 0, async function (done) { console.info('testGetProgressAttr2 START'); - await sleep(1) let strJson = getInspectorByKey('progress2'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets index bfd8f1a90..7853864a8 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets @@ -30,6 +30,29 @@ export default function qrcodeJsunit() { } describe('QrcodeTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Qrcode', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Qrcode state success " + JSON.stringify(pages)); + if(!("Qrcode" == pages.name)){ + console.info("get Qrcode state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Qrcode page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Qrcode page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0980 @@ -38,16 +61,6 @@ export default function qrcodeJsunit() { */ it('testGetQrcodeAttr010', 0, async function (done) { console.info('testGetQrcodeAttr START'); - let options = { - uri: 'pages/Qrcode', - } - try { - let result = await router.push(options) - console.info("push Qrcode page success " + JSON.stringify(result)); - } catch (err) { - console.error("push Qrcode page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('qrcode'); let obj = JSON.parse(strJson); console.info("Qrcode component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RatingJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RatingJsunit.test.ets index 4030bc62a..992a3b5b3 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RatingJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RatingJsunit.test.ets @@ -30,6 +30,29 @@ export default function ratingJsunit() { } describe('ratingTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Rating', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Rating state success " + JSON.stringify(pages)); + if(!("Rating" == pages.name)){ + console.info("get Rating state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Rating page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Rating page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0990 @@ -38,16 +61,6 @@ export default function ratingJsunit() { */ it('testGetRatingAttr010', 0, async function (done) { console.info('testGetRatingAttr1 START'); - let options = { - uri: 'pages/Rating', - } - try { - let result = await router.push(options) - console.info("push Rating page success " + JSON.stringify(result)); - } catch (err) { - console.error("push Rating page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('rating1'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -73,7 +86,6 @@ export default function ratingJsunit() { */ it('testGetRatingAttr020', 0, async function (done) { console.info('testGetRatingAttr2 START'); - await sleep(1) let strJson = getInspectorByKey('rating2'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RowSplitJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RowSplitJsunit.test.ets index 25097e632..0c9937b6c 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RowSplitJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/RowSplitJsunit.test.ets @@ -30,6 +30,29 @@ export default function rowSplitJsunit() { } describe('RowSplitTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/RowSplit', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get RowSplit state success " + JSON.stringify(pages)); + if(!("RowSplit" == pages.name)){ + console.info("get RowSplit state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push RowSplit page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push RowSplit page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1010 @@ -38,16 +61,6 @@ export default function rowSplitJsunit() { */ it('testRowSplitGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/RowSplit', - } - try { - let result = await router.push(options) - console.info("push rowSplit page success " + JSON.stringify(result)); - } catch (err) { - console.error("push rowSplit page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('rowSplit'); let obj = JSON.parse(strJson); console.info("cd rowSplit component obj is: " + JSON.stringify(obj)); @@ -65,7 +78,6 @@ export default function rowSplitJsunit() { * @tc.desc aceEtsTest */ it('testRowSplitGetInspectorByKey020', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('rowSplit1'); let obj = JSON.parse(strJson); console.info("cd rowSplit1 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets index 3ed56a1b1..c77acecf5 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets @@ -30,6 +30,29 @@ export default function ScrollJsunit() { } describe('scrollTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Scroll', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Scroll state success " + JSON.stringify(pages)); + if(!("Scroll" == pages.name)){ + console.info("get Scroll state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Scroll page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Scroll page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1020 * @tc.name testScrollGetInspectorByKey010 @@ -37,16 +60,6 @@ export default function ScrollJsunit() { */ it('testScrollGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/Scroll', - } - try { - let result = await router.push(options) - console.info("push scroll page success " + JSON.stringify(result)); - } catch (err) { - console.error("push scroll page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('scroll'); let obj = JSON.parse(strJson); console.info("cd scroll component obj is: " + JSON.stringify(obj)); @@ -69,7 +82,6 @@ export default function ScrollJsunit() { * @tc.desc aceEtsTest */ it('testScrollGetInspectorByKey020', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('scroll1'); let obj = JSON.parse(strJson); console.info("cd scroll1 component obj is: " + JSON.stringify(obj)); @@ -87,7 +99,6 @@ export default function ScrollJsunit() { * @tc.desc aceEtsTest */ it('testScrollGetInspectorByKey030', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('scroll2'); let obj = JSON.parse(strJson); console.info("cd scroll2 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets index 465b5ea89..2030fd2a2 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets @@ -30,7 +30,29 @@ export default function sliderJsunit() { } describe('SliderTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Slider', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Slider state success " + JSON.stringify(pages)); + if(!("Slider" == pages.name)){ + console.info("get Slider state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Slider page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Slider page error " + JSON.stringify(result)); + } + await sleep(2) + }); + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1060 * @tc.name testGetSliderAttr010 @@ -38,16 +60,6 @@ export default function sliderJsunit() { */ it('testGetSliderAttr010', 0, async function (done) { console.info('testGetSliderAttr1 START'); - let options = { - uri: 'pages/Slider', - } - try { - let result = await router.push(options) - console.info("push Slider page success " + JSON.stringify(result)); - } catch (err) { - console.error("push Slider page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('slider1'); let obj = JSON.parse(strJson); console.info("component obj is Slider: " + JSON.stringify(obj)); @@ -82,7 +94,6 @@ export default function sliderJsunit() { */ it('testGetSliderAttr020', 0, async function (done) { console.info('testGetSliderAttr2 START'); - await sleep(1) let strJson = getInspectorByKey('slider2'); let obj = JSON.parse(strJson); console.info("component obj is Slider: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets index e7a1d86b5..aa13f10b3 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets @@ -30,7 +30,29 @@ export default function spanJsunit() { } describe('SpanTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Span', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Span state success " + JSON.stringify(pages)); + if(!("Span" == pages.name)){ + console.info("get Span state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Span page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Span page error " + JSON.stringify(result)); + } + await sleep(2) + }); + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1080 * @tc.name testGetSpanAttr010 @@ -38,16 +60,6 @@ export default function spanJsunit() { */ it('testGetSpanAttr010', 0, async function (done) { console.info('testGetSpanAttr1 START'); - let options = { - uri: 'pages/Span', - } - try { - let result = await router.push(options) - console.info("push Span page success " + JSON.stringify(result)); - } catch (err) { - console.error("push Span page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('span1'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -68,7 +80,6 @@ export default function spanJsunit() { */ it('testGetSpanAttr020', 0, async function (done) { console.info('testGetSpanAttr2 START'); - await sleep(1) let strJson = getInspectorByKey('span2'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); @@ -87,7 +98,6 @@ export default function spanJsunit() { */ it('testGetSpanAttr030', 0, async function (done) { console.info('testGetSpanAttr3 START'); - await sleep(1) let strJson = getInspectorByKey('span3'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/StackJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/StackJsunit.test.ets index 43fcbf05a..d67fa1455 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/StackJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/StackJsunit.test.ets @@ -30,7 +30,29 @@ export default function StackJsunit() { } describe('StackTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Stack', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Stack state success " + JSON.stringify(pages)); + if(!("Stack" == pages.name)){ + console.info("get Stack state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Stack page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Stack page error " + JSON.stringify(result)); + } + await sleep(2) + }); + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1110 * @tc.name testStackGetInspectorByKey010 @@ -38,16 +60,6 @@ export default function StackJsunit() { */ it('testStackGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/Stack', - } - try { - let result = await router.push(options) - console.info("push stack page success " + JSON.stringify(result)); - } catch (err) { - console.error("push stack page error " + JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('stack'); let obj = JSON.parse(strJson); console.info("cd stack component obj is: " + JSON.stringify(obj)); @@ -65,7 +77,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey020', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack1'); let obj = JSON.parse(strJson); console.info("cd stack1 component obj is: " + JSON.stringify(obj)); @@ -82,7 +93,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey030', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack2'); let obj = JSON.parse(strJson); console.info("cd stack2 component obj is: " + JSON.stringify(obj)); @@ -98,7 +108,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey040', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack3'); let obj = JSON.parse(strJson); console.info("cd stack3 component obj is: " + JSON.stringify(obj)); @@ -113,7 +122,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey050', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack4'); let obj = JSON.parse(strJson); console.info("cd stack4 component obj is: " + JSON.stringify(obj)); @@ -129,7 +137,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey060', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack5'); let obj = JSON.parse(strJson); console.info("cd stack5 component obj is: " + JSON.stringify(obj)); @@ -145,7 +152,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey070', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack6'); let obj = JSON.parse(strJson); console.info("cd stack6 component obj is: " + JSON.stringify(obj)); @@ -161,7 +167,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey080', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack7'); let obj = JSON.parse(strJson); console.info("cd stack7 component obj is: " + JSON.stringify(obj)); @@ -177,7 +182,6 @@ export default function StackJsunit() { * @tc.desc aceEtsTest */ it('testStackGetInspectorByKey090', 0, async function (done) { - await sleep(1) let strJson = getInspectorByKey('stack8'); let obj = JSON.parse(strJson); console.info("cd stack8 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets index e98481962..63291bd7c 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets @@ -30,7 +30,29 @@ export default function textJsunit() { } describe('textTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Text', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Text state success " + JSON.stringify(pages)); + if(!("Text" == pages.name)){ + console.info("get Text state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Text page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Text page error " + JSON.stringify(result)); + } + await sleep(2) + }); + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_1200 * @tc.name textGetInspectorByKey010 @@ -38,16 +60,7 @@ export default function textJsunit() { */ it('textGetInspectorByKey010', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/Text', - } - try { - let result = await router.push(options) - console.info("push text page success " + JSON.stringify(result)); - } catch (err) { - console.error("push text page error " + JSON.stringify(result)); - } - await sleep(2) + await sleep(3) let strJson = getInspectorByKey('Text'); let obj = JSON.parse(strJson); console.info("cd text component obj is: " + JSON.stringify(obj)); @@ -147,7 +160,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey020', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text1'); let obj = JSON.parse(strJson); console.info("cd text1 component obj is: " + JSON.stringify(obj)); @@ -191,7 +203,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey030', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text2'); let obj = JSON.parse(strJson); console.info("cd text2 component obj is: " + JSON.stringify(obj)); @@ -231,7 +242,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey040', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text3'); let obj = JSON.parse(strJson); console.info("cd text3 component obj is: " + JSON.stringify(obj)); @@ -257,7 +267,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey050', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text4'); let obj = JSON.parse(strJson); console.info("cd text4 component obj is: " + JSON.stringify(obj)); @@ -279,7 +288,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey060', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text5'); let obj = JSON.parse(strJson); console.info("cd text5 component obj is: " + JSON.stringify(obj)); @@ -301,7 +309,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey070', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text6'); let obj = JSON.parse(strJson); console.info("cd text6 component obj is: " + JSON.stringify(obj)); @@ -319,7 +326,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey080', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text7'); let obj = JSON.parse(strJson); console.info("cd text7 component obj is: " + JSON.stringify(obj)); @@ -337,7 +343,6 @@ export default function textJsunit() { * @tc.desc aceEtsTest */ it('textGetInspectorByKey090', 0, async function (done) { - await sleep(2) let strJson = getInspectorByKey('Text8'); let obj = JSON.parse(strJson); console.info("cd text8 component obj is: " + JSON.stringify(obj)); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AlphabetIndexerJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AlphabetIndexerJsunit.test.ets index 6bf0bbd7e..1b3304804 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AlphabetIndexerJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AlphabetIndexerJsunit.test.ets @@ -31,6 +31,30 @@ export default function alphabetIndexerJsunit() { describe('alphabetIndexerTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/AlphabetIndexer', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get AlphabetIndexer state success " + JSON.stringify(pages)); + if(!("AlphabetIndexer" == pages.name)){ + console.info("get AlphabetIndexer state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push AlphabetIndexer page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push AlphabetIndexer page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0100 * @tc.name alphabetIndexerTest001 @@ -38,15 +62,6 @@ export default function alphabetIndexerJsunit() { */ it('alphabetIndexerTest001', 0, async function (done) { console.info('AlphabetIndexerTest001 START'); - let options = { - uri: 'pages/AlphabetIndexer', - } - try { - let result = await router.push(options) - console.info("push AlphabetIndexer page success " + JSON.stringify(result)); - } catch (err) { - console.error("push AlphabetIndexer page error " + JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('alphabetIndexer'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets index 19eb775b6..f1411c62d 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets @@ -31,6 +31,31 @@ export default function appStorageJsunit() { describe('appStorageTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/AppStorage', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get AppStorage state success " + JSON.stringify(pages)); + if(!("AppStorage" == pages.name)){ + console.info("get AppStorage state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push AppStorage page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push AppStorage page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + + /** * @tc.number SUB_ACE_BASIC_ETS_API_0130 * @tc.name appStorageTest001 @@ -38,15 +63,6 @@ export default function appStorageJsunit() { */ it('appStorageTest001', 0, async function (done) { console.info('AppStorageTest001 START'); - let options = { - uri: 'pages/AppStorage', - } - try { - let result = await router.push(options) - console.info("push AppStorage0 page success " + JSON.stringify(result)); - } catch (err) { - console.error("push AppStorage0 page error " + JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('Button0_1'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridItem.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridItem.test.ets index 6821762af..047773dad 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridItem.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridItem.test.ets @@ -31,6 +31,30 @@ export default function gridItemJsunit() { describe('gridItemTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/GridItem', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get GridItem state success " + JSON.stringify(pages)); + if(!("GridItem" == pages.name)){ + console.info("get GridItem state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push GridItem page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push GridItem page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0340 * @tc.name gridItemTest001 @@ -38,15 +62,6 @@ export default function gridItemJsunit() { */ it('gridItemTest001', 0, async function (done) { console.info('gridItemTest001 START'); - let options = { - uri: 'pages/GridItem', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('GridItem1'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridJsnuit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridJsnuit.test.ets index 9c04ddca3..0079e61ad 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridJsnuit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/GridJsnuit.test.ets @@ -31,6 +31,30 @@ export default function gridJsunit() { describe('gridTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Grid', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Grid state success " + JSON.stringify(pages)); + if(!("Grid" == pages.name)){ + console.info("get Grid state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Grid page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Grid page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0350 * @tc.name gridItemTest001 @@ -38,15 +62,6 @@ export default function gridJsunit() { */ it('gridTest001', 0, async function (done) { console.info('gridTest001 START'); - let options = { - uri: 'pages/Grid', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('Grid'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/HyperLinkJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/HyperLinkJsunit.test.ets index b6e2be4d6..f2116580d 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/HyperLinkJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/HyperLinkJsunit.test.ets @@ -31,6 +31,30 @@ export default function hyperlinkJsunit() { describe('hyperLinkTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/HyperLink', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get HyperLink state success " + JSON.stringify(pages)); + if(!("HyperLink" == pages.name)){ + console.info("get HyperLink state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push HyperLink page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push HyperLink page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0360 * @tc.name hyperLinkTest001 @@ -38,15 +62,6 @@ export default function hyperlinkJsunit() { */ it('hyperLinkTest001', 0, async function (done) { console.info('++++++++++++++++ Hyperlink TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/HyperLink', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('hyperlink1'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/LinkJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/LinkJsunit.test.ets index b3f4fe35a..98e86701c 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/LinkJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/LinkJsunit.test.ets @@ -32,6 +32,30 @@ export default function linkJsunit() { describe('linkTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Link', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Link state success " + JSON.stringify(pages)); + if(!("Link" == pages.name)){ + console.info("get Link state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Link page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Link page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0370 * @tc.name linkTest001 @@ -39,15 +63,6 @@ export default function linkJsunit() { */ it('linkTest001', 0, async function (done) { console.info('linkTest001 START'); - let options = { - uri: 'pages/Link', - } - try { - let result = await router.push(options) - console.info("push link0 page success " + JSON.stringify(result)); - } catch (err) { - console.error("push link0 page error " + JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('Button'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets index b987c8243..1ba8efa0e 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets @@ -31,6 +31,30 @@ export default function listItemJsunit() { describe('listItemTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/ListItem', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get ListItem state success " + JSON.stringify(pages)); + if(!("ListItem" == pages.name)){ + console.info("get ListItem state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push ListItem page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push ListItem page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0390 * @tc.name listItemTest001 @@ -38,15 +62,6 @@ export default function listItemJsunit() { */ it('listItemTest001', 0, async function (done) { console.info('++++++++++++++++ ListItem TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/ListItem', - } - try { - let result = await router.push(options) - console.info(JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('listitem'); console.log(JSON.stringify(strJson)) diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListJsunit.test.ets index bd888366f..82dc4dcca 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListJsunit.test.ets @@ -31,6 +31,30 @@ export default function listJsunit() { describe('listTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/List', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get List state success " + JSON.stringify(pages)); + if(!("List" == pages.name)){ + console.info("get List state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push List page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push List page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0410 * @tc.name listTest001 @@ -38,15 +62,6 @@ export default function listJsunit() { */ it('listTest001', 0, async function (done) { console.info('++++++++++++++++ List TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/List', - } - try { - let result = await router.push(options) - console.info(JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('list'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/NavigatorJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/NavigatorJsunit.test.ets index 28bc34ece..0927b697d 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/NavigatorJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/NavigatorJsunit.test.ets @@ -31,6 +31,30 @@ export default function navigatorJsunit() { describe('navigatorTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Navigator', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Navigator state success " + JSON.stringify(pages)); + if(!("Navigator" == pages.name)){ + console.info("get Navigator state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Navigator page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Navigator page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0420 * @tc.name navigatorTest001 @@ -38,15 +62,6 @@ export default function navigatorJsunit() { */ it('navigatorTest001', 0, async function (done) { console.info('++++++++++++++++ Navigator TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/Navigator', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('navigator'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets index 592d6ca33..bed918399 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PanelJsunit.test.ets @@ -31,6 +31,29 @@ export default function panelJsunit() { describe('panelTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Panel', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Panel state success " + JSON.stringify(pages)); + if(!("Panel" == pages.name)){ + console.info("get Panel state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Panel page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Panel page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); /** * @tc.number SUB_ACE_BASIC_ETS_API_0440 * @tc.name panelTest001 @@ -38,15 +61,6 @@ export default function panelJsunit() { */ it('panelTest001', 0, async function (done) { console.info('++++++++++++++++ Panel TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/Panel', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('panel'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PropJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PropJsunit.test.ets index 780dff130..2cba855e3 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PropJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/PropJsunit.test.ets @@ -31,6 +31,30 @@ export default function propJsunit() { describe('propTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Prop', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Prop state success " + JSON.stringify(pages)); + if(!("Prop" == pages.name)){ + console.info("get Prop state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Prop page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Prop page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0470 * @tc.name propTest001 @@ -38,15 +62,6 @@ export default function propJsunit() { */ it('propTest001', 0, async function (done) { console.info('propTest001 START'); - let options = { - uri: 'pages/Prop', - } - try { - let result = await router.push(options) - console.info("push prop0 page success " + JSON.stringify(result)); - } catch (err) { - console.error("push prop0 page error " + JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('Text001'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/RowJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/RowJsunit.test.ets index d598e7ac0..d2813b08c 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/RowJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/RowJsunit.test.ets @@ -30,6 +30,30 @@ export default function rowJsunit() { } describe('rowTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Row', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Row state success " + JSON.stringify(pages)); + if(!("Row" == pages.name)){ + console.info("get Row state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Row page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Row page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0490 * @tc.name rowTest001 @@ -37,15 +61,6 @@ export default function rowJsunit() { */ it('rowTest001', 0, async function (done) { console.info('++++++++++++++++ Row TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/Row', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('row'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets index 6e901aac9..06a97bbc1 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets @@ -54,6 +54,30 @@ export default function swiperJsunit() { describe('swiperTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Swiper', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Swiper state success " + JSON.stringify(pages)); + if(!("Swiper" == pages.name)){ + console.info("get Swiper state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Swiper page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Swiper page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0500 * @tc.name swiperTest001 @@ -61,15 +85,6 @@ export default function swiperJsunit() { */ it('swiperTest001', 0, async function (done) { console.info('++++++++++++++++ Swiper TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/Swiper', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('swiper'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TabJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TabJsunit.test.ets index 1e6fbecb6..76dadcfef 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TabJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TabJsunit.test.ets @@ -31,6 +31,30 @@ export default function tabJsunit() { describe('tabTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Tab', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Tab state success " + JSON.stringify(pages)); + if(!("Tab" == pages.name)){ + console.info("get Tab state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Tab page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Tab page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0510 * @tc.name tabTest001 @@ -38,16 +62,6 @@ export default function tabJsunit() { */ it('tabTest001', 0, async function (done) { console.info('++++++++++++++++ Tab TestCase 1 START ++++++++++++++++'); - let options = { - uri: 'pages/Tab', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('tab'); let obj = JSON.parse(strJson); console.info("get inspector value is: " + JSON.stringify(obj)); @@ -55,10 +69,8 @@ export default function tabJsunit() { expect(obj.$type).assertEqual('Tabs') expect(obj.$attrs.barPosition).assertEqual('BarPosition.Start') expect(obj.$attrs.index).assertEqual('1') - console.info('obj.$attrs.scrollable———>' + typeof(obj.$attrs.scrollable)) - console.info('obj.$attrs.vertical———>' + typeof(obj.$attrs.vertical)) - expect(obj.$attrs.scrollable).assertTrue() - expect(obj.$attrs.vertical).assertEqual('true') + expect(obj.$attrs.vertical).assertEqual("true") + expect(obj.$attrs.scrollable).assertEqual("true") expect(obj.$attrs.barMode).assertEqual('BarMode.Fixed') expect(obj.$attrs.barWidth).assertEqual(70.000000.toFixed(6)) expect(obj.$attrs.barHeight).assertEqual(150.000000.toFixed(6)) @@ -73,16 +85,6 @@ export default function tabJsunit() { */ it('tabTest002', 0, async function (done) { console.info('++++++++++++++++ Tab TestCase 2 START ++++++++++++++++'); - let options = { - uri: 'pages/Tab', - } - try { - let result = await router.push(options) - console.info( JSON.stringify(result)); - } catch (err) { - console.error(JSON.stringify(result)); - } - await sleep(1) let strJson = getInspectorByKey('tabcontent'); let obj = JSON.parse(strJson); console.info("get inspector value is: " + JSON.stringify(obj)); @@ -101,7 +103,6 @@ export default function tabJsunit() { */ it('tabTest003', 0, async function (done) { console.info('++++++++++++++++ Tab TestCase 3 START ++++++++++++++++'); - await sleep(1) let strJson = getInspectorByKey('tab2'); let obj = JSON.parse(strJson); console.info("get inspector value is: " + JSON.stringify(obj)); @@ -109,8 +110,8 @@ export default function tabJsunit() { expect(obj.$type).assertEqual('Tabs') expect(obj.$attrs.barPosition).assertEqual('BarPosition.End') expect(obj.$attrs.barMode).assertEqual('BarMode.Scrollable') - expect(obj.$attrs.scrollable).assertFalse() - expect(obj.$attrs.vertical).assertEqual('false') + expect(obj.$attrs.vertical).assertEqual("false") + expect(obj.$attrs.scrollable).assertEqual("false") console.info('++++++++++++++++ Tab TestCase 3 End ++++++++++++++++'); done(); }); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets index 7acda65c9..178e18699 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets @@ -31,6 +31,30 @@ export default function textJsunit() { describe('textTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Text', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Text state success " + JSON.stringify(pages)); + if(!("Text" == pages.name)){ + console.info("get Text state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Text page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Text page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0540 * @tc.name textTest001 @@ -38,15 +62,6 @@ export default function textJsunit() { */ it('textTest001', 0, async function (done) { console.info('testGetInspectorByKey START'); - let options = { - uri: 'pages/Text', - } - try { - let result = await router.push(options) - console.info("push text page success " + JSON.stringify(result)); - } catch (err) { - console.error("push text page error " + JSON.stringify(result)); - } await sleep(2) let strJson = getInspectorByKey('Text'); let obj = JSON.parse(strJson); diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/VideoJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/VideoJsunit.test.ets index fcd204649..c5025195b 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/VideoJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/VideoJsunit.test.ets @@ -30,6 +30,30 @@ export default function videoJsunit() { } describe('VideoAppInfoTest', function () { + beforeEach(async function{ + let options = { + uri: 'pages/Video', + } + try { + router.clear(); + let pages = router.getState(); + console.info("get Video state success " + JSON.stringify(pages)); + if(!("Video" == pages.name)){ + console.info("get Video state success " + JSON.stringify(pages.name)); + let result = await router.push(options) + console.info("push Video page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push Video page error " + JSON.stringify(result)); + } + await sleep(2) + }); + + afterEach(async function{ + await sleep(3) + console.info("await 3s "); + }); + /** * @tc.number SUB_ACE_BASIC_ETS_API_0630 * @tc.name videoAppInfoTest001 @@ -37,15 +61,6 @@ export default function videoJsunit() { */ it('videoAppInfoTest001', 0, async function (done) { console.info('videoAppInfoTest001 START'); - let options = { - uri: 'pages/Video', - } - try { - let result = await router.push(options) - console.info("push video page success " + JSON.stringify(result)); - } catch (err) { - console.error("push video page error " + JSON.stringify(result)); - } await sleep(1) let strJson = getInspectorByKey('video'); let obj = JSON.parse(strJson); -- GitLab