Skip to content

Commit

Permalink
fix Input was not using index when provided and bump version to 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
BenedictP committed Sep 25, 2023
1 parent 0e88d0d commit 8800351
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## [Unreleased]

#[1.1.4] - 2023-09-25

Fixed:
- When entering text with an `UiElementIdentifier` with index. Index was not used.

# [1.1.3] - 2023-09-14

Added:
Expand Down Expand Up @@ -143,7 +148,8 @@ New:

Initial release.

[unreleased]: https://github.com/getyourguide/UiTestGlaze/compare/1.1.3...HEAD
[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
[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
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.3'
PUBLISH_VERSION = '1.1.4'
PUBLISH_ARTIFACT_ID = 'uitestglaze'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import kotlin.time.Duration
internal class InputTextHelper(
private val getHierarchyHelper: GetHierarchyHelper,
private val findUiElementHelper: FindUiElementHelper,
private val hierarchySettleHelper: HierarchySettleHelper,
private val config: UiTestGlaze.Config,
) {

fun inputText(
Expand Down Expand Up @@ -49,25 +47,25 @@ internal class InputTextHelper(
is UiElementIdentifier.Id,
is UiElementIdentifier.TestTag,
-> {
device.findObject(UiSelector().resourceId(foundUiElement.resourceId)).text = text
device.findObject(
UiSelector().resourceId(foundUiElement.resourceId)
.instance(uiElementIdentifier.index)
).text = text
}

is UiElementIdentifier.Text,
is UiElementIdentifier.TextResource,
is UiElementIdentifier.TextRegex,
-> {
device.findObject(UiSelector().text(foundUiElement.text)).text = text
device.findObject(
UiSelector().text(foundUiElement.text).instance(uiElementIdentifier.index)
).text = text
}
}
val startTime = System.currentTimeMillis()
var hierarchyChanged = false
do {
val hierarchyAfterEnteringText = hierarchySettleHelper.waitTillHierarchySettles(
emptyList(),
device,
config.waitTillLoadingViewsGoneTimeout,
config.waitTillHierarchySettlesTimeout,
)
val hierarchyAfterEnteringText = getHierarchyHelper.getHierarchy(device)
if (hierarchy != hierarchyAfterEnteringText) {
hierarchyChanged = true
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ data class UiTestGlaze(
private val hierarchySettleHelper =
HierarchySettleHelper(getHierarchyHelper, findUiElementHelper, logger)
private val inputTextHelper =
InputTextHelper(getHierarchyHelper, findUiElementHelper, hierarchySettleHelper, config)
InputTextHelper(getHierarchyHelper, findUiElementHelper)
private val printHierarchyHelper = PrintHierarchyHelper(logger)
private val scrollHelper =
ScrollHelper(findUiElementHelper, getHierarchyHelper, hierarchySettleHelper)
Expand Down

0 comments on commit 8800351

Please sign in to comment.