Repository: incubator-weex Updated Branches: refs/heads/0.12-dev c22d8e4b8 -> b92bf6fec
* [test] update elem by id testcase Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/24e8ba07 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/24e8ba07 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/24e8ba07 Branch: refs/heads/0.12-dev Commit: 24e8ba07a18fbaa457e45137806fa437f2993ca9 Parents: 2ee570a Author: sospartan <sospar...@apache.org> Authored: Wed Apr 12 15:34:58 2017 +0800 Committer: sospartan <sospar...@apache.org> Committed: Wed Apr 12 15:34:58 2017 +0800 ---------------------------------------------------------------------- package.json | 2 +- test/pages/slider-infinite.vue | 11 ++++++++--- test/scripts/components/slider-infinite.test.js | 15 +++++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/24e8ba07/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 9195bad..b2c4fd4 100644 --- a/package.json +++ b/package.json @@ -158,7 +158,7 @@ "weex-components": "^0.2.0", "weex-loader": "^0.4.0", "weex-vdom-tester": "^0.2.0", - "weex-wd": "^1.0.21", + "weex-wd": "^1.0.22", "wwp": "^0.3.5", "xml2map": "^1.0.2" } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/24e8ba07/test/pages/slider-infinite.vue ---------------------------------------------------------------------- diff --git a/test/pages/slider-infinite.vue b/test/pages/slider-infinite.vue index b65a889..4559a25 100644 --- a/test/pages/slider-infinite.vue +++ b/test/pages/slider-infinite.vue @@ -1,6 +1,6 @@ <template> <div> - <text>{{d1}}</text> + <text test-id="txt1">{{d1}}</text> <slider auto-play="true" @change="change" style="width: 750px;height: 400px;background-color: blue" interval="500" infinite="false"> <div style="flex: 1;background-color: beige;align-items: center;" v-for="item in items"> <text style="font-size: 60px;"> @@ -10,8 +10,8 @@ <indicator style="height: 20px"></indicator> </slider> - <text style="margin-top:60">{{d2}}</text> - <slider auto-play="true" @change="change2" style="width: 750px;height: 400px;background-color: blue;" interval="500"> + <text test-id="txt2" style="margin-top:60">{{d2}}</text> + <slider :auto-play="is_auto" @change="change2" style="width: 750px;height: 400px;background-color: blue;" interval="500"> <div style="flex: 1;background-color: beige;align-items: center;" v-for="item in items"> <text style="font-size: 60px;"> {{item}} @@ -30,12 +30,17 @@ d1:0, d2:0, items: [], + is_auto: true } }, created: function () { for (var index = 0; index < itemCount ; index++) { this.items[index] = 'Page: ' + index; } + let self = this + setTimeout(function(){ + self.is_auto = false + },5000); }, methods: { change: function(e){ http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/24e8ba07/test/scripts/components/slider-infinite.test.js ---------------------------------------------------------------------- diff --git a/test/scripts/components/slider-infinite.test.js b/test/scripts/components/slider-infinite.test.js index 5c96d3a..b3f37a4 100644 --- a/test/scripts/components/slider-infinite.test.js +++ b/test/scripts/components/slider-infinite.test.js @@ -14,23 +14,26 @@ describe('slider infinite scroll', function () { before(function () { return util.init(driver) .get(util.getPage('/slider-infinite.js')) - .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000) + .waitForElementById('txt1',util.getGETActionWaitTimeMills(),1000) }); after(function () { - return util.quit(driver); + // return util.quit(driver); }) it('#1 waiting for auto play', () => { return driver .sleep(5000) - .elementByXPath('//div/text') + .elementById('txt1') .text() .then((text)=>{ - var parts = text.split("-"); - assert.equal(parts[0], 1); - assert.equal(parts[2] == 1, false); + assert.equal(text, 1); + }) + .elementById('txt2') + .text() + .then((text)=>{ + assert.equal(text>2, true); }) }) });