Button.java
public class Button extends FrameLayout {
public Button(Context context, AttributeSet attrs) {
super(context, attrs);
TextView textView = new TextView(context);
textView.setText("Test");
}
}
layout.xml
<LinearLayout>
<com.Button id="button_1" />
<com.Button id="button_2" />
</LinearLayout>
Using Espresso, how to access the TextView
created in Button
, and verify its text?
onView(withId(R.id.button_1)<get_child>).check(matches(withText("Test")));
Aucun commentaire:
Enregistrer un commentaire