Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: install prebuilt WDA as prebuiltWDAPath capability #1672

Merged
merged 12 commits into from
May 11, 2023
Merged

Conversation

KazuCocoa
Copy link
Member

prebuiltWDAPath capability lets XCUITest driver install the path for every new session request.
The bundle version is always 1, so it seems like we cannot compare the version to decide if the given WDA is already installed or not. So current method always installs the given path.

Timeout and installation strategy respects the existing capabilities.

@@ -56,7 +56,8 @@ Capability | Description
|`appium:showXcodeLog`|Whether to display the output of the Xcode command used to run the tests. If this is `true`, there will be **lots** of extra logging at startup. Defaults to `false`|e.g., `true`|
|`appium:iosInstallPause`|Time in milliseconds to pause between installing the application and starting `WebDriverAgent` on the device. Used particularly for larger applications. Defaults to `0`|e.g., `8000`|
|`appium:usePrebuiltWDA`|Skips the build phase of running the WDA app. Building is then the responsibility of the user. Only works for Xcode 8+. Defaults to `false`.|e.g., `true`|
|`appium:usePreinstalledWDA`| Whether to launch a preinstalled WebDriverAgentRunner application using a custom XCTest API client (via `com.apple.instruments` service) instead of running `xcodebuild` for real devices. The preinstalled WebDriverAgent package must have been built by Xcode 12+. The default target bundle identifier is `com.facebook.WebDriverAgentRunner.xctrunner`. If `appium:updatedWDABundleId` is provided, `<appium:updatedWDABundleId>.xctrunner` will be launched. Please read [Run Preinstalled WebDriverAgentRunner](./run-preinstalled-wda.md) for more details. Defaults to `false`. |`true` or `false`|
|`appium:prebuiltWDAPath`| The path to a WebDriverAgentRunner application package to be installed with `appium:usePreinstalledWDA` capability. The package's bundle id will be used over `appium:updatedWDABundleId`. |e.g., `true`|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also mention this capability in documents?

docs/capabilities.md Outdated Show resolved Hide resolved
@@ -56,7 +56,8 @@ Capability | Description
|`appium:showXcodeLog`|Whether to display the output of the Xcode command used to run the tests. If this is `true`, there will be **lots** of extra logging at startup. Defaults to `false`|e.g., `true`|
|`appium:iosInstallPause`|Time in milliseconds to pause between installing the application and starting `WebDriverAgent` on the device. Used particularly for larger applications. Defaults to `0`|e.g., `8000`|
|`appium:usePrebuiltWDA`|Skips the build phase of running the WDA app. Building is then the responsibility of the user. Only works for Xcode 8+. Defaults to `false`.|e.g., `true`|
|`appium:usePreinstalledWDA`| Whether to launch a preinstalled WebDriverAgentRunner application using a custom XCTest API client (via `com.apple.instruments` service) instead of running `xcodebuild` for real devices. The preinstalled WebDriverAgent package must have been built by Xcode 12+. The default target bundle identifier is `com.facebook.WebDriverAgentRunner.xctrunner`. If `appium:updatedWDABundleId` is provided, `<appium:updatedWDABundleId>.xctrunner` will be launched. Please read [Run Preinstalled WebDriverAgentRunner](./run-preinstalled-wda.md) for more details. Defaults to `false`. |`true` or `false`|
|`appium:prebuiltWDAPath`| The path to a WebDriverAgentRunner application package to be installed with `appium:usePreinstalledWDA` capability. The package's bundle id will be used over `appium:updatedWDABundleId`. |e.g., `true`|
|`appium:usePreinstalledWDA`| Whether to launch a preinstalled WebDriverAgentRunner application using a custom XCTest API client (via `com.apple.instruments` service) instead of running `xcodebuild` for real devices. If `appium:pprebuiltWDAPath` is provided, XCUITest driver will install it before launching the appliaction. The preinstalled WebDriverAgent package must have been built by Xcode 12+. The default target bundle identifier is `com.facebook.WebDriverAgentRunner.xctrunner`. If `appium:updatedWDABundleId` is provided, `<appium:updatedWDABundleId>.xctrunner` will be launched. Please read [Run Preinstalled WebDriverAgentRunner](./run-preinstalled-wda.md) for more details. Defaults to `false`. |`true` or `false`|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo appliaction

@KazuCocoa
Copy link
Member Author

Updated ✅

If `appium:prebuiltWDAPath` is provided with properly signed `WebDriverAgentRunner-Runner.app` test bundle (please check [Real Device Configuration tutorial](real-device-config.md)), XCUITest driver will install the application and launch it every session.
The test bundle cannot set the versioning as `CFBundleVersion`, thus the installation occurs every session.

The `.app` test bundle is generally generated as below if you built with Xcode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I don't understand what this sentence describes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to leave the default place for WebDriverAgentRunner-Runner.app when a user builds WDA via Xcode. Mostly for beginners.

Advanced users who can build with xcodebuild it not this scope.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually you can find the actual WebDriverAgentRunner application bundle at the below location if you use Xcode to build it.

### Set `appium:prebuiltWDAPath`

If `appium:prebuiltWDAPath` is provided with properly signed `WebDriverAgentRunner-Runner.app` test bundle (please check [Real Device Configuration tutorial](real-device-config.md)), XCUITest driver will install the application and launch it every session.
The test bundle cannot set the versioning as `CFBundleVersion`, thus the installation occurs every session.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test bundles cannot be versioned using CFBundleVersion as vanilla apps do. That is why it is necessary to (re)install them for every test session

@KazuCocoa KazuCocoa merged commit 2226123 into master May 11, 2023
@KazuCocoa KazuCocoa deleted the install-wda branch May 11, 2023 17:48
github-actions bot pushed a commit that referenced this pull request May 11, 2023
## [4.27.0](v4.26.0...v4.27.0) (2023-05-11)

### Features

* install prebuilt WDA as prebuiltWDAPath capability ([#1672](#1672)) ([2226123](2226123))
@github-actions
Copy link
Contributor

🎉 This PR is included in version 4.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants