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 09:43:03 UTC

[07/50] incubator-weex git commit: * [test] adjust recycler test to fit both android and ios

* [test] adjust recycler test to fit both android and ios


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e327498c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e327498c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e327498c

Branch: refs/heads/dev
Commit: e327498c237834ec3f9c8b4a1e88badc336dbba4
Parents: 68acd19
Author: \u9690\u98ce <cx...@apache.org>
Authored: Thu Apr 13 15:55:20 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Thu Apr 13 15:55:20 2017 +0800

----------------------------------------------------------------------
 test/scripts/components/recycler.test.js | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e327498c/test/scripts/components/recycler.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js
index c83534d..170dff6 100644
--- a/test/scripts/components/recycler.test.js
+++ b/test/scripts/components/recycler.test.js
@@ -202,9 +202,6 @@ describe('recycler @ignore_android', function () {
     .getRect()
     .then((rect)=>{
       console.log(`cell 1 rect after changing column width to 600:${JSON.stringify(rect)}`)
-      console.log(`navBarHeight:${navBarHeight}`)
-      console.log(`scaleFactor:${scaleFactor}`)
-      console.log(`recyclerWidth:${recyclerWidth}`)
 
       cell1Height = rect.height
       assert.isOk(isApproximate(rect.x, 0))
@@ -319,7 +316,7 @@ describe('recycler @ignore_android', function () {
       console.log(`sticking header rect after setting padding to 12:${JSON.stringify(rect)}`)
   
       assert.isOk(isApproximate(rect.x, 12 * scaleFactor))
-      assert.isOk(isApproximate(rect.y, navBarHeight+12 * scaleFactor))
+      assert.isOk(isApproximate(rect.y, navBarHeight + (isAndroid ? 12 * scaleFactor : 0)))
       assert.isOk(isApproximate(rect.width, recyclerWidth - 24 * scaleFactor))
       assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
     })
@@ -332,10 +329,10 @@ describe('recycler @ignore_android', function () {
       assert.isOk(isApproximate(rect.width, recyclerWidth - 24 * scaleFactor))
       assert.isOk(isApproximate(rect.height, 94 * scaleFactor))
     })
-    .elementById('cell26')
+    .elementById((isAndroid ? 'cell26' : 'cell27'))
     .getRect()
     .then((rect)=>{
-      console.log(`cell 26 rect after setting padding to 12:${JSON.stringify(rect)}`)
+      console.log(`cell 27 rect after setting padding to 12:${JSON.stringify(rect)}`)
       assert.isOk(isApproximate(rect.x, 12 * scaleFactor))
       assert.isOk(isApproximate(rect.width, 357 * scaleFactor))
     })
@@ -344,12 +341,7 @@ describe('recycler @ignore_android', function () {
   it('#11 test onscroll', () => {
     let originContentOffset = 0
     return driver
-    .elementById('cell27')
-    .getRect()
-    .then((rect)=>{
-      console.log(`cell 29 rect:${JSON.stringify(rect)}`)
-    })
-    .elementById('cell27')
+    .elementById((isAndroid ? 'cell27' : 'cell28'))
     .click()
     .elementById('stickyText1')
     .text() 
@@ -374,7 +366,7 @@ describe('recycler @ignore_android', function () {
   it('#12 test scrollable', () => {
     let originContentOffset = 0
     return driver
-    .elementById('cell25')
+    .elementById((isAndroid ? 'cell25' : 'cell26'))
     .click()
     .elementById('stickyText1')
     .text()