From 39c9aeca4c9874af62b272965a53a56b724aa059 Mon Sep 17 00:00:00 2001 From: bayanxing Date: Mon, 21 Feb 2022 12:56:37 +0800 Subject: [PATCH] modify testcase svg Signed-off-by: bayanxing --- .../main/js/default/pages/animate/index.hml | 117 +++------- .../js/default/pages/animateMotion/index.css | 17 -- .../js/default/pages/animateMotion/index.hml | 71 ++---- .../default/pages/animateTransform/index.css | 28 +-- .../default/pages/animateTransform/index.hml | 211 +++--------------- .../src/main/js/default/test/List.test.js | 6 +- .../js/default/test/componentJsApi.test.js | 174 +++++++++++++++ 7 files changed, 263 insertions(+), 361 deletions(-) create mode 100644 ace/ace_standard/src/main/js/default/test/componentJsApi.test.js diff --git a/ace/ace_standard/src/main/js/default/pages/animate/index.hml b/ace/ace_standard/src/main/js/default/pages/animate/index.hml index 0d5769819..590a28a1f 100644 --- a/ace/ace_standard/src/main/js/default/pages/animate/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/animate/index.hml @@ -1,92 +1,27 @@ +
-
-
- - 动画效果1 - - - - - - - - - -
-
- - 动画效果2 - - - - - - - -
-
-
-
- - 动画效果3 - - - - animate - - - - - - - - -
-
- - 动画效果4 - - - - - - animate - - - - - -
-
-
-
- - 动画效果5 - - - - - - - -
-
- - 动画效果6 - - - - - - - -
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/animateMotion/index.css b/ace/ace_standard/src/main/js/default/pages/animateMotion/index.css index b3ea8f221..e69de29bb 100644 --- a/ace/ace_standard/src/main/js/default/pages/animateMotion/index.css +++ b/ace/ace_standard/src/main/js/default/pages/animateMotion/index.css @@ -1,17 +0,0 @@ -.container { - width: 100%; - flex-direction: column; - align-items: center; -} -.title{ - font-size: 18px; - color: grey; - padding: 5px; - text-align: center; -} -.svg-style{ - border: 1px solid #000000; -} -.outerBox{ - flex-direction: column; -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/animateMotion/index.hml b/ace/ace_standard/src/main/js/default/pages/animateMotion/index.hml index b1e5bb38b..0d9ddc7fb 100644 --- a/ace/ace_standard/src/main/js/default/pages/animateMotion/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/animateMotion/index.hml @@ -1,54 +1,19 @@ +
-
-
- - 动画效果1 - - - - - - - > - -
-
- - 动画效果2 - - - - - - - - -
-
-
-
- - 动画效果3 - - - - - - - - -
-
- - 动画效果4 - - - - - - - - -
-
-
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/animateTransform/index.css b/ace/ace_standard/src/main/js/default/pages/animateTransform/index.css index 617e56401..c559fb041 100644 --- a/ace/ace_standard/src/main/js/default/pages/animateTransform/index.css +++ b/ace/ace_standard/src/main/js/default/pages/animateTransform/index.css @@ -1,18 +1,14 @@ +/* xxx.css */ .container { - width: 100%; flex-direction: column; - align-items: center; - padding-bottom: 40px; -} -.title{ - font-size: 18px; - color: grey; - padding: 5px; - text-align: center; -} -.svg-style{ - border: 1px solid #000000; -} -.outerBox{ - flex-direction: column; -} + justify-content: flex-start; + align-items: flex-start; + background-color: #f8f8ff; +} +.back_container { + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + height: 1000px; + width: 1080px; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/animateTransform/index.hml b/ace/ace_standard/src/main/js/default/pages/animateTransform/index.hml index 1d46ebcc5..3c27430c1 100644 --- a/ace/ace_standard/src/main/js/default/pages/animateTransform/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/animateTransform/index.hml @@ -1,184 +1,31 @@ +
-
-
- - 动画效果1 - - - - - - - -
-
- - 动画效果2 - - - - - - - -
+
+ + + + + + + + + + + + + + + + + +
-
-
- - 动画效果3 - - - - - - - -
-
- - 动画效果4 - - - - - - - -
-
-
-
- - 动画效果5 - - - - - - - -
-
- - 动画效果6 - - - - - - - -
-
-
-
- - 动画效果7 - - - - - - - -
-
- - 动画效果8 - - - - - - - -
-
-
-
- - 动画效果9 - - - - - - - -
-
- - 动画效果10 - - - - - - - -
-
-
-
- - 动画效果11 - - - - - - - - - -
-
- - 动画效果12 - - - - - - - - - -
-
-
-
- - 动画效果13 - - - - animateTransform - - - - - - -
-
-
+
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/test/List.test.js b/ace/ace_standard/src/main/js/default/test/List.test.js index d5e71c783..6cb0b5536 100755 --- a/ace/ace_standard/src/main/js/default/test/List.test.js +++ b/ace/ace_standard/src/main/js/default/test/List.test.js @@ -15,5 +15,7 @@ require('./basicabilityapi.test.js') require('./mediaquery.test.js') -require('./commonComponentJsApi.test.js') -require('./divProps.test.js') +//require('./commonComponentJsApi.test.js') +//require('./divProps.test.js') +require('./componentJsApi.test.js') + diff --git a/ace/ace_standard/src/main/js/default/test/componentJsApi.test.js b/ace/ace_standard/src/main/js/default/test/componentJsApi.test.js new file mode 100644 index 000000000..ab68aa587 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/componentJsApi.test.js @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'; + + +describe('aceJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + } + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run after testcase + */ + afterEach(async function () { + console.info('[aceJsTest] after each called') + await backToIndex(); + await sleep(5000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateComponent + * @tc.desc ACE + */ + it('testAnimateComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/animate/index' + } + try { + result = router.push(options) + console.info("push animate page success " + JSON.stringify(result)); + } catch (err) { + console.error("push animate page error " + JSON.stringify(result)); + } + await sleep(5000) + let pages = router.getState(); + console.info("[router.animate] getState" + JSON.stringify(pages)); + expect("pages/animate/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateMotionComponent + * @tc.desc ACE + */ + it('testAnimateMotionComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/animateMotion/index' + } + try { + result = router.push(options) + console.info("push animateMotion page success " + JSON.stringify(result)); + } catch (err) { + console.error("push animateMotion page error " + JSON.stringify(result)); + } + await sleep(5000) + let pages = router.getState(); + console.info("[router.animateMotion] getState" + JSON.stringify(pages)); + expect("pages/animateMotion/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testAnimateTransformComponent + * @tc.desc ACE + */ + it('testAnimateTransformComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/animateTransform/index' + } + try { + result = router.push(options) + console.info("push animateTransform page success " + JSON.stringify(result)); + } catch (err) { + console.error("push animateTransform page error " + JSON.stringify(result)); + } + await sleep(5000) + let pages = router.getState(); + console.info("[router.animateTransform] getState" + JSON.stringify(pages)); + expect("pages/animateTransform/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTextPathComponent + * @tc.desc ACE + */ + it('testTextPathComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/textPath/index' + } + try { + result = router.push(options) + console.info("push textPath page success " + JSON.stringify(result)); + } catch (err) { + console.error("push textPath page error " + JSON.stringify(result)); + } + await sleep(5000) + let pages = router.getState(); + console.info("[router.textPath] getState" + JSON.stringify(pages)); + expect("pages/textPath/").assertEqual(pages.path); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testTspanComponent + * @tc.desc ACE + */ + it('testTspanComponent', 0, async function (done) { + let result; + let options = { + uri: 'pages/tspan/index' + } + try { + result = router.push(options) + console.info("push tspan page success " + JSON.stringify(result)); + } catch (err) { + console.error("push tspan page error " + JSON.stringify(result)); + } + await sleep(5000) + let pages = router.getState(); + console.info("[router.tspan] getState" + JSON.stringify(pages)); + expect("pages/tspan/").assertEqual(pages.path); + done(); + }); +}); -- GitLab