The Gallery App is an Android application designed to efficiently display images and videos stored on the device. It leverages modern Android components and libraries to ensure a smooth and optimized experience.
Before running the project or executing test cases, ensure you have the following installed:
- Android Emulator or Physical Device
To run the application in Android Studio:
- Open the project in Android Studio.
- Connect a physical device or launch an Android emulator.
- Click on Run ▶ or use the shortcut Shift + F10.
This project includes both Unit Tests and Instrumentation (UI) Tests.
To execute unit tests and generate a coverage report, run the following command in the terminal:
./gradlew testDebugUnitTestCoverageThis will run all unit tests and generate a coverage report in:
app/build/reports/jacoco/testDebugUnitTestCoverage/html/index.html
To generate a full Jacoco coverage report, run:
./gradlew jacocoTestReportThe HTML report will be available at:
app/build/reports/jacoco/jacocoTestReport/html/index.html
Open the index.html file in a browser to view the coverage details.
For UI tests (Espresso and instrumentation tests), execute:
./gradlew connectedCheckThis command will:
- Run all Espresso UI tests on a connected device or emulator.
- Generate a test coverage report in:
app/build/outputs/code-coverage/connected/
To view test coverage inside Android Studio:
- Run Tests with Coverage:
- Right-click on the test file/class and select Run 'Test with Coverage'.
- Open View → Tool Windows → Coverage to inspect the results.
- View Coverage Report in Browser:
- Navigate to
app/build/reports/jacoco/jacocoTestReport/html/index.html. - Open the file in a web browser to see detailed coverage.
- Navigate to
- Enable Code Coverage Highlighting:
- Open View → Tool Windows → Coverage.
- Click the ⚡ (Enable Code Coverage Highlighting) icon.
This guide provides the necessary steps to run tests, generate coverage reports, and view results in Android Studio. Following these steps ensures high-quality code with measurable test coverage. 🚀
For any issues, feel free to raise an issue in this repository!
Video is attach just for Demo perpose
