-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release-1.8.22
- Loading branch information
Showing
8 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
app/src/androidTest/java/com/orgzly/android/espresso/SshKeyCreationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.orgzly.android.espresso | ||
|
||
import androidx.test.core.app.ActivityScenario | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.Espresso.pressBack | ||
import androidx.test.espresso.action.ViewActions.click | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.RootMatchers.isDialog | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withText | ||
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation | ||
import com.orgzly.R | ||
import com.orgzly.BuildConfig | ||
import com.orgzly.android.OrgzlyTest | ||
import com.orgzly.android.espresso.util.EspressoUtils | ||
import com.orgzly.android.ui.main.MainActivity | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
import org.junit.Assume | ||
|
||
|
||
@RunWith(value = Parameterized::class) | ||
class SshKeyCreationTest(private val param: Parameter) : OrgzlyTest() { | ||
data class Parameter(val keyType: Int) | ||
companion object { | ||
@JvmStatic | ||
@Parameterized.Parameters | ||
fun data(): Collection<Parameter> { | ||
return listOf( | ||
Parameter(keyType = R.string.ssh_keygen_label_rsa), | ||
Parameter(keyType = R.string.ssh_keygen_label_ecdsa), | ||
Parameter(keyType = R.string.ssh_keygen_label_ed25519), | ||
) | ||
} | ||
} | ||
|
||
@Test | ||
fun testCreateUnprotectedKey() { | ||
Assume.assumeFalse(BuildConfig.IS_GIT_REMOVED); | ||
ActivityScenario.launch(MainActivity::class.java).use { | ||
EspressoUtils.onActionItemClick(R.id.activity_action_settings, R.string.settings) | ||
EspressoUtils.clickSetting(null, R.string.app) | ||
EspressoUtils.clickSetting(null, R.string.developer_options) | ||
EspressoUtils.clickSetting(null, R.string.git_repository_type) | ||
pressBack() | ||
pressBack() | ||
EspressoUtils.clickSetting(null, R.string.sync) | ||
EspressoUtils.clickSetting(null, R.string.ssh_keygen_preference_title) | ||
onView(withText(param.keyType)).perform(click()) | ||
onView(withText(R.string.ssh_keygen_generate)).perform(click()) | ||
getInstrumentation().waitForIdleSync() | ||
onView(withText(R.string.your_public_key)).inRoot(isDialog()) | ||
.check(matches(isDisplayed())) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:installLocation="auto"> | ||
|
||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters