You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/04/21 06:59:16 UTC
incubator-weex git commit: * [test] enable iOS macaca
Repository: incubator-weex
Updated Branches:
refs/heads/0.12-dev 9381c91cb -> 2a862c90b
* [test] enable iOS macaca
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/2a862c90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/2a862c90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/2a862c90
Branch: refs/heads/0.12-dev
Commit: 2a862c90b3c5bad4ba6d61d49c8b93004ee676bd
Parents: 9381c91
Author: sospartan <so...@apache.org>
Authored: Tue Apr 18 17:55:39 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Fri Apr 21 13:32:01 2017 +0800
----------------------------------------------------------------------
.travis.yml | 7 +++-
package.json | 2 +-
test/pages/components/textarea-maxlength.vue | 8 ++--
test/pages/dom-operation.vue | 18 ++++-----
test/pages/image-onload.vue | 4 +-
test/pages/index.vue | 4 +-
test/pages/list-scroll.vue | 5 +--
test/pages/scroller-scroll.vue | 4 +-
test/pages/slider-infinite.vue | 4 +-
test/run.sh | 1 -
test/scripts/components/scroll-event.test.js | 8 ++--
test/scripts/components/slider-infinite.test.js | 4 +-
test/scripts/components/text.test.js | 2 +-
.../components/textarea-maxlength.test.js | 6 +--
test/scripts/dom.test.js | 40 ++++++++++----------
15 files changed, 56 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 6b94b22..3ff0ae8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,7 +27,7 @@ matrix:
include:
- os: osx
env: TEST_SUITE=ios
- osx_image: xcode8.3
+ osx_image: xcode8.1
language: objective-c
before_script:
- source test/ci-funcs.sh
@@ -39,10 +39,12 @@ matrix:
- npm install
- npm install mocha
- gem install danger danger-xcode_summary xcpretty xcpretty-json-formatter
+ - export run_in_ci=true
script:
- ./test/serve.sh 2&>1 > /dev/null &
- xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
- bundle exec danger --dangerfile=Dangerfile-ios
+ - travis_retry bash test/run.sh ios
- os: linux
env: TEST_SUITE=android
jdk: oraclejdk8
@@ -67,6 +69,7 @@ matrix:
- npm install
- npm install mocha
- export DISPLAY=:99.0
+ - export run_in_ci=true
script:
- source ./test/ci-funcs.sh
- ./test/serve.sh 2&>1 > /dev/null &
@@ -74,7 +77,7 @@ matrix:
- ./run-ci.sh
- cd $TRAVIS_BUILD_DIR
- waitForEmulator
- - run_in_ci=true bash test/run.sh
+ - travis_retry bash test/run.sh
cache:
directories:
- node_modules
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3887a64..556b6a0 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.22",
+ "weex-wd": "^1.0.23",
"wwp": "^0.3.5",
"xml2map": "^1.0.2",
"weex-gcanvas":"^0.3.5"
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/components/textarea-maxlength.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/textarea-maxlength.vue b/test/pages/components/textarea-maxlength.vue
index 12bfff3..503a59f 100644
--- a/test/pages/components/textarea-maxlength.vue
+++ b/test/pages/components/textarea-maxlength.vue
@@ -1,8 +1,8 @@
<template>
- <div class="wrapper">
- <text style="font-size:30">{{value}}</text>
- <textarea id="textarea" class="textarea" value="" autofocus="true" maxlength=4 @input="oninput" @change="onchange" ></textarea>
- </div>
+ <scroller class="wrapper">
+ <text test-id="status" style="font-size:30">{{value}}</text>
+ <textarea test-id="textarea" id="textarea" class="textarea" value="" autofocus="true" maxlength=4 @input="oninput" @change="onchange" ></textarea>
+ </scroller>
</template>
<script>
const modal = weex.requireModule('modal')
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/dom-operation.vue
----------------------------------------------------------------------
diff --git a/test/pages/dom-operation.vue b/test/pages/dom-operation.vue
index 0f4625c..334803d 100644
--- a/test/pages/dom-operation.vue
+++ b/test/pages/dom-operation.vue
@@ -1,17 +1,13 @@
<template>
- <div>
- <div style="height:100;background-color:blue">
- <text v-if="display">item</text>
- </div>
- <div>
+ <scroller>
+ <text v-if="display" test-id="maynotexist">item</text>
<div v-for="item in repeat_items">
- <text>repeat</text>
+ <text :test-id="'item'+item">repeat item:{{item}}</text>
</div>
- </div>
- <text @click="onclick">display</text>
- <text @click="onclick2">display</text>
- <text @click="onclick3">{{text}}</text>
- </div>
+ <text test-id="btn1" @click="onclick">display</text>
+ <text test-id="status" @click="onclick2">display</text>
+ <text test-id="status2" @click="onclick3">{{text}}</text>
+ </scroller>
</template>
<script>
module.exports = {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/image-onload.vue
----------------------------------------------------------------------
diff --git a/test/pages/image-onload.vue b/test/pages/image-onload.vue
index cec8a8e..0c0b309 100644
--- a/test/pages/image-onload.vue
+++ b/test/pages/image-onload.vue
@@ -1,8 +1,8 @@
<template>
- <div>
+ <scroller>
<image style="width: 500;height: 500;" src="https://gw.alicdn.com/tps/TB1bEMYKXXXXXaLaXXXXXXXXXXX-360-388.png" @load="onload"></image>
<text test-id='imgSize' style="font-size:30">{{size}}</text>
- </div>
+ </scroller>
</template>
<script>
module.exports = {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/index.vue
----------------------------------------------------------------------
diff --git a/test/pages/index.vue b/test/pages/index.vue
index 6da2e56..2ede5f5 100644
--- a/test/pages/index.vue
+++ b/test/pages/index.vue
@@ -1,11 +1,11 @@
<template>
- <div>
+ <scroller>
<text test-id="title">hello world.</text>
<input ref="input" test-id="input" value="input" @blur="onblur"></input>
<text style="color:red" test-id="status">{{status}}</text>
<text @click="onclick" test-id="button">button</text>
<text @click="toggleblur" test-id="button2">blur input</text>
- </div>
+ </scroller>
</template>
<script>
export default {
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/list-scroll.vue
----------------------------------------------------------------------
diff --git a/test/pages/list-scroll.vue b/test/pages/list-scroll.vue
index 3051982..0a264b7 100644
--- a/test/pages/list-scroll.vue
+++ b/test/pages/list-scroll.vue
@@ -1,14 +1,13 @@
<template>
- <div>
<list style="background-color: beige; width: 750px; height: 900px" offset-accuracy="10" @scroll="onscroll">
+ <header><text test-id="status" ref="status" style="font-size: 40px;">{{status}}</text></header>
<cell v-for="(index, row) in rows" :key="index" style="padding: 10px;">
<text style="width: 750px; height: 150px; background-color: aqua">
{{row.id}}
</text>
</cell>
</list>
- <text ref="status" style="font-size: 40px;">{{status}}</text>
- </div>
+
</template>
<script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/scroller-scroll.vue
----------------------------------------------------------------------
diff --git a/test/pages/scroller-scroll.vue b/test/pages/scroller-scroll.vue
index db74a7f..81335a4 100644
--- a/test/pages/scroller-scroll.vue
+++ b/test/pages/scroller-scroll.vue
@@ -1,14 +1,12 @@
<template>
- <div>
<scroller style="background-color: beige; width: 750px; height: 900px" offset-accuracy="10" @scroll="onscroll">
+ <text style="font-size: 40px;position:fixed;top:0;left:0;" test-id="status">{{status}}</text>
<div v-for="row in rows" style="padding: 10px;">
<text style="width: 750px; height: 150px; background-color: aqua">
{{row.id}}
</text>
</div>
</scroller>
- <text style="font-size: 40px;">{{status}}</text>
- </div>
</template>
<script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/pages/slider-infinite.vue
----------------------------------------------------------------------
diff --git a/test/pages/slider-infinite.vue b/test/pages/slider-infinite.vue
index 4559a25..726e376 100644
--- a/test/pages/slider-infinite.vue
+++ b/test/pages/slider-infinite.vue
@@ -1,5 +1,5 @@
<template>
- <div>
+ <scroller>
<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">
@@ -19,7 +19,7 @@
</div>
<indicator style="height: 20px"></indicator>
</slider>
- </div>
+ </scroller>
</template>
<script>
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/run.sh
----------------------------------------------------------------------
diff --git a/test/run.sh b/test/run.sh
index 070322d..95fef20 100755
--- a/test/run.sh
+++ b/test/run.sh
@@ -43,7 +43,6 @@ function runiOS {
echo 'Run in iOS...'
echo $1
buildiOS
- sleep 1m
echo 'killAll Simulator......'
killAll Simulator || echo 'killall failed'
# ps -ef
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/scripts/components/scroll-event.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/scroll-event.test.js b/test/scripts/components/scroll-event.test.js
index 17d94f4..1ad1cdb 100644
--- a/test/scripts/components/scroll-event.test.js
+++ b/test/scripts/components/scroll-event.test.js
@@ -32,7 +32,7 @@ describe('list scroll event', function () {
before(function () {
return util.init(driver)
.get(util.getPage('/list-scroll.js'))
- .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000)
+ .waitForElementById('status',util.getGETActionWaitTimeMills(),1000)
});
after(function () {
@@ -58,7 +58,7 @@ describe('list scroll event', function () {
duration: 0.5
})
.sleep(2000)
- .elementByXPath('//div/text')
+ .elementById('status')
.text()
.then((text)=>{
var y = Math.abs(parseInt(text))
@@ -74,7 +74,7 @@ describe('scroller scroll event', function () {
before(function () {
return util.init(driver)
.get(util.getPage('/scroller-scroll.js'))
- .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000)
+ .waitForElementById('status',util.getGETActionWaitTimeMills(),1000)
});
after(function () {
@@ -88,7 +88,7 @@ describe('scroller scroll event', function () {
.sleep(2000)
.touch('drag', {fromX:200, fromY:500, toX:100, toY:200})
.sleep(2000)
- .elementByXPath('//div/text')
+ .elementById('status')
.text()
.then((text)=>{
var y = Math.abs(parseInt(text))
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/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 8377d59..b032d6e 100644
--- a/test/scripts/components/slider-infinite.test.js
+++ b/test/scripts/components/slider-infinite.test.js
@@ -36,7 +36,7 @@ describe('slider infinite scroll', function () {
});
after(function () {
- // return util.quit(driver);
+ return util.quit(driver);
})
@@ -46,7 +46,7 @@ describe('slider infinite scroll', function () {
.elementById('txt1')
.text()
.then((text)=>{
- assert.equal(text, 1);
+ assert.equal(text>=1, true);
})
.elementById('txt2')
.text()
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/scripts/components/text.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/text.test.js b/test/scripts/components/text.test.js
index d280eda..0c867cf 100644
--- a/test/scripts/components/text.test.js
+++ b/test/scripts/components/text.test.js
@@ -7,7 +7,7 @@ var path = require('path');
var os = require('os');
var util = require("../util.js");
-describe('weex text', function () {
+describe('weex text @ignore-ios', function () {
this.timeout(util.getTimeoutMills());
var driver = util.createDriver(wd);
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/scripts/components/textarea-maxlength.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/textarea-maxlength.test.js b/test/scripts/components/textarea-maxlength.test.js
index 8eefa58..d72329d 100644
--- a/test/scripts/components/textarea-maxlength.test.js
+++ b/test/scripts/components/textarea-maxlength.test.js
@@ -32,7 +32,7 @@ describe('textarea maxlength vue test2 ', function () {
before(function () {
return util.init(driver)
.get(util.getPage('/components/textarea-maxlength.js'))
- .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000)
+ .waitForElementById('textarea',util.getGETActionWaitTimeMills(),1000)
});
after(function () {
@@ -41,10 +41,10 @@ describe('textarea maxlength vue test2 ', function () {
it('#1 textarea maxlenght', () => {
return driver
- .waitForElementByXPath('//div/textarea')
+ .elementById('textarea')
.sendKeys('12345678')
.sleep(2000)
- .elementByXPath('//div/text[1]')
+ .elementById('status')
.text()
.then((text)=>{
assert.equal(text,'1234')
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2a862c90/test/scripts/dom.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/dom.test.js b/test/scripts/dom.test.js
index 05ceeb1..cebebc3 100644
--- a/test/scripts/dom.test.js
+++ b/test/scripts/dom.test.js
@@ -32,7 +32,7 @@ describe('weex mobile index', function () {
before(function () {
return util.init(driver)
.get(util.getPage('/dom-operation.js'))
- .waitForElementByXPath('//div/text[2]',util.getGETActionWaitTimeMills(),1000);
+ .waitForElementById('status',util.getGETActionWaitTimeMills(),1000);
});
after(function () {
@@ -41,11 +41,11 @@ describe('weex mobile index', function () {
it('#1 Repeat', ()=>{
return driver
- .elementsByXPath("//div/div[2]/div")
- .then((elems)=>{
- assert.equal(elems.length,5)
+ .elementById("item5")
+ .then((elem)=>{
+ assert.notEqual(elem ,undefined)
})
- .elementByXPath("//div/div[1]/text")
+ .elementById("maynotexist")
.then((noexist)=>{
assert.equal(noexist,undefined)
})
@@ -53,37 +53,37 @@ describe('weex mobile index', function () {
it('#2 Add new item', ()=>{
return driver
- .elementByXPath("//div/text[1]")
+ .elementById("btn1")
.click()
- .sleep(1000)
- .elementsByXPath("//div/div[2]/div")
- .then((elems)=>{
- assert.equal(elems.length,6)
+ .sleep(2000)
+ .elementById("item6")
+ .then((elem)=>{
+ assert.notEqual(elem ,undefined)
})
- .elementByXPath("//div/div[1]/text")
+ .elementById("maynotexist")
.then((existed)=>{
assert.notEqual(existed,undefined)
})
})
- it('#2 Remove item', ()=>{
+ it('#3 Remove item', ()=>{
return driver
- .elementByXPath("//div/text[2]")
+ .elementById("status")
.click()
- .sleep(1000)
- .elementsByXPath("//div/div[2]/div")
- .then((elems)=>{
- assert.equal(elems.length,5)
+ .sleep(2000)
+ .elementById("item6")
+ .then((elem)=>{
+ assert.equal(elem,undefined)
})
- .elementByXPath("//div/div[1]/text")
+ .elementById("maynotexist")
.then((noexist)=>{
assert.equal(noexist,undefined)
})
})
- it('#3 Update DOM attr', ()=>{
+ it('#4 Update DOM attr', ()=>{
return driver
- .elementByXPath("//div/text[3]")
+ .elementById("status2")
.text()
.then((text)=>{
assert.equal("finished",text);