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 65096d6a4be380dd85ad1635dd5dd77da797939f..56c4a67a0e4e6e5a56ffb787603ed522c56eebb2 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 cdf8c5bec69c13c8beeeaf619fb36f38d4ddf2f5..ae127c1718f59133cd893f1c99f1edc364b4d1f2 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 9a7164b6376c2e533b237eafab2ec09dde4d9001..ebaadd53fc962ec88b1caa452b26f9bf74acf994 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 a0458493f3b70de4e03f0738f087fe3daa5bece2..ef775c0b61ef0f7f154a1202970bac09dedb2918 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 78ed56dd475ed4ac9fdb57547ea1722015a170c1..b7fea6ddfd8332ac854882d555cce7e1d6eaf0b1 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 621aa32b354cd1ae49d1265e517805d89d02e179..ae615ebfc2a705144b212d26a800eb1c052e1360 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 11fd18e4e05bccaf19f329b5d0ed0d0a9b48b31a..f9d93071dd7ecfd355f6811ba02aa68b2ab3aac7 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 120f087a49f30fee3fd07015c3849b8510745f3a..0500326d18f5801575d357848f711ad1e91e0430 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 c7bf0f935df46daa841dd5ad57819d5525734b81..81e73ae4f3bdfce486421ef779ee67f4db52826c 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 db921fd46a99894eb14b2c0f11fec7580066c8d2..da5d01084471ba6eea144de8fdc7327d58e96a23 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 eef93cef81bbc4ca73db91f693da781600cb223f..e77d00d2574a5f3111a64c1b81e99367016a38e3 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 edfbf1003701c315111b74e085ea388b247f15c7..6934469212eed1288bf5c61725bff1fe335a26cf 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 cc60be02329fcae4076711f5bf4fea2199518ea9..84dce58178641bc0743cdc97b17020fb59d4c883 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 bfd8f1a9046caf6b6ba8dcf7dd172d1aaa62af61..7853864a8bde5f4739f7b63917f59b6b041ccc2c 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 4030bc62a9ce4c12c731881527fc75f39dbcf878..992a3b5b31219c51c3c356d1898b5d070d613941 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 25097e63274ef5708b9b7e1ed9fe80167bfd2620..0c9937b6c710c16612d65be4fa22fef283ed3b1b 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 3ed56a1b18cd8c75dfddacf8106bb876c4bd2ad1..c77acecf52f1bf98900c38650a9deb10ad13ff15 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 465b5ea896c21c7c7ea05f888abe3f445486f208..2030fd2a2a33ab4d8f4b1b316007286b31b943c9 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 e7a1d86b55567c23cce5397ee00ada5a88ea8602..aa13f10b3fa63f24aeb52d6fce1ffe257c836c7c 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 43fcbf05a2dca843d31cc52f16f3db4d31a186cb..d67fa14559103dfb6921c48c4c4ee42651485ba3 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 e98481962253ae3cfd93386e0be9932c0fb6f701..63291bd7c46c5e4716f71b7292f2da977cdae671 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 6bf0bbd7ea4a934eff905cb87aefa6790c747584..1b3304804f010f61be2b4bc8b15355d641c954e1 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 19eb775b6311b9e558d2bef91ae2ef385d460e01..f1411c62d33fe8b39b36a1417d0b94477794abb6 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 6821762afc7aa333da0f72308fe0098ef867b4ec..047773dad1506f3ffcd7d05c047ed11805b500ca 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 9c04ddca36288329a9619b6b377e30c6a0d075d2..0079e61adbdae30aa4da88dc01c0b4d2338ba2d5 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 b6e2be4d630296df309cda281284ecc4d3e33032..f2116580d04fa546acfcede181c5a104c63195aa 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 b3f4fe35aca152c0a269df01f6d433c567740586..98e86701cb1137cc7ba912c82530c1894890cb91 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 b987c824396c04ef70d1ff0ef277940121a08da2..1ba8efa0e00911e56c6ececac9edd0e42d92ed46 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 bd888366f112d9ff0de11b4f2c56139aa4a86c22..82dc4dccab79190bf3e5253c55d723f7cbb188b6 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 28bc34ecee58e70e4eb4a636647e41f3ff3f4d4e..0927b697d6486ebc103060ad073650337690e574 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 592d6ca3340ecb6d482759361330c10fde524bc2..bed918399c1412277c9c081fd8484aea2774d231 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 780dff13051c3aa6c1d5362adf501bee7a6685b0..2cba855e393ea8b27810dcff7d208135552cf4a7 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 d598e7ac04dcd07ed7b961f43e02ab934a31d1a9..d2813b08cbdeb7e36f82754919a2c8588636a7e3 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 6e901aac92fb7a41ae36ee3e811233124cc253b3..06a97bbc1dd9c0de49ba3cda8b9e81899cdeebad 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 1e6fbecb66e465d57c4f7ccc5cb664b664f71a93..76dadcfefe7afeabbffd99554a324d1505726abb 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 7acda65c9ca0145d8bc791427ca0c86175215354..178e186994a9ea30b306da44813140782be1147b 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 fcd2046493b58d9af88310adcc62ba5b4f4f4a62..c5025195b1b72484aa24593434176ac911caeca8 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);