WdaClient
WdaClient is my minimal client for WebDriverAgent to help some operations.
Installation
Add this line to your application's Gemfile:
gem 'wda_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wda_client
Requirement
- Should use WebDriverAgent over the below commit hash because
/source
supported from it.
Usage
- Launch WebDriverAgent
- Read official document
- load this module and create instance
$ pry
> require 'wda_client'
> client = WdaClient.new desired_capabilities: "{\"desiredCapabilities\":{\"bundleId\": \"com.my.app\"}}"
> client.get_status # https://github.com/facebook/WebDriverAgent/wiki/Queries#checking-service-status
> client.take_screenshot # https://github.com/facebook/WebDriverAgent/wiki/Queries#get-a-screenshot
> client.get_source # https://github.com/facebook/WebDriverAgent/wiki/Queries#source-aka-tree
> client.close # close session
Advanced
- Launch WebDriverAgent with particular port number
- launch with
fbsimctl
with particular port number - change source code directly
- provide port number via environment of
USE_PORT
- launch with
- Generate instance of
WdaClient
withbase_url
.
- Set port
4100
, for insrance.
client = WdaClient.new desired_capabilities: "{\"desiredCapabilities\":{\"bundleId\": \"com.my.app\"}}", base_url: 'http://localhost:4100'
Current Status
- Get Status
- Get source
- go to homescreen
- Take Screenshot
- install app and get session id
- get current session id
- close current session
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/KazuCocoa/wda_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.