From 252847a418209b49238d28e09402985d5c61004f Mon Sep 17 00:00:00 2001 From: hekun Date: Fri, 9 Jun 2023 15:20:40 +0800 Subject: [PATCH] add the test interface Signed-off-by: hekun --- .../entry/src/main/ets/test/circle.test.ets | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets index 0668c4d40..5b6a6482b 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets @@ -172,9 +172,62 @@ export default function circleNewJsunit() { }) console.info("-----------------------ACE_pushUrl_promise_0200 end-----------------------"); done(); - }); - + }); + + /** + * @tc.number showAlertBeforeBackPage_0100 + * @tc.name ACE_showAlertBeforeBackPage_0100 + * @tc.desc Test showAlertBeforeBackPage + */ + it("ACE_showAlertBeforeBackPage_0100", 0, async function (done) { + console.info("-----------------------ACE_showAlertBeforeBackPage_0100-----------------------"); + try { + ohosrouter.showAlertBeforeBackPage({ + message: 'Message Info' + }); + expect(true).assertTrue(); + } catch(error) { + console.error(`showAlertBeforeBackPage_0100 failed, code is ${error.code}, message is ${error.message}`); + expect().assertFail(); + } + done(); + }); + + /** + * @tc.number showAlertBeforeBackPage_0200 + * @tc.name ACE_showAlertBeforeBackPage_0200 + * @tc.desc Test showAlertBeforeBackPage + */ + it("ACE_showAlertBeforeBackPage_0200", 0, async function (done) { + console.info("-----------------------ACE_showAlertBeforeBackPage_0200-----------------------"); + try { + ohosrouter.showAlertBeforeBackPage({ + message:undefined + }); + expect(true).assertTrue(); + } catch(error) { + console.error(`ACE_showAlertBeforeBackPage_0200, code is ${error.code}, message is ${error.message}`); + expect(error.code == 401).assertTrue(); + } + done(); + }); + /** + * @tc.number hideAlertBeforeBackPage_0100 + * @tc.name ACE_hideAlertBeforeBackPage_0100 + * @tc.desc Test hideAlertBeforeBackPage + */ + it("ACE_hideAlertBeforeBackPage_0100", 0, async function (done) { + console.info("-----------------------ACE_showAlertBeforeBackPage_0200-----------------------"); + try { + ohosrouter.hideAlertBeforeBackPage(); + expect(true).assertTrue(); + } catch(error) { + console.error(`ACE_showAlertBeforeBackPage_0200, code is ${error.code}, message is ${error.message}`); + expect().assertFail(); + } + done(); + }); }) } -- GitLab