Skip to content

Commit

Permalink
chore: add permissionRuleCamera to test
Browse files Browse the repository at this point in the history
  • Loading branch information
garciagarciaadrian committed Nov 6, 2023
1 parent 94dd0ad commit d67cd26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
3 changes: 3 additions & 0 deletions AliceOnboardingSampleApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ dependencies {
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'

androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'


// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,28 @@ package com.alicebiometrics.aliceonboardingsampleapp

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import androidx.test.runner.AndroidJUnit4
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith


/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/

@RunWith(AndroidJUnit4::class)
@LargeTest
class ExampleInstrumentedTest {

@Rule @JvmField
val mActivityRule = ActivityTestRule(MainActivity::class.java)

//@get:Rule var permissionRuleCamera = GrantPermissionRule.grant(android.Manifest.permission.CAMERA)
//@get:Rule var permissionRuleWriteExternal = GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)

@get:Rule
var intentsRule: IntentsTestRule<MainActivity> = IntentsTestRule(MainActivity::class.java)

var mLocatingActivity: MainActivity? = null

@Before
fun setup() {
mLocatingActivity = mActivityRule.getActivity()
}
@get:Rule var permissionRuleCamera = GrantPermissionRule.grant(android.Manifest.permission.CAMERA)

@Test fun listGoesOverTheFold() {
@Test
fun checkButton() {
onView(withId(R.id.buttonCreateAccount)).check(matches(isDisplayed()))
}
}

0 comments on commit d67cd26

Please sign in to comment.