Skip to content

[PM-27138] feat: Add credit card input form to Test Harness#2744

Open
morganzellers-bw wants to merge 11 commits into
mainfrom
pm-27138-testharness-card-form
Open

[PM-27138] feat: Add credit card input form to Test Harness#2744
morganzellers-bw wants to merge 11 commits into
mainfrom
pm-27138-testharness-card-form

Conversation

@morganzellers-bw
Copy link
Copy Markdown
Contributor

@morganzellers-bw morganzellers-bw commented Jun 2, 2026

🎟️ 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

Simulator Screenshot - iPhone 17 Pro - 2026-06-02 at 15 06 18

@morganzellers-bw morganzellers-bw self-assigned this Jun 2, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:feature labels Jun 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.91%. Comparing base (89c925a) to head (bfb7d37).
⚠️ Report is 7 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@morganzellers-bw morganzellers-bw added the hold This shouldn't be merged yet label Jun 2, 2026
@morganzellers-bw morganzellers-bw marked this pull request as ready for review June 2, 2026 22:20
@morganzellers-bw morganzellers-bw requested review from a team and matt-livefront as code owners June 2, 2026 22:20
@morganzellers-bw morganzellers-bw added ai-review Request a Claude code review and removed hold This shouldn't be merged yet app:password-manager Bitwarden Password Manager app context labels Jun 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Claude Code is reviewing this pull request...

If this comment does not update with results, check the Actions log.

Copy link
Copy Markdown
Member

@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Why do you need iOS 17 available for all Card form related stuff?

@github-actions github-actions Bot added the app:password-manager Bitwarden Password Manager app context label Jun 3, 2026
Comment on lines +5 to +14
"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: %@";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ @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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on XColonY

@morganzellers-bw morganzellers-bw force-pushed the pm-27138-testharness-card-form branch from ff392a5 to 70781a6 Compare June 4, 2026 19:18
Comment thread TestHarnessShared/UI/Autofill/SimpleLoginForm/SimpleLoginFormView.swift Outdated
@morganzellers-bw morganzellers-bw requested a review from fedemkr June 5, 2026 17:08
@morganzellers-bw morganzellers-bw enabled auto-merge (squash) June 5, 2026 17:14
@morganzellers-bw morganzellers-bw disabled auto-merge June 5, 2026 21:40
@morganzellers-bw morganzellers-bw added the hold This shouldn't be merged yet label Jun 8, 2026
}
if !store.state.password.isEmpty {
Text(Localizations.passwordValue(String(repeating: "•", count: store.state.password.count)))
Text(Localizations.passwordValueX(store.state.password))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ IMPORTANT: Password masking regression — raw password is now displayed in plain text.

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:

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context hold This shouldn't be merged yet t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants