2016-04-25 10 views
4

2つのテキストビューを持つシンプルな線形レイアウトがあります。線形レイアウトには固有のIDがありますが、textviewにはありません。テキストの1つがこれらのテキストビューからのものであることを確認するにはどうすればよいですか?親の中にtextviewsと一致するエスプレッソなAndroid

android.support.test.espresso.NoMatchingViewException: No views in 
    hierarchy found matching 

答えて

4

使用hasDescendant()

onView(withId(R.id.recycler_view)).check(matches(atPosition(0, hasDescendant(withText("Available"))))); 
:そのはme.Iは、次のエラーを取得していますのために働いていない、残念ながら

onView(allOf(NavigationDrawerComponent.topSectionWrapper, 
       hasSibling(withClassName(Matchers.equalTo(TextView.class.getSimpleName()))))) 
       .check(matches(withText(Data.fullUserName))); 

は、私は、次のコードを試してみました
関連する問題