मेरा परीक्षण है:Junit4 एंड्रॉयड TestField पाठ परीक्षण
@RunWith(AndroidJUnit4.class)
@LargeTest
public class TipActivityTests {
@Rule
public ActivityTestRule<TipActivity> mActivityRule = new ActivityTestRule<>(TipActivity.class);
@Test
public void initialValues() {
onView(withId(R.id.tip_label_base_price)).check(matches(ViewMatchers.withText("45"")));
}
}
लेकिन मैं त्रुटि 'with text: is "45"' doesn't match the selected view. Expected: with text: is "45"
मिलती है:
android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with text: is "45"' doesn't match the selected view.
Expected: with text: is "45"
Got: "AppCompatTextView{id=2131689669, res-name=tip_label_base_price, visibility=VISIBLE, width=266, height=106, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=141.0, y=96.0, text=$ 45.00, input-type=0, ime-target=false, has-links=false}"
यह dosen't मेरे लिए मतलब है, यह के वास्तविक मूल्य को मुद्रित नहीं करना चाहिए फ़ील्ड बनाम तुलना मूल्य?
हाँ, आप प्रिंट 'text = "real_text" में देख सकते हैं लेकिन यह भयानक है! – Caipivara