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: add updatedWDABundleIdSuffix to handle bundle id for updatedWDABundleId with usePreinstalledWDA #871

Merged
merged 8 commits into from
Mar 26, 2024

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Mar 26, 2024

For more advanced usage of https://appium.github.io/appium-xcuitest-driver/latest/guides/run-preinstalled-wda/

appium/appium-xcuitest-driver#2358 has some description about this usage.

When a user apply a sign with an arbitrary bundle id, the bundle id does not require .xctrunner. In the case, current usage of adding .xctrunner does not work for the appium:usePreinstalledWDA. This is a bit more advanced usage but natural thing in a real device.

I understand adding a new cap is not good but we need a new one to ignore the .xctrunner with updatedWDABundleId combination for usePreinstalledWDA

@saikrishna321
Copy link
Member

Thanks @KazuCocoa for a quick PR. This is going to help.

@KazuCocoa KazuCocoa marked this pull request as ready for review March 26, 2024 06:01
@KazuCocoa KazuCocoa changed the title feat: do not add xctrunner automatiocally with usePreinstalledWDA feat: do not add xctrunner automatiocally for updatedWDABundleId with usePreinstalledWDA Mar 26, 2024
*
* @returns {string} Bundle ID for Xctest.
*/
get bundleIdForXctest () {
return this.updatedWDABundleId ? `${this.updatedWDABundleId}.xctrunner` : WDA_RUNNER_BUNDLE_ID_FOR_XCTEST;
return this.updatedWDABundleId ?
`${this.updatedWDABundleId}${this.doNotAddXctrunnerSuffix ? '' : '.xctrunner'}`

Choose a reason for hiding this comment

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

I am not quite sure we need to completely skip adding the suffix. There is a convention that xctest apps should have bundle ids ending with xctrunner. Perhaps it would be just enough to check if the id already ends with and then skip adding the suffix

Copy link
Member Author

@KazuCocoa KazuCocoa Mar 26, 2024

Choose a reason for hiding this comment

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

bundle id can be non- .xctrunner when the bundle id in info.plist updated after wda build like downloading packages from https://github.com/appium/WebDriverAgent/releases and signed properly. XCTest session also can start with it.

@@ -70,6 +70,7 @@ class WebDriverAgent {
this.wdaLaunchTimeout = args.wdaLaunchTimeout || WDA_LAUNCH_TIMEOUT;
this.usePreinstalledWDA = args.usePreinstalledWDA;
this.xctestApiClient = null;
this.doNotAddXctrunnerSuffix = args.doNotAddXctrunnerSuffix;

Choose a reason for hiding this comment

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

how about changing this cap to updatedWDABundleIdSuffix and have it equal to .xctrunner by default?
this way it would clearly be visible to where this capability belongs

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, it sounds good idea

@KazuCocoa KazuCocoa changed the title feat: do not add xctrunner automatiocally for updatedWDABundleId with usePreinstalledWDA feat: add updatedWDABundleIdSuffix to handle bundle id for updatedWDABundleId with usePreinstalledWDA Mar 26, 2024
@@ -70,6 +70,7 @@ class WebDriverAgent {
this.wdaLaunchTimeout = args.wdaLaunchTimeout || WDA_LAUNCH_TIMEOUT;
this.usePreinstalledWDA = args.usePreinstalledWDA;
this.xctestApiClient = null;
this.updatedWDABundleIdSuffix = _.isString(args.updatedWDABundleIdSuffix) ? args.updatedWDABundleIdSuffix : DEFAULT_TEST_BUNDLE_SUFFIX;

Choose a reason for hiding this comment

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

= args.updatedWDABundleIdSuffix ?? DEFAULT_TEST_BUNDLE_SUFFIX

@KazuCocoa KazuCocoa merged commit d79b624 into master Mar 26, 2024
46 checks passed
@KazuCocoa KazuCocoa deleted the donot-add-xctrunner branch March 26, 2024 18:52
github-actions bot pushed a commit that referenced this pull request Mar 26, 2024
## [8.1.0](v8.0.2...v8.1.0) (2024-03-26)

### Features

* add updatedWDABundleIdSuffix to handle bundle id for updatedWDABundleId with usePreinstalledWDA ([#871](#871)) ([d79b624](d79b624))
Copy link

🎉 This PR is included in version 8.1.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