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: Control the visibility of the Tab Bar and Smart App Banner #1345

Merged
merged 9 commits into from
Oct 29, 2021

Conversation

zcmgyu
Copy link
Contributor

@zcmgyu zcmgyu commented Oct 26, 2021

Description

I attempt to click a web element on iPad with nativeWebTap and nativeWebTapStrict are enabled. Because of the existence of too many elements on the screen, it took me about 40 seconds to click that element. I figured out that finding the existence of tab bar and smart app banner for measuring offset takes almost time. So I thought that being able to control this through the Settings API would help.
After this PR, it takes me 10 seconds to click that element.

This feature may help bypass this issue: appium/appium#14988

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Usage

  • If the tab bar is visible and there is no smart app banner.
driver.setSettings(new HashMap<>() {{
      put("nativeWebTap", true);
      put("nativeWebTapStrict", true);
      put("nativeWebTapTabBarVisibility", "visible");
      put("nativeWebTapSmartAppBannerVisibility", "invisible");
}});
  • If you want to leave Appium check the existence of tab bar and smart app banner
driver.setSettings(new HashMap<>() {{
      put("nativeWebTap", true);
      put("nativeWebTapStrict", true);
      put("nativeWebTapTabBarVisibility", "detect");
      put("nativeWebTapSmartAppBannerVisibility", "detect");
}});
  • Read more about usage in the document.

Test Configuration:

  • Appium: 1.23.0-beta.0
  • NodeJS: v14.18.1
  • MacOS: 11.5

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

lib/commands/web.js Outdated Show resolved Hide resolved
const durationWithoutIgnore = end1 - start1;

const start2 = performance.now();
await driver.updateSettings({ nativeWebTapSmartAppBannerVisible: false });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, the smart app banner is not visible.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@zcmgyu
Copy link
Contributor Author

zcmgyu commented Oct 26, 2021

This feature may help bypass this issue: appium/appium#14988

@zcmgyu zcmgyu requested a review from KazuCocoa October 26, 2021 09:29
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@zcmgyu zcmgyu changed the title feat: Implement setting keywords nativeWebTapTabBarVisible and nativeWebTapSmartAppBannerVisible feat: Control the visibility of the Tab Bar and Smart App Banner Oct 26, 2021
@zcmgyu
Copy link
Contributor Author

zcmgyu commented Oct 26, 2021

Updated description and title as well.

lib/commands/web.js Outdated Show resolved Hide resolved
lib/commands/web.js Outdated Show resolved Hide resolved
lib/commands/web.js Show resolved Hide resolved
lib/commands/web.js Show resolved Hide resolved
lib/commands/web.js Show resolved Hide resolved
@mykola-mokhnach mykola-mokhnach merged commit d4e4e93 into appium:master Oct 29, 2021
github-actions bot pushed a commit that referenced this pull request Oct 29, 2021
# [3.56.0](v3.55.2...v3.56.0) (2021-10-29)

### Features

* Control the visibility of the Tab Bar and Smart App Banner ([#1345](#1345)) ([d4e4e93](d4e4e93))
@github-actions
Copy link
Contributor

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

None yet

3 participants