-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed and added a test shouldShowToastWithHello()
- Loading branch information
Showing
4 changed files
with
33 additions
and
65 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
library/src/androidTest/java/me/drakeet/toast/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
sample/src/androidTest/java/me/drakeet/toast/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
sample/src/androidTest/java/me/drakeet/toast/sample/MainActivityTest.java
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,32 @@ | ||
package me.drakeet.toast.sample; | ||
|
||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.LargeTest; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static android.support.test.espresso.Espresso.onView; | ||
import static android.support.test.espresso.assertion.ViewAssertions.matches; | ||
import static android.support.test.espresso.matcher.RootMatchers.withDecorView; | ||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; | ||
import static android.support.test.espresso.matcher.ViewMatchers.withText; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.hamcrest.Matchers.not; | ||
|
||
@LargeTest | ||
@RunWith(AndroidJUnit4.class) | ||
public class MainActivityTest { | ||
|
||
@Rule | ||
public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class); | ||
|
||
|
||
@Test | ||
public void shouldShowToastWithHello() { | ||
onView(withText("hello")) | ||
.inRoot(withDecorView(not(is(rule.getActivity().getWindow().getDecorView())))) | ||
.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