android-espresso

    0熱度

    2回答

    我正在爲我的應用程序寫一個Espresso測試,並試圖在我的應用程序中打開相機後自動點擊快門按鈕。 我在Android模擬器中使用Espresso和UIAutomator。我設法在UIAutomatorViewer中轉儲這個UI。 我想不通爲什麼我無法點擊使用UIAutomator使用此代碼快門按鈕: public void clickCameraShutterButton() throws Ui

    0熱度

    1回答

    我的問題: 我目前的單元測試「onClickSkipButtonAndVerifyAppExists」失敗,因爲我不能點擊跳過按鈕是include佈局=「@ layout/navigation_bar」。它的佈局基本上是左側的跳過按鈕和右側的下一個按鈕。我懷疑它之所以失敗,是因爲它無法點擊包含標籤中的視圖。 我有以下情形: @RunWith(AndroidJUnit4.class) @Large

    1熱度

    2回答

    我想在Android上編寫一個Expresso測試來驗證TextView內容。 當我讀從資源文本如下它的工作原理 @Test public void changeText_newActivity() { onView(withId(R.id.mainContent)).check(matches(withText("Hello World!"))); } 以上是用咖啡

    0熱度

    2回答

    我正在爲我的應用程序編寫測試用例,但是遇到了一些小問題。我的許多測試用例中都有SystemClock.Sleep調用,以便視圖加載所有數據並將其顯示在屏幕上。然而,睡眠的次數越來越多,導致這些測試的時間更長。 下面是這些測試 @Test public void testSearch() { ExtensionForExpresso.signUp(); SystemCloc

    0熱度

    1回答

    目標是測試外部應用運行意圖。當此測試用例通過所有下一個測試用例時失敗,因爲測試用例完成後外部應用程序未關閉。我的測試是這樣的: public class MarketIntentCase { private ActivityTestRule<SomeActivity> activityTestRule = new ActivityTestRule<>(SomeActivity.class, t

    1熱度

    1回答

    我是新來的Android儀器測試。我想檢查我的註冊活動是否與Espresso正常工作。 我試圖運行它與打算和意圖了。似乎沒有工作。 以下是我的代碼: package com.varun.project; import android.content.Context; import android.support.test.InstrumentationRegistry; import an

    1熱度

    1回答

    由於我在註冊屏幕上有幾個字段,並且對空字段使用了相同的字符串資源,我怎樣才能解決這個錯誤? com.som.android.acceptanceTests.signIn.RegistrationScreenTest > startRegistrationWithEmptyFields[emu_19_WXGA720(AVD) - 5.0.2] FAILED android.support.test

    5熱度

    2回答

    使用Kotin android extensions我可以避免使用findViewById,但 我不知道如何命名ID來使用它的屬性。 我發現了兩個選項: 使用IDS 簡單的名稱,但然後我可以在咖啡遇到麻煩,如果我與片段使用它: android.support .test.espresso.AmbiguousViewMatcherException:'與id:.../mainLayout'匹配層次結

    4熱度

    2回答

    使用AndroidInjector和Subcomponents不可能將活動範圍對象注入Espresso的Test類。 以前使用應用程序級組件和活動組件時,只要您創建一個繼承活動組件的測試組件,就可以爲不屬於活動的測試類調用inject()。 實施例: 活性成分 @ActivityScope @Component( dependencies = ApplicationComponent.c

    1熱度

    2回答

    我想測試與Espresso Android測試框架,所有預期的標題顯示在ListView中。 我有活動ListView顯示目錄中的文件。每個ListView項是Item對象: /** * Item */ static class Item { private String title; private IFileInfo fileInfo; private in