I am always so curious about new affairs. In the process of automation, I am fortunate to learn about macaca and record the installation process. For details, please visit the official website: https://github.com/macacajs/
Python version reference: https://testerhome.com/topics/7898 Detailed tutorial
The first step: install node.js Download address: https://nodejs.org/en/ I downloaded 8.11.1, one-click installation, next is all the way, after installation, add environment variables for backup
Step 2: Switch Taobao source npm install -g cnpm --registry= https://registry.npm.taobao.org The domestic source is very slow, please wait patiently for the switching process
Successful installation:
Step 3: Install macaca-cli cnpm i macaca-cli -g through Taobao source
Step 4: Install webdriver-client cnpm install webdriver-client
Step 5: Install macaca-electron cnpm install macaca-electron -g
Step 6: Install macaca-chrome cnpm install macaca-chrome -g
Step 7: Install the python API (I installed this step directly through pip, and it should be fine)
python3 -m pip install wd
Step 8: Install Google Drive macaca-chromedriver cnpm install macaca-chromedriver -g
Step 9: Install the Android driver cnpm install macaca-android -g (8, 9, 10 can be installed as needed)
Step 10: Install the iOS driver cnpm i macaca-ios -g
Start: macaca server --verbose [add --verbose, print detailed log]
- python tests/macaca-desktop-sample.test.py [run test]
Common commands:
Server
- macaca server (normal mode)
- macaca server -p 3456 (set port)
- macaca server -p 3456 & (set the port to run in the background)
- macaca server --verbose (output verbose log)
test
- macaca run (runs the current directory case set)
- macaca run -d ./test (run the use case set in the specified directory)
an examination
- macaca doctor (environmental check)