使用 Flutter 進行整合測試
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要使用 Firebase Test Lab 測試 Flutter 應用程式,您可以編寫 Flutter 整合測試、建構 Android APK 或 iOS 測試 zip 檔案,然後以一般 Android 儀器測試或 iOS XCTest 執行。
Flutter 整合測試類型
Flutter 支援三種測試:單元測試、小工具測試和整合測試。單元測試會驗證方法或類別的行為。
小工具測試會驗證 Flutter 小工具的行為,但不會執行應用程式本身。整合測試 (也稱為端對端測試或 GUI 測試) 會執行整個應用程式。
如要進一步瞭解整合測試,請參閱「Flutter 整合測試」。
編寫 Flutter 整合測試
如要瞭解如何編寫整合測試,請參閱 Flutter 整合測試說明文件的「專案設定」一節。您也可以按照「使用 Flutter 指令執行」一節的說明,在本機執行及驗證測試。
測試日期:Test Lab
Test Lab 可用於 Android 和 iOS 目標。
Android 設定
按照 README 檔案中「Android Device Testing」(Android 裝置測試) 一節的操作說明操作。
iOS 設定
按照 README 檔案中「iOS Device Testing」(iOS 裝置測試) 一節的指示操作。
支援 Robo 測試
Robo 測試不支援 Flutter。如要改善應用程式的檢索作業,請使用 Robo 指令碼,這類測試可自動執行行動應用程式的手動 QA 工作,並啟用持續整合 (CI) 和正式發布前測試策略。舉例來說,如要更精確且可靠地控管 Robo 行為,可以使用含有 visionText 的點擊。
分析測試結果
您可以將 Flutter 整合測試當做 Android 檢測設備測試或 iOS XCTest 執行。如要分析整合測試結果,請參閱 Android 和 iOS 的文件,視您的平台而定。
限制
無法取得個別測試案例的測試時間資訊,因此測試案例時間和個別測試案例影片等功能無法正常運作。
疑難排解
如果遇到問題,請查看公開問題追蹤器中的整合測試。
如果整合測試架構導致發生新問題,請按照「建立實用的錯誤報告」一文中的指引,在公開的 Issue Tracker 中回報新問題。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-16 (世界標準時間)。
[null,null,["上次更新時間:2025-08-16 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nTo test Flutter apps with Firebase Test Lab, you can write Flutter\nintegration tests, build Android APKs or iOS test zip files, and run as\nregular Android instrumentation tests or iOS XCTests.\n\nFlutter integration test types\n\nFlutter supports three types of tests: unit tests, widget tests, and\nintegration tests. A *unit test* verifies the behavior of a method or class.\nA *widget test* verifies the behavior of Flutter widgets without running the\napp itself. An *integration test*, also called end-to-end testing or GUI\ntesting, runs the full app.\n\nTo learn more about integration tests, see [Flutter integration testing](https://docs.flutter.dev/testing/integration-tests).\n\nWrite Flutter integration tests\n\nTo learn how to write integration tests, see the [project setup](https://docs.flutter.dev/testing/integration-tests#project-setup)\nsection of the Flutter integration tests documentation. Optionally, you can\nfollow [running using Flutter command](https://docs.flutter.dev/testing/integration-tests#running-using-the-flutter-command)\nto run and verify the tests locally.\n\nTest on Test Lab\n\nYou can use Test Lab with both Android and iOS targets.\n\nAndroid setup\n\nFollow the instructions in the\n[Android Device Testing](https://github.com/flutter/flutter/tree/main/packages/integration_test#android-device-testing)\nsection of the README.\n\niOS setup\n\nFollow the instructions in the\n[iOS Device Testing](https://github.com/flutter/flutter/tree/main/packages/integration_test#ios-device-testing)\nsection of the README.\n\nRobo test support\n\n[Robo tests](/docs/test-lab/android/robo-ux-test) do not natively support\nFlutter. To improve crawling of your app, use [Robo scripts](/docs/test-lab/android/run-robo-scripts),\nwhich are tests that automate manual QA tasks for mobile apps, and enable\ncontinuous integration (CI) and pre-launch testing strategies.\nFor example, to control Robo behavior in a more precise and robust way, you can\nuse clicks with [visionText](/docs/test-lab/android/robo-scripts-reference#click).\n\nAnalyze test results\n\nYou can run Flutter integration tests as an Android instrumentation test or an\niOS XCTest. To analyze the result of an integration test, see the\ndocumentation for [Android](https://firebase.google.com/docs/test-lab/android/analyzing-results)\nand [iOS](https://firebase.google.com/docs/test-lab/ios/analyzing-results),\ndepending on your platform.\n\nLimitations\n\nTest timing information for individual test cases is not available, which means\nthat features like test case duration and videos for individual test cases\ndon't work as expected.\n\nTroubleshooting\n\nIf you encounter issues, check the [public issue tracker for integration tests](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22f%3A+integration_test%22).\n\nIf you encounter a new issue caused by the integration test framework,\nfile a new issue in the public issue tracker following the guidance in\n[Creating useful bug reports](https://docs.flutter.dev/resources/bug-reports)."]]