-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: configure automatic screenshots #2517
base: development
Are you sure you want to change the base?
Conversation
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/12560519973/artifacts/2374384911 |
Reviewer's Guide by SourceryThis pull request configures automatic screenshots for Android releases. It introduces a new ScreenshotsTest class for capturing screenshots using fastlane screengrab, adds necessary permissions to the AndroidManifest, implements a GitHub action to manage emulator creation and screenshot capture, and updates the release pipeline to integrate these changes. Sequence diagram for the automated screenshot capture processsequenceDiagram
participant GH as GitHub Actions
participant E as Android Emulator
participant A as Android App
participant F as Fastlane
GH->>E: Create/restore emulator from cache
GH->>E: Start emulator
GH->>A: Install app
GH->>A: Run ScreenshotsTest
loop For each screen
A->>A: Navigate to screen
A->>F: Capture screenshot
F->>F: Save screenshot
end
GH->>F: Process screenshots
GH->>GH: Update fastlane branch
Class diagram for the ScreenshotsTest implementationclassDiagram
class ScreenshotsTest {
-UiDevice mDevice
-String APP_PACKAGE_NAME
-int TIMEOUT
+setUp()
+testTakeScreenshot()
-getLauncherPackageName()
}
note for ScreenshotsTest "Uses @RunWith(AndroidJUnit4.class)
and @LargeTest annotations"
class Rules {
+LocaleTestRule localeTestRule
+ActivityScenarioRule mActivityScenarioRule
+GrantPermissionRule mGrantPermissionRule
}
ScreenshotsTest --> Rules
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AsCress - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider making the TIMEOUT value configurable or increasing it from 5000ms to avoid potential flakiness in CI environments
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
app/src/androidTest/java/io/pslab/activity/ScreenshotsTest.java
Outdated
Show resolved
Hide resolved
@adityastic It's after so long that I'm making this PR ready for review 😂. I must say, getting screenshots from CI emulators is the hardest thing 😭. |
Configures automatic screenshots in our pipelines.
Whenever a new release is made, new screenshots would automatically be captured in the release pipeline for upload to the Google PlayStore.
Changes
android.permission.DISABLE_KEYGUARD
,android.permission.WAKE_LOCK
,android.permission.CHANGE_CONFIGURATION
andandroid.permission.DUMP
.Screenshots / Recordings
Here, is a screen recording of the test:
Screen_recording_20240726_161336.mp4
Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.Summary by Sourcery
Configure automatic screenshots capturing on new releases. This automates the process of taking screenshots for the Google Play Store during the release pipeline.
CI:
Tests: