mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-19 04:16:27 -04:00
#2278 updated language fragment inst tests
This commit is contained in:
parent
6bf35d6c9d
commit
b48809a1fa
@ -22,6 +22,7 @@ import android.Manifest;
|
|||||||
import androidx.test.espresso.ViewInteraction;
|
import androidx.test.espresso.ViewInteraction;
|
||||||
import androidx.test.espresso.intent.Intents;
|
import androidx.test.espresso.intent.Intents;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
import androidx.test.rule.GrantPermissionRule;
|
import androidx.test.rule.GrantPermissionRule;
|
||||||
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
|
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
@ -31,6 +32,7 @@ import org.junit.Rule;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.kiwix.kiwixmobile.R;
|
import org.kiwix.kiwixmobile.R;
|
||||||
|
import org.kiwix.kiwixmobile.main.KiwixMainActivity;
|
||||||
|
|
||||||
import static androidx.test.espresso.Espresso.onView;
|
import static androidx.test.espresso.Espresso.onView;
|
||||||
import static androidx.test.espresso.action.ViewActions.click;
|
import static androidx.test.espresso.action.ViewActions.click;
|
||||||
@ -42,6 +44,7 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
|||||||
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
|
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
|
||||||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||||
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
||||||
|
import static com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn;
|
||||||
import static org.hamcrest.CoreMatchers.not;
|
import static org.hamcrest.CoreMatchers.not;
|
||||||
import static org.hamcrest.Matchers.allOf;
|
import static org.hamcrest.Matchers.allOf;
|
||||||
import static org.hamcrest.core.IsNull.notNullValue;
|
import static org.hamcrest.core.IsNull.notNullValue;
|
||||||
@ -49,9 +52,12 @@ import static org.kiwix.kiwixmobile.testutils.Matcher.childAtPosition;
|
|||||||
import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS;
|
import static org.kiwix.kiwixmobile.testutils.TestUtils.TEST_PAUSE_MS;
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class LanguageActivityTest {
|
public class LanguageFragmentTest {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
|
public ActivityTestRule<KiwixMainActivity> activityTestRule =
|
||||||
|
new ActivityTestRule<>(KiwixMainActivity.class);
|
||||||
|
@Rule
|
||||||
public GrantPermissionRule readPermissionRule =
|
public GrantPermissionRule readPermissionRule =
|
||||||
GrantPermissionRule.grant(Manifest.permission.READ_EXTERNAL_STORAGE);
|
GrantPermissionRule.grant(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
@Rule
|
@Rule
|
||||||
@ -65,8 +71,8 @@ public class LanguageActivityTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("Covert to kotlin/robot")
|
@Ignore("Covert to kotlin/robot")
|
||||||
public void testLanguageActivity() {
|
public void testLanguageFragment() {
|
||||||
onView(withText("Online")).perform(click());
|
clickOn(R.string.download);
|
||||||
// Open the Language Activity
|
// Open the Language Activity
|
||||||
onView(withContentDescription("Choose a language")).perform(click());
|
onView(withContentDescription("Choose a language")).perform(click());
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user