Skip to content

Commit

Permalink
Merge pull request #194 from nheyek/choose-language-layout
Browse files Browse the repository at this point in the history
Augment the test of language choosing
  • Loading branch information
jjjules committed Nov 17, 2018
2 parents 68025f9 + a779d7e commit 37ba986
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -27,6 +27,7 @@
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static ch.epfl.sweng.studyup.utils.Constants.LANGUAGES;
import static ch.epfl.sweng.studyup.utils.Constants.PERSIST_LOGIN_FILENAME;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -74,11 +75,13 @@ public void closeButtonTest() {

@Test
public void testLanguageChoosingPopup() {
onView(withId(R.id.languageChoiceButton)).perform(click());
onView(withText(R.string.cancel))
.inRoot(isDialog())
.check(matches(isDisplayed()))
.perform(click());
for(String s : LANGUAGES) {
onView(withId(R.id.languageChoiceButton)).perform(click());
onView(withText(s))
.inRoot(isDialog())
.check(matches(isDisplayed()))
.perform(click());
}

//If all worked, we could close the settings
onView(withId(R.id.back_button)).perform(click());
Expand Down

0 comments on commit 37ba986

Please sign in to comment.