Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
added class attribute (#37)
Browse files Browse the repository at this point in the history
* added class attribute

* apply codestyle
  • Loading branch information
BenedictP authored Oct 9, 2023
1 parent 8800351 commit bf3d59b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

## [Unreleased]

#[1.1.4] - 2023-09-25
# [1.1.5] - 2023-10-09

Added:
- `Class' attribute to better understand the view hierarchy

# [1.1.4] - 2023-09-25

Fixed:
- When entering text with an `UiElementIdentifier` with index. Index was not used.
Expand Down Expand Up @@ -148,9 +153,10 @@ New:

Initial release.

[unreleased]: https://github.com/getyourguide/UiTestGlaze/compare/1.1.4...HEAD
[1.1.2]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.4
[1.1.2]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.3
[unreleased]: https://github.com/getyourguide/UiTestGlaze/compare/1.1.5...HEAD
[1.1.5]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.5
[1.1.4]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.4
[1.1.3]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.3
[1.1.2]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.2
[1.1.1]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.1
[1.1.0]: https://github.com/getyourguide/UiTestGlaze/releases/tag/1.1.0
Expand Down
2 changes: 1 addition & 1 deletion uiTestGlaze/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

ext {
PUBLISH_GROUP_ID = 'io.github.getyourguide'
PUBLISH_VERSION = '1.1.4'
PUBLISH_VERSION = '1.1.5'
PUBLISH_ARTIFACT_ID = 'uitestglaze'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum class Attribute {
BOUNDS,
CHECKED,
ENABLED,
CLASS,
}

internal class GetHierarchyHelper(private val logger: Logger) {
Expand Down Expand Up @@ -139,6 +140,10 @@ internal class GetHierarchyHelper(private val logger: Logger) {
attributesBuilder[Attribute.ENABLED] = node.getAttribute("enabled")
}

if (node.hasAttribute("class")) {
attributesBuilder[Attribute.CLASS] = node.getAttribute("class")
}

attributesBuilder
} else if (node is Element && !isNotSystembar(node)) {
return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal class InputTextHelper(
-> {
device.findObject(
UiSelector().resourceId(foundUiElement.resourceId)
.instance(uiElementIdentifier.index)
.instance(uiElementIdentifier.index),
).text = text
}

Expand All @@ -58,7 +58,7 @@ internal class InputTextHelper(
is UiElementIdentifier.TextRegex,
-> {
device.findObject(
UiSelector().text(foundUiElement.text).instance(uiElementIdentifier.index)
UiSelector().text(foundUiElement.text).instance(uiElementIdentifier.index),
).text = text
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ internal class ScrollHelper(
config.waitTillHierarchySettlesTimeout,
)
hierarchyAfterScroll = getHierarchyHelper.getHierarchy(device)

} while (hierarchyBeforeScroll == hierarchyAfterScroll &&
(System.currentTimeMillis() - startTime) < 3.seconds.inWholeMilliseconds
)
Expand Down

0 comments on commit bf3d59b

Please sign in to comment.