اختبار تطبيقك
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
توضّح هذه الصفحة مجموعة من الأدوات التي تساعدك في إنشاء اختبارات من استوديو Android أو سطر الأوامر
وضبطها وتنفيذها.
إذا كنت تريد معرفة المزيد عن أساسيات الاختبار وكيفية كتابة الاختبارات، يمكنك الاطّلاع على اختبار التطبيقات على Android.
هناك طرق مختلفة لإجراء اختباراتك وإعدادها:
الاختبار في "استوديو Android"
لتلبية احتياجات الاختبار الأساسية، يتضمن "استوديو Android" ميزات تساعدك
في إنشاء نتائج الاختبارات وتشغيلها وعرضها، وكل ذلك من بيئة تطوير البرامج (IDE). باستخدام Android Studio، يمكنك الإشارة إلى رمز المصدر للتطبيق والنقر عليه لإنشاء اختبارات وتنفيذها لفئات أو طرق معيّنة، واستخدام القوائم لضبط عدة أجهزة اختبار، والتفاعل مع نافذة أداة مصفوفة الاختبار لعرض نتائج الاختبار. للحصول على مزيد من المعلومات حول طريقة استخدام "استوديو Android" لإنشاء
الاختبارات وإدارتها، يُرجى الاطّلاع على
الاختبار في "استوديو Android".
إجراء اختبارات من سطر الأوامر
للحصول على مزيد من عناصر التحكم الأكثر دقة، يمكنك إجراء اختبارات من سطر الأوامر.
يوفر اختبار سطر الأوامر طريقة مباشرة لاستهداف الوحدات أو إنشاء صِيَغ بشكل فردي أو في تركيبات. يتيح إجراء الاختبارات من خلال هيكل Android Debug Bridge (adb) إمكانية تخصيص أكبر قدر من التخصيص بشأن الاختبارات التي تريد تنفيذها.
ويكون إجراء الاختبارات من سطر الأوامر مفيدًا أيضًا في نظام الدمج المستمر.
لمزيد من المعلومات، يُرجى الاطّلاع على
الاختبار من سطر الأوامر.
الاختبار المتقدم
بالنسبة إلى احتياجات الاختبار المتقدمة، قد تحتاج إلى إلغاء الإعدادات التلقائية
أو ضبط خيارات Gradle أو إعادة ضبط الرمز البرمجي ليتم فصل الاختبارات في
وحدتها الخاصة. لمزيد من المعلومات عن كيفية ضبط إعدادات الاختبار لحالات الاستخدام الخاصة، يُرجى الاطّلاع على إعداد الاختبار المتقدم.
لاختبار سلوك تطبيقك عندما يتفاعل المستخدم معه، يمكنك استخدام أدوات مثل Espresso Test Recorder أو App Crawler أو UI Automator أو Monkey Testing.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2023-09-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2023-09-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Test your app\n\nThis page describes various tools that help you create, configure, and\nrun your tests from Android Studio or the command line.\n\nIf you want to learn more about the fundamentals of testing and how to write\ntests, see [Test apps on Android](/training/testing).\n\nThere are different ways to run and configure your tests:\n\n- **Test in Android Studio**\n\n For basic testing needs, Android Studio includes features that help you\n create, run, and view results of tests all from the IDE. Using Android Studio,\n you can point and click in the app source code to create and run tests for\n specific classes or methods, use menus to configure multiple test\n devices, and interact with the Test Matrix tool window to visualize test\n results. For more information on how to use Android Studio to create and\n manage your tests, see\n [Test in Android Studio](/studio/test/test-in-android-studio).\n- **Run tests from the command line**\n\n For more fine-grained control, you can run tests from the command line.\n Command-line testing provides a straightforward way to target modules or\n build variants individually or in combinations. Running tests through the\n Android Debug Bridge (adb) shell allows for the most customization in terms of\n which tests you want to run.\n\n Running tests from the command line is also useful on a [continuous\n integration system](/studio/projects/continuous-integration).\n\n For more information, see\n [Test from the command line](/studio/test/command-line).\n- **Advanced testing**\n\n For advanced testing needs, you may want to override default settings,\n configure Gradle options, or refactor your code so that tests are separated in\n their own module. For more information about how to set up your test\n configurations for special use cases, see [Advanced test\n setup](/studio/test/advanced-test-setup).\n\n To test how your app behaves when your user interacts with it, you can use\n tools such as [Espresso Test\n Recorder](/studio/test/other-testing-tools/espresso-test-recorder),\n [App Crawler](/studio/test/other-testing-tools/app-crawler),\n [UI Automator](/training/testing/other-components/ui-automator), or\n [Monkey testing](/studio/test/other-testing-tools/monkey)."]]