[自動化平臺系列] - 初次使用 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在這裏就不介紹了。

相關文章
相關標籤/搜索