您的位置:首页 > Web前端

[自动化平台系列] - 初次使用 Macaca-前端自动化测试(1)

2016-05-10 17:19 375 查看
1、 所先看一下官方地址,了解一下这个是不是你想要的测试工具

https://macacajs.github.io/macaca/environment-setup.html

2、 去掉sudo ---sudo chown -R $USER /usr/local

3、 全局安装自动化测试工具命令---- npm i macaca-cli -g

4、 修改本地host---sudo vim /etc/hosts

增加一条记录 127.0.0.1 localhost

5、 去github下载demo项目到本地

https://github.com/xudafeng/macaca-test-sample

依次在命令执行


$ git clone
https://github.com/xudafeng/macaca-test-sample

$ cd macaca-test-sample
$ npm install
因为我用的是chrome浏览器,所以要修改文件 macaca-test/macaca-desktop-sample.test.js

'use strict';

var wd = require('webdriver-client')({
platformName: 'desktop',
browserName: 'chrome'----------这个改成chrome
});

然后执行下面代码
$ make test-pc
[/code]
因为我目前只用到pc的自动化测试,ios和android在这里就不介绍了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: