import wd from 'wd';
jest.setTimeout(60000);
const PORT = 4723;
const config = {
platformName: 'iOS',
deviceName: `iPhone X`,
platformVersion: '12.2',
app: '/path/to/my.app',
useNewWDA: true,
autoLaunch: false,
};
let screenshotIndex = 0
const driver = wd.promiseChainRemote('localhost', PORT);
directory = '../screenshots';`enter code here`
beforeAll(async () => {
await driver.init(config);
await driver.sleep(7000); // wait for app to load
});
afterEach(async () => {
await driver.takeScreenshot().then(
function (image, err) {
require('fs').writeFile(`screenshot-${screenshotIndex++}.png`, image, 'base64');
}
);
});
test('appium renders', async () => {
let contexts = await driver.contexts();
console.log('contexts', contexts);
await driver.context(contexts[1]);
await driver.elementById('username').type('[email protected]');
await driver.elementById('password').type('#1234');
await driver.elementById('Login').click();
});
// Timeout-在jest.setTimeout。指定的60000ms超时内未调用异步回调。
运行此命令后,出现上述错误。不确定我要去哪里哪里
从'wd'导入wd; jest.setTimeout(60000);常量端口= 4723; const config = {platformName:'iOS',deviceName:`iPhone X`,platformVersion:'12 .2',app:'/path/to/my.app',useNewWDA:...
setTimeout