Skip to content

Commit

Permalink
Merge pull request #60 from ImaginativeShohag/update-actions
Browse files Browse the repository at this point in the history
build: update actions
  • Loading branch information
ImaginativeShohag authored Dec 29, 2024
2 parents 7a16640 + df06818 commit 6029664
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
minSdk = BuildConfigConst.minSdk
targetSdk = BuildConfigConst.targetSdk
versionCode = (findProperty("android.injected.version.code") as? String)?.toIntOrNull() ?: 1
versionName = "7.2.1.${getCurrentDateAsYYMMDD()}" // Major.Minor.Patch.YYMMDD
versionName = "7.2.2.${getCurrentDateAsYYMMDD()}" // Major.Minor.Patch.YYMMDD
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fun MacrobenchmarkScope.commonModuleTraverseActions(
for (i in 0..<count) {
Log.d("BaselineProfileGenerator", "item index: $i")

device.waitAndFindObject(By.res(screenTag), 5_000)
device.waitAndFindObject(By.res(screenTag), 5_000, "item index: $i")
val items = device.waitAndFindObjects(By.res("list-item"), 5_000)
device.clickAndWaitForIdle(items[i])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ fun UiDevice.flingElementDownUp(element: UiObject2) {
* Waits until an object with [selector] if visible on screen and returns the object.
* If the element is not available in [timeout], throws [AssertionError]
*/
fun UiDevice.waitAndFindObject(selector: BySelector, timeout: Long): UiObject2 {
fun UiDevice.waitAndFindObject(selector: BySelector, timeout: Long, extraLogText: String = "Non"): UiObject2 {
if (!wait(Until.hasObject(selector), timeout)) {
throw AssertionError("Element not found on screen in ${timeout}ms (selector=$selector)")
throw AssertionError("Element not found on screen in ${timeout}ms (selector=$selector) | $extraLogText")
}

return findObject(selector)
}

fun UiDevice.waitAndFindObjects(selector: BySelector, timeout: Long): List<UiObject2> {
if (!wait(Until.hasObject(selector), timeout)) {
throw AssertionError("Element not found on screen in ${timeout}ms (selector=$selector)")
throw AssertionError("Elements not found on screen in ${timeout}ms (selector=$selector)")
}

return findObjects(selector)
Expand Down

0 comments on commit 6029664

Please sign in to comment.