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

一、 所先看一下官方地址,了解一下这个是否是你想要的测试工具html

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

二、 去掉sudo ---sudo chown -R $USER /usr/localios

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

四、 修改本地host---sudo vim /etc/hostsgithub

      增长一条记录   127.0.0.1 localhostweb

五、 去github下载demo项目到本地chrome

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

    依次在命令执行   vim

 
$ git clonehttps://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在这里就不介绍了。

相关文章
相关标签/搜索