-
Notifications
You must be signed in to change notification settings - Fork 816
chore: configure automatic screenshots #2517
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
Conversation
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/12736000138/artifacts/2419155495 |
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 😭. |
14b9d85
to
8a2dba8
Compare
@adityastic I guess this is finally ready for a final review from your side and merging now. I just did some changes which I am not sure about, marking them in a review. |
@@ -16,17 +18,6 @@ jobs: | |||
- name: Download repository | |||
uses: actions/checkout@v4 | |||
|
|||
- name: Setup Ruby |
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.
Removed the Ruby
and Bundler
setup from the release pipeline as the Screenshots workflow is now a standalone workflow, that sets up all these inside it.
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
||
git clone --branch=fastlane --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane |
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.
Removed the fastlane branch cloning. This is again done inside the Screenshots workflow. We require all these in this workflow, however, I removed them as they are already set up inside the screenshots-android action.
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: