Skip to content

Commit

Permalink
Add a setting for tag names normalization (#1073)
Browse files Browse the repository at this point in the history
* Add a setting for tag names normalization

* wording
  • Loading branch information
mykola-mokhnach authored and saikrishna321 committed Dec 20, 2018
1 parent b10f521 commit 1e80714
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/appium/java_client/Setting.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public enum Setting {
FIX_IMAGE_TEMPLATE_SIZE("fixImageTemplateSize"),
CHECK_IMAGE_ELEMENT_STALENESS("checkForImageElementStaleness"),
UPDATE_IMAGE_ELEMENT_POSITION("autoUpdateImageElementPosition"),
NORMALIZE_TAG_NAMES("normalizeTagNames"),
IMAGE_ELEMENT_TAP_STRATEGY("imageElementTapStrategy");

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,19 @@ default void configuratorSetKeyInjectionDelay(Duration delay) {
default void configuratorSetActionAcknowledgmentTimeout(Duration timeout) {
setSetting(Setting.WAIT_ACTION_ACKNOWLEDGMENT_TIMEOUT, timeout.toMillis());
}

/**
* Setting this value to true will enforce source tree dumper
* to transliterate all class names used as XML tags to the limited
* set of ASCII characters supported by Apache Harmony
* lib and used by default in Android to avoid possible
* XML parsing exceptions caused by XPath lookup.
* The Unicode to ASCII transliteration is based on
* JUnidecode library (https://github.com/gcardone/junidecode).
*
* @param enabled Either true or false. The default value if false.
*/
default void normalizeTagNames(boolean enabled) {
setSetting(Setting.NORMALIZE_TAG_NAMES, enabled);
}
}

0 comments on commit 1e80714

Please sign in to comment.