קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Firebase Test Lab מספק תשתית מבוססת-ענן לבדיקת אפליקציות ל-Android. במאמר הזה נסביר איך מתחילים להשתמש ב-Test Lab באמצעות מסוף Firebase.
באמצעות Test Lab אפשר להריץ את סוגי הבדיקות הבאים:
בדיקת מכשור:
בדיקה שכותבים כדי להפעיל את ממשק המשתמש של האפליקציה באמצעות הפעולות שמציינים. בנוסף, בדיקת מכשור יכולה להצהיר באופן מפורש על מצב האפליקציה כדי לאמת את הפונקציונליות הנכונה באמצעות AndroidJUnitRunnerAPIs. Test Lab תומך ב-Espresso וב-UI Automator, שהם frameworks של בדיקות מכשור.
בדיקת רובוט:
בדיקה שמנתחת את הממשק של האפליקציה ואז בוחנת אותו באופן אוטומטי
על ידי סימול של פעילויות משתמשים.
בדיקת לולאת משחק: בדיקה שמשתמשת ב'מצב הדגמה' כדי לדמות פעולות של שחקנים באפליקציות משחקים.
אם עדיין לא עשיתם זאת, עוברים אל Firebase המסוף ויוצרים פרויקט חדש ב-Firebase.
שלב 2. הרצת בדיקה
בדיקת אינסטרומנטציה
בסרגל הניווט של מסוף Firebase, לוחצים על Test Lab ואז על Get Started -> Run an Instrumentation test (תחילת העבודה -> הפעלת בדיקת מכשור).
לוחצים על עיון, ואז מעיינים ב-APK או ב-AAB של האפליקציה וב-APK או ב-AAB של הבדיקה לפני שלוחצים על המשך.
מגדירים את מטריצת הבדיקה על ידי בחירת המכשירים, רמות ה-API של Android, כיווני המסך והלוקאלים שרוצים לבדוק את האפליקציה בהם. אפשר לבחור רק את השילובים של מכשירים ורמת Android API שרוצים לטרגט לבדיקה.
(אופציונלי) לוחצים על הצגת אפשרויות מתקדמות כדי לשנות את הזמן הקצוב לתפוגה של הבדיקה, שקובע את משך הזמן המקסימלי של כל הרצה של הבדיקה.
(אופציונלי) כדי שיהיה לכם קל יותר לזהות את מטריצות הבדיקה ולמצוא אותן במסוף Firebase, אתם יכולים להוסיף תווית למטריצת הבדיקה. לשם כך, מזינים שם תווית בשדה תווית מטריצת הבדיקה (אופציונלי).
לוחצים על התחלת N בדיקות, כאשר N הוא מספר ההגדרות התקינות של הבדיקות ממטריצת הבדיקות שהגדרתם במסך הזה. כל בדיקה בהמתנה מוצגת עם סמל של שעון כחול בזמן ההמתנה להפעלה, והסמל הזה משתנה לסמל של וי ירוק כשהבדיקה מסתיימת.
אחרי שכל בדיקה מסתיימת, לוחצים על המכשיר שמופיע בעמודה Test Execution (ביצוע הבדיקה) כדי לראות את תוצאות הבדיקה, כולל תרחישי בדיקה, יומנים, צילומי מסך וסרטונים.
בדיקת Robo
בסרגל הניווט של Firebase console, לוחצים על Test Lab ואז על Get Started -> Run a Robo test.
לוחצים על עיון, עוברים אל קובץ ה-APK של האפליקציה ולוחצים על המשך.
מגדירים את מטריצת הבדיקה על ידי בחירת המכשירים, רמות ה-API של Android, כיווני המסך והלוקאלים שרוצים לבדוק את האפליקציה בהם.
(אופציונלי) לוחצים על הצגת אפשרויות מתקדמות כדי לשנות את האפשרויות הבאות:
הזמן הקצוב לתפוגה של הבדיקה קובע את משך הזמן המקסימלי של כל הרצה של בדיקה.
פרטי הכניסה לחשבון הבדיקה משמשים למתן פרטי כניסה לחשבון בדיקה.
שדות נוספים משמשים להזנת טקסט בשדות טקסט אחרים באפליקציה.
(אופציונלי) כדי שיהיה לכם קל יותר לזהות את מטריצות הבדיקה ולמצוא אותן במסוף Firebase, אתם יכולים להוסיף תווית למטריצת הבדיקה. לשם כך, מזינים שם תווית בשדה תווית מטריצת הבדיקה (אופציונלי).
לוחצים על התחלת N בדיקות, כאשר N הוא מספר ההגדרות התקינות של הבדיקות ממטריצת הבדיקות שהגדרתם במסך הזה. לצד כל בדיקה בהמתנה מוצג סמל של שעון כחול בזמן ההמתנה להפעלה, והסמל הזה משתנה לסימן וי ירוק כשהבדיקה מסתיימת.
אחרי שכל בדיקה מסתיימת, לוחצים על המכשיר שמופיע בעמודה Test Execution (ביצוע הבדיקה) כדי לראות את תוצאות הבדיקה, כולל תרחישי בדיקה, יומנים, צילומי מסך וסרטונים.
בדף Test Lab של מסוף Firebase, לוחצים על Run Your First Test > Run an Android Game Loop (הפעלת הבדיקה הראשונה > הפעלת לולאת משחק ב-Android).
בקטע העלאת אפליקציה, לוחצים על עיון ואז בוחרים את קובץ ה-APK של האפליקציה (אם עדיין לא עשיתם זאת, צריך ליצור קובץ APK לאפליקציה).
(אופציונלי) כדי שיהיה לכם קל יותר לזהות את מטריצות הבדיקה ולמצוא אותן במסוף Firebase, אתם יכולים להוסיף תווית למטריצת הבדיקה. לשם כך, מזינים שם תווית בשדה תווית מטריצת הבדיקה (אופציונלי).
(אופציונלי) אם רוצים להריץ כמה לולאות או תרחישים בו-זמנית, או לבחור לולאות ספציפיות להרצה, מזינים את מספרי הלולאות בשדה תרחישים.
לדוגמה, אם מזינים את הערך 1-3, 5, הפונקציה Test Lab תפעיל את הלולאות 1, 2, 3 ו-5.
כברירת מחדל (אם לא מזינים כלום בשדה תרחישים), הפקודה Test Lab מריצה רק את לולאה 1.
בקטע מכשירים, בוחרים מכשיר פיזי אחד או יותר שרוצים לבדוק עליו את האפליקציה, ואז לוחצים על התחלת הבדיקות.
שלב 3. בדיקת תוצאות הבדיקה
כשהמבחן מתחיל, המערכת מפנה אתכם אוטומטית לדף התוצאות של המבחן.
הבדיקות יכולות להימשך כמה דקות, בהתאם למספר התצורות השונות שבחרתם ולמשך הזמן הקצוב לבדיקה שהגדרתם. אחרי שהבדיקות יסתיימו, תוכלו לעיין בתוצאות הבדיקות. במאמר ניתוח תוצאות של Firebase Test Lab מוסבר איך לפרש את תוצאות הבדיקה.
[null,null,["עדכון אחרון: 2025-08-16 (שעון UTC)."],[],[],null,["\u003cbr /\u003e\n\nFirebase Test Lab provides cloud-based infrastructure for testing\nAndroid apps. This document describes how to get started with Test Lab using the\nFirebase console.\n\nTest Lab lets you run the following types of tests:\n\n- [Instrumentation test](/docs/test-lab/android/instrumentation-test):\n A test you write that allows you to drive the UI of your app with the actions\n you specify. An instrumentation test can also make explicit assertions about\n the state of your app to verify correct functionality using\n [AndroidJUnitRunnerAPIs](https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner). Test Lab supports\n [Espresso](https://developer.android.com/training/testing/espresso)\n and\n [UI Automator](https://developer.android.com/training/testing/other-components/ui-automator) instrumentation test frameworks.\n\n- [Robo test](/docs/test-lab/android/robo-ux-test):\n A test that analyzes your app's interface and then explores it automatically\n by simulating user activities.\n\n- [Game loop test](/docs/test-lab/android/game-loop): A test\n that uses a \"demo mode\" to simulate player actions in game apps.\n\nBefore you begin\n\nYour Firebase project must be on the [pay-as-you-go Blaze pricing plan](/pricing), which means that\nyour project is linked to a Cloud Billing account. You can\n[upgrade to the Blaze pricing plan](//console.firebase.google.com/project/_/overview?purchaseBillingPlan=metered)\nin the Firebase console. You need to be an Owner or Editor for your project\nto link a Cloud Billing account.\n\nStep 1. Create a Firebase project\n\nIf you haven't yet, go to the [Firebase console](https://console.firebase.google.com/)\nand create a new Firebase project.\n| **Note:** If you're working on a shared Firebase project, you'll need to have ownership or edit permissions for the project.\n\nStep 2. Run a test \n\nInstrumentation test**Note:** If you want to run an instrumentation test with [Android Test Orchestrator](https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator), see [Enable Orchestrator](/docs/test-lab/android/instrumentation-test#orchestrator).\n\n1. On the [Firebase console](https://g.co/firebase) navigation bar,\n click **Test Lab** , and then click **Get Started -\\\u003e Run an Instrumentation\n test**.\n\n2. Click **Browse** , and then browse to your app APK or AAB and test APK or\n AAB before clicking **Continue**.\n\n3. Define your test matrix by selecting which devices, Android API levels,\n screen orientations and locales you want to test your app against. You can\n select only those device and Android API level combinations that you want\n to target for testing.\n\n4. (Optional) Click **Show advanced options** to change the Test timeout\n that determines the maximum duration of each test execution.\n\n5. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering a\n label name in the **Test matrix label (optional)** field.\n\n6. Click **Start *N* Tests**, where \"N\" is the number of valid test\n configurations from the test matrix that you define on this screen. Each\n pending test is shown with a blue clock icon while it is waiting to run,\n and that icon changes to a green check icon when the test has completed.\n\n7. After each test has run, click the device listed in the Test Execution\n column to see test results, including test cases, logs, screenshots and\n videos.\n\nRobo test\n\n1. On the [Firebase console](https://g.co/firebase) navigation bar,\n click **Test Lab** , and then click **Get Started -\\\u003e Run a Robo test**.\n\n2. Click **Browse** , browse to your app APK, and then click **Continue**.\n\n3. Define your test matrix by selecting which devices, Android API levels,\n screen orientations and locales you want to test your app against.\n\n4. (Optional) Click **Show advanced options** to change the following options:\n\n - Test timeout determines the maximum duration of each test execution.\n - Test account credentials are usedis used to provide credentials for a test account.\n\n | **Caution:** Never use this option with real user accounts.\n - Additional fields are used to provide text input for other text fields in your app.\n\n | **Note:** To learn more about Test account credentials and additional fields, see [Test account sign-in and predefined text](/docs/test-lab/robo-ux-test#test_account_sign-in_and_predefined_text_input).\n5. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering\n a label name in the **Test matrix label (optional)** field.\n\n6. Click **Start *N* Tests**, where \"N\" is the number of valid test\n configurations from the test matrix that you define on this screen. Each\n pending test is shown with a blue clock icon while it is waiting to run,\n and that icon changes to a green check when the test has completed.\n\n7. After each test finishes running, click the device listed in the Test\n Execution column to see test results, including test cases, logs,\n screenshots and videos.\n\nIf you want to create a script to guide the Robo test, see\n[Record a Robo script using Test Lab in Android Studio](/docs/test-lab/android/run-robo-scripts#record-android-studio).\n\nGame Loop test\n\n1. On the Test Lab page of the [Firebase console](https://console.firebase.google.com/project/_/%0Atestlab), click **Run Your First Test \\\u003e Run an Android Game Loop**.\n\n2. In the **Upload App** section, click **Browse** , then select your app's\n APK file (if you haven't already, [generate an APK file](https://firebase.google.com/docs/test-lab/android/game-loop#run-testlab) for your app).\n\n3. (Optional) To help you identify and locate your test matrices in the\n Firebase console, you can add a label to your test matrix by entering\n a label name in the **Test matrix label (optional)** field.\n\n4. (Optional) If you want to run multiple loops or scenarios at a time, or\n select specific loops to run, enter the loop numbers in the\n **Scenarios** field.\n\n For example, when you enter \"1-3, 5\", Test Lab runs loops 1, 2, 3, and 5.\n By default (if you don't enter anything in the **Scenarios** field),\n Test Lab only runs loop 1.\n5. In the **Devices** section, select one or more physical devices you\n want to test your app on, then click **Start Tests**.\n\nStep 3. Investigate your test results\n\nWhen the test starts, you're automatically redirected to the test results page.\nTests can take a number of minutes to run, depending on the number of different\nconfigurations you have selected and the test timeout duration set for your\ntests. After your tests have run, you can review test results. See\n[Analyzing Firebase Test Lab Results](/docs/test-lab/android/analyzing-results) to learn more\nabout how to interpret the test results.\n| **Note:** For all test types, any uncaught exception will cause a test failure."]]