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

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
      

因为我目前只用到pc的自动化测试,ios和android在这里就不介绍了。

posted on 2016-05-10 17:19  shenggen  阅读(362)  评论(0编辑  收藏  举报

导航