Macaca WD
Macaca Node.js 客户端 API 模块
开发体验
API 文档
# 安装
$ npm i macaca-wd -D
# 使用
const wd = require('macaca-wd');
const remoteConfig = {
host: 'localhost',
port: 3456
};
var driver = wd.promiseChainRemote(remoteConfig);
before(function() {
return driver.init({
platformName: 'desktop', // iOS, Android, Desktop, Playwright
browserName: 'chrome', // chromium, firefox, webkit
app: 'path/to/app', // Only for mobile
});
});
after(function() {
return driver
.sleep(1000)
.quit();
});
it('#1 should', function() {
...
});
...
# 集成 Helper
import wd from 'macaca-wd';
import {
extendsMixIn,
} from 'macaca-wd/lib/helper'
extendsMixIn(wd)
# 扩展更多 API
import wd from 'macaca-wd';
wd.addPromiseChainMethod(name, method);