-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve HelpActivity TestSetup & add test for #98
- Loading branch information
Showing
2 changed files
with
36 additions
and
37 deletions.
There are no files selected for viewing
37 changes: 0 additions & 37 deletions
37
android/src/androidTest/java/org/ligi/passandroid/TheHelpActivity.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
android/src/androidTest/java/org/ligi/passandroid/TheHelpActivity.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,36 @@ | ||
package org.ligi.passandroid | ||
|
||
import android.support.test.espresso.Espresso.onView | ||
import android.support.test.espresso.action.ViewActions.click | ||
import android.support.test.espresso.assertion.ViewAssertions.matches | ||
import android.support.test.espresso.matcher.ViewMatchers.* | ||
import android.support.test.rule.ActivityTestRule | ||
import junit.framework.Assert | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.ligi.passandroid.helper.ScreenshotTaker | ||
import org.ligi.passandroid.steps.HelpSteps.checkThatHelpIsThere | ||
import org.ligi.passandroid.ui.HelpActivity | ||
|
||
class TheHelpActivity { | ||
|
||
@get:Rule | ||
val rule: ActivityTestRule<HelpActivity> = ActivityTestRule(HelpActivity::class.java) | ||
|
||
@Test | ||
fun testHelpIsThere() { | ||
checkThatHelpIsThere() | ||
ScreenshotTaker.takeScreenshot(rule.activity, "help") | ||
} | ||
|
||
@Test | ||
fun test_that_help_finishes_on_home() { | ||
onView(withContentDescription(R.string.abc_action_bar_up_description)).perform(click()) | ||
Assert.assertTrue(rule.activity.isFinishing) | ||
} | ||
|
||
@Test | ||
fun test_that_version_is_shown() { | ||
onView(withText("v" + BuildConfig.VERSION_NAME)).check(matches(isDisplayed())) | ||
} | ||
} |