test

Run unit and instrumentation tests for Canvas Android apps via Gradle.

153|115|Updated Apr 3, 2019
One-click install
npx skills add https://github.com/instructure/canvas-android --skill test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test
Source: https://github.com/instructure/canvas-android/tree/main/apps/.claude/skills/test
Command: npx skills add https://github.com/instructure/canvas-android --skill test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you run unit tests, instrumentation tests, and Espresso UI tests for the Canvas Android apps (Student, Teacher, and Parent) directly from the repository root, accelerating quality assurance and ensuring reliable test results.

Core Features & Use Cases

  • Unit Tests: Run all unit tests or targeted tests for specific modules or apps.
  • Instrumentation/Espresso Tests: Execute UI tests on devices or emulators.
  • Test Patterns & Use Cases: Use patterns, rerun options, and standard commands to streamline testing in CI and local workflows.
  • Use Case: Quickly verify that a new feature passes both unit and UI tests before submitting a PR.

Quick Start

Student app - ./gradle/gradlew -p apps :student:testQaDebugUnitTest Teacher app - ./gradle/gradlew -p apps :teacher:testQaDebugUnitTest Parent app - ./gradle/gradlew -p apps :parent:testQaDebugUnitTest All apps - ./gradle/gradlew -p apps :student:testQaDebugUnitTest :teacher:testQaDebugUnitTest :parent:testQaDebugUnitTest

Frequently Asked Questions about test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run unit tests for Canvas Android apps?

Run unit tests using Gradle tasks from the repository root. For the Student app, use `./gradle/gradlew -p apps :student:testQaDebugUnitTest`; for Teacher, use `:teacher:testQaDebugUnitTest`; for Parent, use `:parent:testQaDebugUnitTest`. You can run all three apps' tests in a single command by chaining the tasks.

Can I run Espresso UI tests on Android emulators?

Yes, instrumentation and Espresso UI tests run on devices or emulators using the `connectedQaDebugAndroidTest` Gradle task. Execute from the repository root with `./gradle/gradlew -p apps :student:connectedQaDebugAndroidTest` (or substitute teacher/parent) to verify UI interactions.

What build variant do I need to run Canvas Android tests?

Select the qaDebug build variant before running tests. This variant is required for both unit tests and instrumentation tests across the Student, Teacher, and Parent apps, and must be active when executing Gradle test tasks.

How do I run specific tests instead of the entire suite?

Use the `--tests` flag with Gradle to target specific unit or instrumentation tests. Append `--tests [pattern]` to your Gradle command to filter which tests execute, reducing run time during development and debugging.

What's the difference between unit tests and instrumentation tests in Canvas Android?

Unit tests run locally without a device and verify business logic; instrumentation tests (Espresso) run on an emulator or device and verify UI behavior. Canvas Android provides both via separate Gradle tasks: `testQaDebugUnitTest` for units and `connectedQaDebugAndroidTest` for instrumentation.

Can I verify test results from the command line?

Yes, Gradle reports test results to the console and generates detailed reports after execution. Run Gradle test tasks from the repository root and check the output for pass/fail status; detailed reports are written to the build output directory.