Git Product home page Git Product logo

wda-java-client's Introduction

WebDriverAgent Java Client

WebDriverAgent Java Client for tvOS automation

Environment

  • A Mac computer with macOS 10.12 or higher is required.
  • Xcode 9.3 or higher is required.
  • Command Line Tools for Xcode are required.

External dependencies

Next libraries and utilities are required for tests startup:

brew install libimobiledevice --HEAD

There is also a dependency, made necessary by Facebook's WebDriverAgent, for the Carthage dependency manager. If you do not have Carthage on your system, it can also be installed with Homebrew

brew install carthage

Install ios-deploy for app installation on real devices.

npm install -g ios-deploy

Installation

Add jitpack repository to download and build github projects as dependencies:

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Add wda-java-client dependency:

<dependency>
    <groupId>com.github.shvul</groupId>
    <artifactId>wda-java-client</artifactId>
    <version>1.0.3</version>
</dependency>

Download WebDriverAgent with tvOS support:

git clone https://github.com/shvul/WebDriverAgent.git

Move to WebDriverAgent folder:

cd ./WebDriverAgent

Switch to application-commands branch to use application install/activate/launch commands:

git checkout -b application-commands origin/application-commands

Build carthage dependencies:

sh ./Scripts/bootstrap.sh

Open xcode project and sign WebDriverAgentLib_tvOS, WebDriverAgentRunner_tvOS targets under yours provisioning profile.

Capabilities

These capabilities are available for java client configuration:

Capability Description Values
app The absolute local path to a .ipa file to install. e.g., /path/to/my.ipa
bundleId Bundle ID of the app under test. * e.g., com.facebook.wda.integrationApp
udid Unique device identifier of the connected physical device. Capability is required for app install/remove. e.g., a248bf31a45b0153e088d05d66e12dc9316d117d
deviceIp Ip of the physical device. It should be reachable from you network. Capability is required for real devices. e.g., 192.168.0.1
deviceName The kind of mobile device or emulator to use. Apple TV, Apple TV 4K, Apple TV 4K (at 1080p)
language (Sim-only) Language to set for the simulator. e.g., eng
launchTimeout WebDriverAgent startup timeout. Defaults to 60. e.g., 120
locale (Sim-only) Locale to set for the simulator. e.g., eng_us
osVersion (Sim-only) tvOS OS version. e.g., 12.0
platform Which tvOS platform to use. * tvOS, tvOS Simulator
usePrebuiltWDA Skips the build phase of running the WDA app. Building is then the responsibility of the user. Defaults to false. e.g., true
wdaPath Path to WebDriverAgent xcode project. * e.g., path/to/WebDriverAgent/WebDriverAgent.xcodeproj

* - required capabilities

Usage

Create driver capabilities:

DriverCapabilities capabilities = new DriverCapabilities();
capabilities.setDeviceId("a248bf31a45b0153e088d05d66e12dc9316d117d");
capabilities.setWdaPath("WebDriverAgent/WebDriverAgent.xcodeproj");
capabilities.setPlatfrom("tvOS");
capabilities.setDeviceIp("192.168.0.1");
capabilities.setBundleId("com.facebook.wda.integrationApp");

Create driver:

TVDriver driver = DriverFactory.createDriver(capabilities);

Perform checks:

TVElement category = driver.findElement(TVLocator.xpath("//XCUIElementTypeAny[@name='Category']"));
category.select();
TVElement title = driver.findElement(TVLocator.accessibilityId("Title"));
Assert.assertTrue(title.getText(), "Category");

wda-java-client's People

Contributors

shvul avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.