Skip to content

Commit

Permalink
Fixed IntentGroupTest
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Feb 15, 2023
1 parent 4d985d0 commit 7e06f6d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.isEnabled;
import static androidx.test.espresso.matcher.ViewMatchers.withClassName;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withTagValue;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.StringEndsWith.endsWith;
Expand All @@ -47,6 +49,7 @@

import androidx.core.content.FileProvider;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.matcher.ViewMatchers;

import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -204,7 +207,7 @@ public void collect_shouldNotCrashWhenAnyErrorIsThrownWhileReceivingAnswer() {
}

private void assertImageWidgetWithoutAnswer() {
onView(withTagValue(is("ImageView"))).check(doesNotExist());
onView(allOf(withTagValue(is("ImageView")), withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))).check(doesNotExist());
onView(withId(R.id.capture_image)).check(doesNotExist());
onView(withId(R.id.choose_image)).check(doesNotExist());
}
Expand All @@ -223,7 +226,7 @@ private void assertFileWidgetWithoutAnswer() {
}

private void assertImageWidgetWithAnswer() {
onView(withTagValue(is("ImageView"))).perform(scrollTo()).check(matches(isDisplayed()));
onView(allOf(withTagValue(is("ImageView")), withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))).check(matches(not(doesNotExist())));
onView(withId(R.id.capture_image)).check(doesNotExist());
onView(withId(R.id.choose_image)).check(doesNotExist());
}
Expand Down

0 comments on commit 7e06f6d

Please sign in to comment.