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: introduce a wildcard usage for additionalWebviewBundleIds to get webview contexts of other apps #346

Merged
merged 11 commits into from
Nov 17, 2023

Conversation

mwakizaka
Copy link
Contributor

@mwakizaka mwakizaka commented Nov 14, 2023

  • We'd like to switch to a webview context of an app which is launched by mobile: launchApp script.
    - We don't like to use additionalWebViewBundleIds capability for our case because it's troublesome to get the bundle id of the app before establishing an appium session.
    - Therefore, I'd like to add a boolean capability named like includeAllAppsInWebviews.
  • Therefore, this PR adds a wildcard usage for additionalWebviewBundleIds capability.
  • Thanks to isActive check, I don't think searchForApp returns too many AppPages
    - If this PR is no problem, I'd like to send a PR to appium-xcuitest-driver as well to add includeAllAppsInWebviews capability.

@KazuCocoa
Copy link
Member

Or adding * usage instead of adding a new capability?
additionalWebviewBundleIds: ['*'], then all bundle ids will be selected

@mwakizaka
Copy link
Contributor Author

Thank you for your comment! Will try adding * usage to additionalWebviewBundleIds capability.

lib/utils.js Outdated
@@ -164,7 +184,6 @@ function getPossibleDebuggerAppKeys (bundleIds, appDict) {
WEB_CONTENT_PROCESS_BUNDLE_ID,
SAFARI_VIEW_PROCESS_BUNDLE_ID,
SAFARI_VIEW_BUNDLE_ID,
WILDCARD_BUNDLE_ID,
Copy link
Member

Choose a reason for hiding this comment

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

Can you keep this line? It seems like Safari has * case as #179 , not sure all supported iOS versions though.

So only when a user specifies * explicitly as the capabilities, the new behavior occurs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, addressed as d92627f

@mwakizaka mwakizaka changed the title feat: introduce includeAllApps parameter to get webview contexts of other apps feat: introduce a wildcard usage for additionalWebviewBundleIds to get webview contexts of other apps Nov 17, 2023
Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

lgtm overall. (waiting for the ci)

@@ -57,6 +59,64 @@ describe('utils', function () {
expect(getDebuggerAppKey('io.appium.bundle', {})).to.not.exist;
});
});
describe('getPossibleDebuggerAppKeys', function () {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@mwakizaka
Copy link
Contributor Author

@mykola-mokhnach
Copy link
Contributor

there seems to be a test failure in https://github.com/appium/appium-remote-debugger/actions/runs/6902034726/job/18778125000?pr=346

Seems like an issue to me

@KazuCocoa
Copy link
Member

A retry fixed that. Maybe just flaky?

@KazuCocoa KazuCocoa merged commit 72ee224 into appium:master Nov 17, 2023
github-actions bot pushed a commit that referenced this pull request Nov 17, 2023
## [10.2.0](v10.1.7...v10.2.0) (2023-11-17)

### Features

* introduce a wildcard usage for additionalWebviewBundleIds to get webview contexts of other apps ([#346](#346)) ([72ee224](72ee224))
Copy link

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