[PM-27138] feat: Add credit card input form to Test Harness#2744
[PM-27138] feat: Add credit card input form to Test Harness#2744morganzellers-bw wants to merge 11 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2744 +/- ##
==========================================
- Coverage 87.85% 86.91% -0.95%
==========================================
Files 1712 1896 +184
Lines 166702 179803 +13101
==========================================
+ Hits 146463 156273 +9810
- Misses 20239 23530 +3291 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude Code is reviewing this pull request... If this comment does not update with results, check the Actions log. |
fedemkr
left a comment
There was a problem hiding this comment.
🤔 Why do you need iOS 17 available for all Card form related stuff?
| "CardholderNameValue" = "Cardholder Name: %@"; | ||
| "CardNumber" = "Card Number"; | ||
| "CardNumberValue" = "Card Number: %@"; | ||
| "EnterCardDetailsAbove" = "Enter card details above"; | ||
| "ExpirationMonth" = "Expiration Month"; | ||
| "ExpirationMonthValue" = "Expiration Month: %@"; | ||
| "ExpirationYear" = "Expiration Year"; | ||
| "ExpirationYearValue" = "Expiration Year: %@"; | ||
| "SecurityCode" = "Security Code"; | ||
| "SecurityCodeValue" = "Security Code: %@"; |
There was a problem hiding this comment.
To follow how we name keys in other places we should replace the part of the parameter with X, Y, Z depending on the number of the parameters, e.g.:
CardholderNameValue -> CardholderNameX
There was a problem hiding this comment.
⛏️ @morganzellers-bw I see these were changed to a format like CardholderNameValueX instead of CardholderNameX. I would follow the same as we do in the other apps, and the reason that we don't add "value" is that because that's not part of the string value as if for some reason in the future we'd have "Cardholder name value: %@" as a string, the key would have already been used by this one. So in order to avoid this potential problem we just copy the same string value as the key with PascalCase (in this case omitting the colon) and add the X, Y, Z depending on the parameters.
There was a problem hiding this comment.
🤔 Why are these things that take variables at all, rather than just re-using the other localizations in situ?
So instead of View.text = Localizations.expirationYearX(year), it would be View.text = "\(Localizations.expirationYear): \(year)" or something to that effect?
(If we're concerned about order around colon for RTL languages and the like, I'd recommend a generic XColonY string)
There was a problem hiding this comment.
@KatherineInCode I like the approach of re-using the existing localizations, I'll make that update.
Thanks @fedemkr I understand, I'll make sure to keep the keys the same going forward!
There was a problem hiding this comment.
@KatherineInCode We can't use localizations in situ for RTL + because languages may use different characters for colon separator as in Chinese where it looks similar but it's different because of spacing.
I think XColonY is the right approach as well.
ff392a5 to
70781a6
Compare
| } | ||
| if !store.state.password.isEmpty { | ||
| Text(Localizations.passwordValue(String(repeating: "•", count: store.state.password.count))) | ||
| Text(Localizations.passwordValueX(store.state.password)) |
There was a problem hiding this comment.
Details and fix
On main, the displayed password was masked with bullet characters:
Text(Localizations.passwordValue(String(repeating: "•", count: store.state.password.count)))This PR (after the passwordValueX type-mismatch fix in PATCH 5) now passes the raw password directly:
Text(Localizations.passwordValueX(store.state.password))The PasswordValueX format string is "Password: %@", so the bullet-mask approach is still compatible. It looks like the fix to the earlier Int vs String mismatch unintentionally dropped the masking.
Suggested fix:
| Text(Localizations.passwordValueX(store.state.password)) | |
| Text(Localizations.passwordValueX(String(repeating: "•", count: store.state.password.count))) |
This restores the previous masking behavior. Even though this is the Test Harness, it's likely intentional to avoid displaying any password values in plain text on screen during recording / screen sharing of test runs.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-27138
📔 Objective
Add a credit card input form to the Test Harness app in order to test card autofill features.
📸 Screenshots