cost 87 ms
如何從 Android 測試訪問應用程序覆蓋 windows?

[英]How to access application overlay windows from Android tests?

我正在處理的應用程序有一個應用程序覆蓋 window 作為浮動按鈕實現。 它的類型定義為: 問題是我無法從我的測試中訪問這個 window。 既不是來自 Espresso: 或來自儀器測試: 我想在我的測試中模擬一個簡單的按鈕按下。 問題是我的代碼找不到包含這些代碼片段的視圖並且失敗了。 ...

如何迭代 Android Jetpack Compose UI 測試中的元素(節點)列表?

[英]How to iterate over an element (node) list on Android Jetpack Compose UI Tests?

我正在使用 Jetpack Compose 測試庫實施一些插樁測試。 我還不太熟悉 Kotlin / Android 開發,但我有多年使用 Selenium 和其他測試庫的經驗,所以我缺少一些基本的東西,也不知道如何實現它們。 我想做的事: 遍歷元素(節點)列表。 我有這個列表,所有項目都由相同的 ...

Android Studio 找不到插樁測試

[英]Android Studio can not find instrumented tests

我有一個具有兩種風格版本(專業版和輕型版)的應用程序,我想運行儀器測試。 所以我添加了兩個額外的目錄 androidTestLight 和 androidTestPro(有三個測試文件夾 androidTest、androidTestLight、androidTestPro)。 當我嘗試運行一個簡單 ...

Android studio Instrumented Test 停留在:Task:app:connectedDebugAndroidTest

[英]Android studio Instrumented Test stuck at: Task :app:connectedDebugAndroidTest

我遇到一個問題,當我嘗試運行 Android Instrument 測試時,android studio 將開始構建,一切都很好,直到它卡在這一行 “> 任務:應用程序:connectedDebugAndroidTest” 並在接下來的 2 小時內運行,並且永遠不會進行實際測試。 我所看到的 ...

如何在儀器測試 android 中獲得生命周期所有者?

[英]How to get lifecycle owner in instrumented test android?

我有查看 model 可以通過這樣的代碼提供: 我想測試我的視圖模型請求等等。 由於我的測試需要上下文,我決定使用儀器測試,我可以通過這樣的行獲取上下文: 我遇到的問題與在測試中獲取生命周期所有者有關。 ViewModelProvider有這樣的構造函數: 和: 它們非常相似。 但是我如何在我的 ...

使用自定義初始化程序和 Hilt 測試 WorkManager

[英]Testing WorkManager with custom initializer and Hilt

我正在嘗試為使用 Hilt 的 @AssistedInject 的自定義工作管理器實施儀器化測試。 我的工作管理器在應用程序中表現完美,但是當我嘗試根據Google 的工作管理器集成測試指南對其進行測試時,出現錯誤: WM-WorkerFactory:java.lang.NoSuchMethod ...

Android 儀器測試 - 重新創建的活動未發現區域設置更改,API <33

[英]Android instrumented tests - Recreated Activity not picking up locale change, API <33

至少,它沒有達到我的預期。 這是我的情況—— 我正在編寫一個允許用戶在運行時更改語言環境的功能。 無需任何特殊處理,區域設置更改將自動重新創建活動並在刷新的頁面中使用更新的資源 - 即,字符串資源將換出到不同的區域設置。 這是我目前想要的行為。 我正在嘗試編寫一個儀器化的單元測試來模擬和確認這種行 ...

在為 Android 運行儀器測試時如何訪問測試設備的文件

[英]How do you get access to a testing device's files when running instrumentation tests for Android

我已經設置了一個物理設備,其中包含可以通過 MediaStore 檢索的文件。 我的目標是在儀器測試中通過 MediaStore 檢索這些文件。 目前,當我將調試應用程序推送到設備並手動測試時,會找到設備文件。 問題是當我運行儀器測試時,我從 MediaStore 中一無所獲。 有沒有辦法在儀器測試 ...

Java ProcessBuilder 不在主機設備上啟動進程以進行儀表測試,而是在模擬器上

[英]Java ProcessBuilder starts process not on the host device for instrumented tests, but on emulator

我正在嘗試為 Android 編寫儀表化的 UI 測試,這將能夠測試諸如“當沒有可用的互聯網連接時顯示此按鈕”之類的情況。 對於我使用 Espresso 的所有 UI 內容,但您可以猜到它不提供操作設備設置的功能。 我真的很希望能夠打開和關閉諸如 Wifi 和飛行模式之類的設置,但是我能找到的關於以 ...

將 testInstrumentationRunner 與派生自編譯時不可用的類的運行器交換

[英]Exchange testInstrumentationRunner with a runner derived from class not available at compile time

我想使用自定義testInstrumentationRunner來覆蓋newInstance方法,以便使用自定義應用程序: 實際上需要該應用程序才能使測試執行工作(因為它在啟動時跳過了一些 GDPR 對話框等): 如您所見,我需要從AllureAndroidJUnitRunner TestJ ...

嘗試設置 Instrumented 測試時出現 ComponentActivity ClassNotFoundException,使用 Android Compose 和 Hilt

[英]ComponentActivity ClassNotFoundException when trying to setup Instrumented tests, with Android Compose and Hilt

我正在設置我的第一個檢測單元測試,並在 logcat 中遇到了一個不明原因的崩潰。 模擬器啟動並在應用程序嘗試打開時立即崩潰,並且單元測試甚至沒有運行,因為應用程序不在正確的位置 state。 它似乎正在尋找在以下 gradle 依賴項中定義的 androidx.activity.Componen ...

context.startActivity 不適用於 UiAutomator 中的單個應用程序

[英]context.startActivity not working for a single app in UiAutomator

我正在嘗試使用 UiAutomator 使用以下代碼啟動第 3 方應用程序: Intent 沒問題,它適用於例如 Google Play,但不適用於我要啟動的另一個應用程序(我不能透露)。 更重要的是, adb shell am start -n package/Class有效,但是Runt ...

有什么解決方案可以解決android上的儀器測試

[英]is there any solution to solve instrumented test on android

我正在嘗試使用測試實驗室在 android studio 上執行instrumented test ,我的項目是使用react native開發並導入到 android studio 的,我使用espresso記錄了測試用例。 整個過程與: 我已經嘗試過這些步驟: 停止所有正在運行的進程 ...

如何在 Jetpack Compose 中使用 Rotation Change 測試 rememberSaveable

[英]How to test rememberSaveable with Rotation Change in Jetpack Compose

我正在使用 Android Studio 北極狐,並嘗試測試使用 rememberSaveable 存儲的變量的行為。 我通過在模擬器中執行“向左旋轉”手動進行了測試。 那里的行為與預期的一樣:使用remember存儲的值消失了。 使用rememberSaveable存儲的值仍然可用。 現在我想擺脫 ...

測試文本是否被划線

[英]Test if text has been struck through

在 Android 檢測測試中,我想檢查在選擇復選框時,該復選框是否將Paint.STRIKE_THRU_TEXT_FLAG繪制標志應用於文本。 有沒有辦法檢查文本的油漆標志? 正在測試的代碼是: ...

如何模擬 SQLiteOpenHelper

[英]How to mock an SQLiteOpenHelper

我試圖在檢測測試中模擬 SQLiteOpenHelper 類,因此每當任何片段嘗試從數據庫獲取信息時,它都會返回一個通用結果。 但是,我不斷收到錯誤消息: org.mockito.exceptions.base.MockitoException:無法模擬/監視類 com.example.cl ...

“com.android.test”模塊“:app”和“:dynamicfeature”均失敗,“Collection has more than one element.”:“testedApplicationId”

[英]"com.android.test" module for both ":app" and ":dynamicfeature" failing with "Collection has more than one element." : "testedApplicationId"

我嘗試(在示例應用程序中)讓一個“ :test ”模塊測試主模塊“ :app ”和“ :dynamicfeature ”模塊。 為此,我使用了“com.android.test”gradle 插件。 我的“ :app ”模塊運行得很好。 它從我的“ :dynamicmodule ”實例化了一個基本 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM