-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Simplify providing e2e tests credentials #22467
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
These values are not secret, so we don't need a `defaults.properties` / `secrets.properties` setup for them. This way, we keep our `BuildConfig` tidy.
Which removes e2e "secrets" (they were identical to the values specified in `defaults.properties`)
|
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22467-4591a35 | |
| Commit | 4591a35 | |
| Direct Download | jetpack-prototype-build-pr22467-4591a35.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22467-4591a35 | |
| Commit | 4591a35 | |
| Direct Download | wordpress-prototype-build-pr22467-4591a35.apk |
|
Claude finished @adalpari's task in 1m 40s —— View job Code Review Completed ✓I've reviewed the PR changes that simplify E2E test credential management by moving them from build configuration to a dedicated Kotlin object. Here's my comprehensive feedback: ✅ Positive Aspects
🔍 Code Quality ObservationsWordPress/src/androidTest/java/org/wordpress/android/support/E2ECredentials.kt:4-18Minor: Consider adding KDoc comments While the constant names are self-documenting, adding a brief KDoc comment to the object would improve discoverability and explain the purpose: /**
* Centralized container for E2E test credentials.
* These are non-secret, mock credentials used exclusively for automated testing.
*/
object E2ECredentials {
// ...
}WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt:51-54Observation: Hardcoded credentials in confirmLogin() The Current code: if (WPSupportUtils.atLeastOneElementWithIdIsDisplayed(LoginR.id.login_password_row)) {
enterUsernameAndPassword(
E2ECredentials.WP_COM_USER_USERNAME,
E2ECredentials.WP_COM_USER_PASSWORD
)
}This isn't introduced by your PR (pre-existing pattern), but worth noting as it could cause issues if self-hosted tests hit this code path. WordPress/src/androidTest/java/org/wordpress/android/e2e/flows/LoginFlow.kt:108-117Minor: Inconsistent string formatting The WPSupportUtils.populateTextField(
usernameElement, """
$username
""".trimIndent()
)This pattern seems unusual. If the extra whitespace is intentional for UI interaction, consider adding a comment explaining why. If not, this could be simplified to just 🎯 Testing & DocumentationPR Description Accuracy: The testing instructions are appropriate given that E2E tests are not currently being run for this project. The suggestion to check Test Coverage: All existing E2E test files have been properly updated:
🔒 Security AssessmentNo Security Concerns: The credentials being moved are clearly mock/test credentials:
These are non-functional credentials intended solely for test scaffolding. Moving them out of the build configuration is the correct decision. ⚡ Performance & ArchitectureNo Performance Impact: This change is purely organizational and has zero runtime impact since E2E tests are compiled into test APKs only. Architecture: The approach aligns well with Android testing best practices by:
📋 Suggestions Summary
✅ Final VerdictThis PR successfully achieves its stated goals:
Recommendation: Approve and merge. The suggestions above are minor enhancements that could be addressed in follow-up work if desired, but should not block this PR. |
adalpari
left a comment
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.
LGTM and I dono't see any concern in Claude's review either. So ![]()





Related: AINFRA-1703: E2E test site credentials leak (there was no leak in this project)
Description
This PR simplifies how we pass credentials for e2e tests. As these are not secrets, we don't need to juggle with
secrets.propertiesanddefault.properties. This is for:Testing instructions
As we decided to not use e2e tests for this project for now, we don't need to actually run any tests. You can clean-build the app, e.g.
./gradlew clean assembleWordpressWasabiDebugand browse generated
BuildConfig.javafile - it shouldn't have anyE2Ecredentials.