Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
a8102c95
W
wechaty
项目概览
.www.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8102c95
编写于
5月 18, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
doc
上级
c762d1b9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
32 deletion
+36
-32
README.md
README.md
+14
-8
test/webdriver-spec.js
test/webdriver-spec.js
+22
-24
未找到文件。
README.md
浏览文件 @
a8102c95
...
...
@@ -60,8 +60,8 @@ Plan to glue with Machine Learning/Deep Learning/Neural Network/Natural Language
# Installation & Usage
Use NPM is recommended to install Wechaty for you:
```
bash
$
npm
install
--save
wechaty
```
shell
npm
install
--save
wechaty
```
## Start from strach
...
...
@@ -69,6 +69,7 @@ In case that you do not know anything about nodejs, the follow instructions woul
## 1. Install NodeJS
NodeJS Version 6.0 & above is required.
1.
Visit
[
NodeJS
](
https://nodejs.org
)
1.
Download NodeJS Installer(i.e. "v6.2.0 Current")
1.
Run Installer to install NodeJS to your machine
...
...
@@ -76,8 +77,7 @@ NodeJS Version 6.0 & above is required.
## 2. Checkout Wechaty
Use
`git`
to checkout Wechaty source code from
[
Github.com
](
https://github.com
)
```
shell
git clone git@github.com:zixia/wechaty.git
# git clone https://github.com/zixia/wechaty.git
git clone https://github.com/zixia/wechaty.git
```
## 3. Install Dependents
...
...
@@ -89,8 +89,8 @@ npm install
## 4. Run Demo Bot
```
shell
npm start
# node example/ding-dong-bot.js
```
This will run
`node example/ding-dong-bot.js`
# Trouble Shooting
If wechaty is not run as expected, run unit test maybe help to find some useful message.
...
...
@@ -100,7 +100,7 @@ npm test
# Requirement
ECMAScript2015
/ES6. I develop and test wechaty under nodejs
6.0.
ECMAScript2015
(ES6). I develop and test wechaty with Node.js v
6.0.
# API Refference
...
...
@@ -278,8 +278,14 @@ Github Issue - https://github.com/zixia/wechaty/issues
*
Create an issue, fork, then send a pull request(with unit test please).
# See Also
*
[
wxBot
](
https://github.com/liuwons/wxBot
)
: Wechat Bot API in Python
*
[
ItChat
](
https://github.com/littlecodersh/ItChat
)
: 微信个人号接口(支持文件、图片上下载)、微信机器人及命令行微信。三十行即可自定义个人号机器人 in Python
## Javascript
1.
[
Weixinbot
](
https://github.com/feit/Weixinbot
)
Nodejs 封装网页版微信的接口,可编程控制微信消息
## Python
1.
[
WeixinBot
](
https://github.com/Urinx/WeixinBot
)
*Very well documented*
网页版微信API,包含终端版微信及微信机器人
1.
[
wxBot
](
https://github.com/liuwons/wxBot
)
: Wechat Bot API
1.
[
ItChat
](
https://github.com/littlecodersh/ItChat
)
: 微信个人号接口(支持文件、图片上下载)、微信机器人及命令行微信。三十行即可自定义个人号机器人
Author
-----------------
...
...
test/webdriver-spec.js
浏览文件 @
a8102c95
const
path
=
require
(
'
path
'
)
const
co
=
require
(
'
co
'
)
const
test
=
require
(
'
tape
'
)
const
log
=
require
(
'
npmlog
'
)
//log.level = 'silly'
...
...
@@ -14,31 +15,28 @@ test('WebDriver smoke testing', function(t) {
const
wb
=
new
PuppetWebBrowser
({
port
:
PORT
})
const
driver
=
wb
.
getDriver
()
const
injectio
=
PuppetWebBrowser
.
getInjectio
()
driver
.
get
(
'
https://wx.qq.com/
'
)
.
then
(()
=>
{
Promise
.
all
([
execute
(
'
return 1+1
'
)
// ret_add
,
execute
(
injectio
,
8788
)
// ret_inject
]).
then
(([
retAdd
,
retInject
])
=>
{
t
.
equal
(
retAdd
,
2
,
'
execute js in browser
'
)
t
.
equal
(
retInject
,
'
Wechaty
'
,
'
injected wechaty
'
)
t
.
end
()
driver
.
quit
()
}).
catch
(
e
=>
{
t
.
ok
(
false
,
'
promise rejected. e:
'
+
e
)
t
.
end
()
driver
.
quit
()
})
/* .finally(() => {
console.log('final')
})
*/
co
(
function
*
()
{
const
injectio
=
PuppetWebBrowser
.
getInjectio
()
yield
driver
.
get
(
'
https://wx.qq.com/
'
)
const
retAdd
=
yield
execute
(
'
return 1+1
'
)
t
.
equal
(
retAdd
,
2
,
'
execute js in browser
'
)
const
retInject
=
yield
execute
(
injectio
,
8788
)
t
.
equal
(
retInject
,
'
Wechaty
'
,
'
injected wechaty
'
)
})
.
catch
(
e
=>
{
// REJECTED
t
.
ok
(
false
,
'
promise rejected. e:
'
+
e
)
})
.
then
(()
=>
{
// FINALLY
t
.
end
()
driver
.
quit
()
})
return
//////////////////////////////////
function
execute
()
{
return
driver
.
executeScript
.
apply
(
driver
,
arguments
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录