Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral committed Apr 7, 2021
1 parent b8fd5ee commit 180e154
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private object Text {
}

private object Res {
const val tabLayout = "com.futuremark.dmandroid.application:id/flm_tab_layout_benchmarks"
const val btnSkip = "com.futuremark.dmandroid.application:id/flm_bt_tutorial_skip"
const val fabBenchmark = "com.futuremark.dmandroid.application:id/flm_fab_benchmark"
const val fabSettings = "com.futuremark.dmandroid.application:id/flm_fab_settings"
Expand All @@ -53,24 +54,39 @@ class Run3DMark {
// Wait for 3d mark launcher icon
wait(Until.hasObject(By.text(Text.appName)), TIMEOUT)

waitForIdle(5000)

// Click 3d mark launcher icon
findObject(UiSelector().text(Text.appName)).click()

waitForIdle(5000)

// Check permissions dialog
if (findObject(UiSelector().text(Text.permTitle)).exists()) {
findObject(UiSelector().text(Text.ok)).click()
findObject(UiSelector().text(Text.allow)).click()
}

Thread.sleep(3000)
waitForIdle(5000)
Thread.sleep(2000)

// Skip tutorial if needed
findObject(UiSelector().resourceId(Res.btnSkip)).apply {
if (exists()) click()
}

waitForIdle(5000)

if (findObject(UiSelector().text(Text.benchmarkType)).exists().not()) {
findObject(UiSelector().resourceId(Res.tabLayout)).swipeLeft(10)
waitForIdle(1000)
}

// Choose proper benchmark screen
findObject(UiSelector().text(Text.benchmarkType)).click()
// click(318, 104)

waitForIdle(5000)

// Settings fab is not visible if the additional software is not installed
if (findObject(UiSelector().resourceId(Res.fabSettings)).exists().not()) {
Expand All @@ -89,7 +105,7 @@ class Run3DMark {
findObject(UiSelector().resourceId(Res.fabBenchmark)).click()


Thread.sleep(3000)
waitForIdle(5000)

// Wait until benchmark finish
wait(Until.hasObject(By.res(Res.scoreDetails)), BENCHMARK_TIMEOUT)
Expand All @@ -101,4 +117,4 @@ class Run3DMark {
Thread.sleep(5000)
}
}
}
}

0 comments on commit 180e154

Please sign in to comment.