Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
max-kammerer committed Feb 5, 2024
1 parent 56bad99 commit f80c806
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 170
strategy:
matrix:
arch: [[16, x86, ubuntu-latest], [21, x86, ubuntu-latest], [23, x86, ubuntu-latest], [28, x86, ubuntu-latest], [30, x86_64, macos-latest], [31, x86_64, macos-latest], [32, x86_64, macos-latest], [33, x86_64, macos-latest], [34, x86_64, macos-latest]]
arch: [[16, x86, ubuntu-latest], [21, x86, ubuntu-latest], [23, x86, ubuntu-latest], [28, x86, macos-latest], [30, x86_64, macos-latest], [31, x86_64, macos-latest], [32, x86_64, macos-latest], [33, x86_64, macos-latest]]
runs-on: ${{ matrix.arch[2] }}
steps:
- name: checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiObject2
import androidx.test.uiautomator.Until
import org.junit.Assert
import org.junit.Assert.assertTrue
Expand Down Expand Up @@ -46,15 +45,16 @@ abstract class BaseTest {
return
}

val grant: UiObject2 = device.findObject(By.textContains("Grant")) ?: error("Can't obtain read permissions")
val grant = device.wait(Until.findObject(By.textContains("Grant")), 30000) ?: error("Can't find grant action in warning dialog")
grant.click()

grant.clickAndWait(Until.newWindow(), 1000)
val findObject = device.findObject(By.textContains("Allow"))
findObject.click()
val allowField = device.wait(Until.findObject(By.textContains("Allow")), 10000)
allowField.click()
assertTrue(device.findObject(By.checkable(true)).isChecked)
device.pressBack()
Espresso.onView(ViewMatchers.withId(R.id.view)).check(matches(ViewMatchers.isDisplayed()))
Espresso.onView(ViewMatchers.withId(R.id.view)).check(matches(ViewMatchers.isCompletelyDisplayed()))
assertTrue(BookDescription.SICP.asFile().canRead())
}

@Rule
Expand Down

0 comments on commit f80c806

Please sign in to comment.