diff --git a/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP23.test.ets b/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP23.test.ets index 512395cf59f292f3d7cffe4f3b418b61d6b8de0e..f6af6ea7962eb56edd60561ea856868a8cc846f5 100644 --- a/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP23.test.ets +++ b/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP23.test.ets @@ -67,32 +67,25 @@ export default function SR000HTP23Test() { console.info(`${SUITE} ${CASE} START`); let baseKey = 'MyList1_ListItem0' - setTimeout(async () => { - try { - let strJson = getInspectorByKey(baseKey); - let obj = JSON.parse(strJson); - expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); -// expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.None"); - - let rectCenter = getRectCenterVp(obj.$rect) - let driver = Driver.create() - await driver.swipe(rectCenter[0], rectCenter[1], 0, rectCenter[1]) - - let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); - let objButtonDel = JSON.parse(strJsonButtonDel); - expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); - let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); - let objButtonSet = JSON.parse(strJsonButtonSet); - expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); - - console.info(`${SUITE} ${CASE} END`); - } catch (err) { - expect().assertFail(); - console.info(`${SUITE} ${CASE} ERROR:` + JSON.stringify(err)); - } - done(); - }, 500) + let strJson = getInspectorByKey(baseKey); + let obj = JSON.parse(strJson); + expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); +// expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.None"); + + let rectCenter = getRectCenterVp(obj.$rect) + let driver = Driver.create() + await driver.swipe(rectCenter[0], rectCenter[1], 0, rectCenter[1]) + + let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); + let objButtonDel = JSON.parse(strJsonButtonDel); + expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); + let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); + let objButtonSet = JSON.parse(strJsonButtonSet); + expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); + + console.info(`${SUITE} ${CASE} END`); + done(); }); /* @@ -105,32 +98,25 @@ export default function SR000HTP23Test() { console.info(`${SUITE} ${CASE} START`); let baseKey = 'MyList2_ListItem0' - setTimeout(async () => { - try { - let strJson = getInspectorByKey(baseKey); - let obj = JSON.parse(strJson); - expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); -// expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.None"); - - let rectCenter = getRectCenterVp(obj.$rect) - let driver = Driver.create() - await driver.swipe(rectCenter[0], rectCenter[1], 600, rectCenter[1]) - - let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); - let objButtonDel = JSON.parse(strJsonButtonDel); - expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); - let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); - let objButtonSet = JSON.parse(strJsonButtonSet); - expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); - - console.info(`${SUITE} ${CASE} END`); - } catch (err) { - expect().assertFail(); - console.info(`${SUITE} ${CASE} ERROR:` + JSON.stringify(err)); - } - done(); - }, 500) + let strJson = getInspectorByKey(baseKey); + let obj = JSON.parse(strJson); + expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); +// expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.None"); + + let rectCenter = getRectCenterVp(obj.$rect) + let driver = Driver.create() + await driver.swipe(rectCenter[0], rectCenter[1], 600, rectCenter[1]) + + let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); + let objButtonDel = JSON.parse(strJsonButtonDel); + expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); + let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); + let objButtonSet = JSON.parse(strJsonButtonSet); + expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); + + console.info(`${SUITE} ${CASE} END`); + done(); }); /* @@ -143,32 +129,25 @@ export default function SR000HTP23Test() { console.info(`${SUITE} ${CASE} START`); let baseKey = 'MyList3_ListItem0' - setTimeout(async () => { - try { - let strJson = getInspectorByKey(baseKey); - let obj = JSON.parse(strJson); - expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.Spring"); - - let rectCenter = getRectCenterVp(obj.$rect) - let driver = Driver.create() - await driver.swipe(rectCenter[0], rectCenter[1], 0, rectCenter[1]) - - let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); - let objButtonDel = JSON.parse(strJsonButtonDel); - expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); - let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); - let objButtonSet = JSON.parse(strJsonButtonSet); - expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); - - console.info(`${SUITE} ${CASE} END`); - } catch (err) { - expect().assertFail(); - console.info(`${SUITE} ${CASE} ERROR:` + JSON.stringify(err)); - } - done(); - }, 500) + let strJson = getInspectorByKey(baseKey); + let obj = JSON.parse(strJson); + expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.Spring"); + + let rectCenter = getRectCenterVp(obj.$rect) + let driver = Driver.create() + await driver.swipe(rectCenter[0], rectCenter[1], 0, rectCenter[1]) + + let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); + let objButtonDel = JSON.parse(strJsonButtonDel); + expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); + let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); + let objButtonSet = JSON.parse(strJsonButtonSet); + expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); + + console.info(`${SUITE} ${CASE} END`); + done(); }); /* @@ -181,32 +160,25 @@ export default function SR000HTP23Test() { console.info(`${SUITE} ${CASE} START`); let baseKey = 'MyList4_ListItem0' - setTimeout(async () => { - try { - let strJson = getInspectorByKey(baseKey); - let obj = JSON.parse(strJson); - expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); - expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.Spring"); - - let rectCenter = getRectCenterVp(obj.$rect) - let driver = Driver.create() - await driver.swipe(0, rectCenter[1], rectCenter[0], rectCenter[1]) - - let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); - let objButtonDel = JSON.parse(strJsonButtonDel); - expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); - let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); - let objButtonSet = JSON.parse(strJsonButtonSet); - expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); - - console.info(`${SUITE} ${CASE} END`); - } catch (err) { - expect().assertFail(); - console.info(`${SUITE} ${CASE} ERROR:` + JSON.stringify(err)); - } - done(); - }, 500) + let strJson = getInspectorByKey(baseKey); + let obj = JSON.parse(strJson); + expect(obj.$attrs.startDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.endDeleteAreaDistance).assertEqual("0.00vp"); + expect(obj.$attrs.swipeAction.edgeEffect).assertEqual("SwipeEdgeEffect.Spring"); + + let rectCenter = getRectCenterVp(obj.$rect) + let driver = Driver.create() + await driver.swipe(0, rectCenter[1], rectCenter[0], rectCenter[1]) + + let strJsonButtonDel = getInspectorByKey(baseKey + '_Button_Del'); + let objButtonDel = JSON.parse(strJsonButtonDel); + expect(objButtonDel.$attrs.visibility).assertEqual("Visibility.Visible"); + let strJsonButtonSet = getInspectorByKey(baseKey + '_Button_Set'); + let objButtonSet = JSON.parse(strJsonButtonSet); + expect(objButtonSet.$attrs.visibility).assertEqual("Visibility.Visible"); + + console.info(`${SUITE} ${CASE} END`); + done(); }); /* diff --git a/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP2O.test.ets b/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP2O.test.ets index 5a21df97aae13c667a3723970325098e787fc7ef..b8f642efa0c6b4d8477ae9fdd5c42f4b0134773b 100644 --- a/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP2O.test.ets +++ b/arkui/ace_ets_component_api/src/main/ets/test/SR000HTP2O.test.ets @@ -62,7 +62,6 @@ export default function SR000HTP2OTest() { console.info(`${SUITE} ${CASE} START`) let strJson = getInspectorByKey('SR000HTP2O_Navigation1') let obj = JSON.parse(strJson); - sleep(2) expect(obj.$type).assertEqual('Navigation') console.info(`${SUITE} ${CASE} END`) done()