在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:appium-boneyard/appium-ios-driver开源软件地址:https://github.com/appium-boneyard/appium-ios-driver开源编程语言:JavaScript 99.1%开源软件介绍:Appium iOS DriverAppium iOS Driver is a test automation tool for iOS devices up to an including iOS 9.3. Appium iOS Driver automates native, hybrid and mobile web apps, tested on simulators and real devices, using Apples' UI Automation framework. Appium iOS Driver is part of the Appium mobile test automation tool. To automate iOS devices with a version of iOS greater than 9.3, see appium-xcuitest-driver. Note: Issue tracking for this repo has been disabled. Please use the main Appium issue tracker instead. iOS SupportAppium iOS Driver supports iOS versions 8+ Installationnpm install appium-ios-driver Authorization for automation supportOn some systems Instruments is not authorized to automate iOS devices. This package comes with a little utility that pre-authorizes Instruments to run UIAutomation scripts. Running the authorization script will bring up an alert that prompts the user
to input their Command line usageIf this package has been installed globally (either as part of an Appium
installation, with
Programmatic usageTo invoke programmatically (in, for instance, a test runner) is as simple as
importing and invoking the
import { authorize } from 'appium-ios-driver';
authorize()
.then(function () {
console.log('iOS authorized!');
})
.catch(function (err) {
console.error(`Error authorizing: ${err.message}`);
}); UsageImport iOS Driver, set desired capabilities and create a session: import { IosDriver } from `appium-ios-driver`
let defaultCaps = {
app: 'path/to/your.app',
platformName: 'iOS',
deviceName: 'iPhone 6'
};
let driver = new IosDriver();
await driver.createSession(defaultCaps); Run commands: await driver.setOrientation('LANDSCAPE');
console.log(await driver.getOrientation()); // -> 'LANDSCAPE' Commands
Insecure FeaturesThese can be enabled when running this driver through Appium, via the
Watch code for changes, re-transpile and run unit tests:gulp watch TestFor tests, the default sims required are an iOS 9.2 iPhone 6 and iPad 2, which you can create as follows if one doesn't already exist on your system (use xcrun simctl create "iPhone 6" "iPhone 6" 9.2
xcrun simctl create "iPad 2" "iPad 2" 9.2 Then you can run unit and e2e tests: // unit tests:
gulp once
// e2e tests - specify your desired iOS version, for example iOS8.4:
DEVICE=ios84 gulp e2e-test |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论