最近有個需求是將上傳到CircleCI的APK,通過命令自動化上傳到Rainforest上,簡單記錄一下自己使用過程及碰到的坑,如果能幫到你,非常開心。
1 官網:雨淋測試rainforest
2 一般開發者沒有權限,需要測試人員授予權限,將你加入進去,否則你打開的很多網頁都需要賬號和密碼。授予權限後,你無需再次登錄就可以訪問。
3我用的是window10,搭建開發環境:
3.1 下載壓縮包: https://help.rainforestqa.com/en/articles/3230852-installing-the-rainforest-cli,解壓到某一個目錄,然後在path中添加系統環境變量,然後檢測環境是否正確,命令如下:
rainforest environments --token xxxxxbb034345kj545jkl45lj
顯示如下:
ENVIRONMENT ID | ENVIRONMENT NAME |
|----------------|---------------------------|
| 12411 | ConTest |
| 12559 | ConWeb Webhook |
然後常用命令: 注意你的token 很關鍵:
rainforest sites --token YOUR_TOKEN
rainforest mobile-upload --token YOUR_TOKEN --site-id 1234 --environment-id 5678 my_app.apk
circleci中將編譯好的apk直接上傳到Rainforest,主要是搭建CircleCI上Rainforest的環境,這裏的坑主要是環境(不是你本地Rainforest環境,而是CIrcleCI上的環境)沒搭建成功,遇到很多坑比如Rainforest命令不識別以及Linux命令權限的問題(已解決),需要在隱藏文件.yml 中配置如下:
- run:
name: Installing the Rainforest CLI
command: |
curl -O https://bin.equinox.io/c/htRtQZagtfg/rainforest-cli-stable-linux-amd64.tgz
sudo tar -xvzf rainforest-cli-stable-linux-amd64.tgz
sudo mv rainforest /usr/local/bin
sudo chmod +x /usr/local/bin/rainforest
sudo rm rainforest-cli-stable-linux-amd64.tgz
環境已搭好,然後在你需要上傳的地方執行上傳apk的命令,如下上傳命令的地址:
https://help.rainforestqa.com/en/articles/3230881-upload-your-mobile-app-directly-to-rainforest-via-the-cli