Closed jocmp closed 6 years ago
Hi @josiahcampbell,
I didn't know about the GrantPermissionRule
. I will delete the method grantPermission
in favor of the rule. I released a new version (3.2.1) with this change.
Thanks!
Thanks for the response!
It's worth noting that I was able to get GrantPermissionRule working in my GreenCoffeeTest file:
@RunWith(Parameterized::class)
class SignUpTest(scenarioConfig: ScenarioConfig) : GreenCoffeeTest(scenarioConfig) {
@get:Rule
val activity = ActivityTestRule(LoginActivity::class.java)
@get:Rule
val grantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION);
@Test
fun test() {
start(SignUpSteps())
}
companion object {
@Parameters(name = "{0}")
@JvmStatic
fun scenarios(): Iterable<ScenarioConfig> {
return GreenCoffeeConfig()
.withFeatureFromAssets("assets/signup.feature")
.scenarios()
}
}
}
I have two questions regarding the
grantPermission
method:Where's the best place to put the initialization? Here's one place I thought of:
What strings are permitted? For instance,
grantPermission
callsexecuteShellCommand
which takes a Manifest-permitted String for permission, contrasted against something like GrantPermissionRule which would take something along the lines ofandroid.Manifest.permission.ACCESS_FINE_LOCATION
.