示例代码:
const wdio = require("webdriverio");
const opts = {
port: 4723,
desiredCapabilities: {
platformName: "iOS",
platformVersion: "12.2",
deviceName: "iPhone X",
app: "/path/to/your/app",
automationName: "XCUITest",
autoAcceptAlerts: true,
},
};
const client = await wdio.remote(opts);
const myElement = await client.$('[accessibilityID="myElementId"]');
await myElement.click();
await client.deleteSession();