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/03/03 02:01:26 UTC
[3/5] incubator-weex git commit: update testcase
update 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/8893b95a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8893b95a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8893b95a
Branch: refs/heads/0.11-dev
Commit: 8893b95a9184caeab552bee316daddd34438b499
Parents: 26ad7ab
Author: moxun.ljf <mo...@alibaba-inc.com>
Authored: Fri Mar 3 09:30:53 2017 +0800
Committer: moxun.ljf <mo...@alibaba-inc.com>
Committed: Fri Mar 3 09:30:53 2017 +0800
----------------------------------------------------------------------
test/pages/image-onload.we | 19 +++++++++++
test/pages/image.we | 19 -----------
test/scripts/components/image-onload.test.js | 39 +++++++++++++++++++++++
test/scripts/components/image.test.js | 39 -----------------------
4 files changed, 58 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8893b95a/test/pages/image-onload.we
----------------------------------------------------------------------
diff --git a/test/pages/image-onload.we b/test/pages/image-onload.we
new file mode 100644
index 0000000..8d21c7a
--- /dev/null
+++ b/test/pages/image-onload.we
@@ -0,0 +1,19 @@
+<template>
+ <div>
+ <img style="width: 500;height: 500;" src="https://gw.alicdn.com/tps/TB1bEMYKXXXXXaLaXXXXXXXXXXX-360-388.png" onload="onload"></img>
+ <text style="font-size:30">{{size}}</text>
+ </div>
+</template>
+<script>
+ module.exports = {
+ data : {
+ size:"-1,-1"
+ },
+ methods : {
+ onload : function(e) {
+ nativeLog(JSON.stringify(e))
+ this.size = e.size.naturalWidth + ',' + e.size.naturalHeight;
+ }
+ }
+ }
+</script>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8893b95a/test/pages/image.we
----------------------------------------------------------------------
diff --git a/test/pages/image.we b/test/pages/image.we
deleted file mode 100644
index 8d21c7a..0000000
--- a/test/pages/image.we
+++ /dev/null
@@ -1,19 +0,0 @@
-<template>
- <div>
- <img style="width: 500;height: 500;" src="https://gw.alicdn.com/tps/TB1bEMYKXXXXXaLaXXXXXXXXXXX-360-388.png" onload="onload"></img>
- <text style="font-size:30">{{size}}</text>
- </div>
-</template>
-<script>
- module.exports = {
- data : {
- size:"-1,-1"
- },
- methods : {
- onload : function(e) {
- nativeLog(JSON.stringify(e))
- this.size = e.size.naturalWidth + ',' + e.size.naturalHeight;
- }
- }
- }
-</script>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8893b95a/test/scripts/components/image-onload.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/image-onload.test.js b/test/scripts/components/image-onload.test.js
new file mode 100644
index 0000000..8030511
--- /dev/null
+++ b/test/scripts/components/image-onload.test.js
@@ -0,0 +1,39 @@
+'use strict';
+
+var _ = require('macaca-utils');
+var assert = require('chai').assert
+var wd = require('weex-wd')
+var path = require('path');
+var os = require('os');
+var util = require("../util.js");
+
+describe('image onload', function () {
+ this.timeout(util.getTimeoutMills());
+ var driver = util.createDriver(wd);
+
+ before(function () {
+ return util.init(driver)
+ .get('wxpage://' + util.getDeviceHost() +'/image.js')
+ .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000)
+ });
+
+ after(function () {
+ return util.quit(driver);
+ })
+
+
+ it('#1 download image', () => {
+ return driver
+ .sleep(5000)
+ .elementByXPath('//div/text')
+ .text()
+ .then((text)=>{
+ if(text == '-1,-1') {
+ return;
+ }
+ assert.equal(text, '360,388')
+ })
+ })
+});
+
+
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8893b95a/test/scripts/components/image.test.js
----------------------------------------------------------------------
diff --git a/test/scripts/components/image.test.js b/test/scripts/components/image.test.js
deleted file mode 100644
index 8030511..0000000
--- a/test/scripts/components/image.test.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-var _ = require('macaca-utils');
-var assert = require('chai').assert
-var wd = require('weex-wd')
-var path = require('path');
-var os = require('os');
-var util = require("../util.js");
-
-describe('image onload', function () {
- this.timeout(util.getTimeoutMills());
- var driver = util.createDriver(wd);
-
- before(function () {
- return util.init(driver)
- .get('wxpage://' + util.getDeviceHost() +'/image.js')
- .waitForElementByXPath('//div/text[1]',util.getGETActionWaitTimeMills(),1000)
- });
-
- after(function () {
- return util.quit(driver);
- })
-
-
- it('#1 download image', () => {
- return driver
- .sleep(5000)
- .elementByXPath('//div/text')
- .text()
- .then((text)=>{
- if(text == '-1,-1') {
- return;
- }
- assert.equal(text, '360,388')
- })
- })
-});
-
-