Pp 2483 enable UI test files app simulators#1100
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make the BankSDK example app UI tests runnable on simulators by ensuring required PDF fixtures are available in the simulator’s Files app / app Documents container and by updating UI test navigation in the document picker.
Changes:
- Add a script + fixture folder documentation to place/copy required PDF test fixtures into the simulator app container.
- Update UI test “Files picker” navigation to reliably reach “On My iPhone → GiniBankSDKExample” and select a fixture.
- Add automatic fixture-copy logic in the UI test base class and adapt Skonto UI tests for optional review/analysis steps.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| BankSDK/GiniBankSDKExample/scripts/copy_test_fixtures.sh | New helper script to copy fixture PDFs into the booted simulator’s app Documents folder. |
| BankSDK/GiniBankSDKExample/TestFixturePDFs/README.md | Documents required (non-committed) fixture PDF names and how to copy them. |
| BankSDK/GiniBankSDKExample/TestFixturePDFs/.gitkeep | Keeps the fixture directory in git. |
| BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/Screens/MainScreen.swift | Adjusts Files picker navigation and selection flow; adds implicit “Open” tapping. |
| BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniSkontoScreenUITests.swift | Updates tests to rely on new picker navigation and handle optional review/analysis steps. |
| BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift | Adds fixture-copying into simulator app container during setUpWithError(). |
| .gitignore | Ignores local fixture PDFs so they aren’t committed. |
Comments suppressed due to low confidence (1)
BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift:41
app.launchArgumentsis assigned twice; the second assignment overwrites the first, so-testingis never passed to the app. Combine these into a single array (or append) so both-testingand-StartFromCleanState YESare provided.
copyFixturesToSimulator()
app = XCUIApplication()
app.launchArguments = ["-testing"]
app.launchArguments = ["-StartFromCleanState", "YES"]
app.launch()
| /// Copies all PDFs from TestFixturePDFs/ into every booted simulator's app Documents folder. | ||
| /// The UI test runner executes on the Mac host (not inside the simulator sandbox), so it has | ||
| /// full access to ~/Library/Developer/CoreSimulator/. We scan all booted simulators rather | ||
| /// than relying on SIMULATOR_UDID, which is not injected by Xcode into the test process. | ||
| /// Copies all PDFs from TestFixturePDFs/ into the tested app's Documents folder. | ||
| /// Xcode 15+ runs the test runner inside XCTestDevices, so NSHomeDirectory() returns: | ||
| /// .../XCTestDevices/{UDID}/data/Containers/Data/Application/{runner-UUID} | ||
| /// Going one level up reaches the shared Application/ directory where all app containers | ||
| /// for this test device live — including the tested app's container. |
| /// Copies all PDFs from TestFixturePDFs/ into every booted simulator's app Documents folder. | ||
| /// The UI test runner executes on the Mac host (not inside the simulator sandbox), so it has | ||
| /// full access to ~/Library/Developer/CoreSimulator/. We scan all booted simulators rather | ||
| /// than relying on SIMULATOR_UDID, which is not injected by Xcode into the test process. | ||
| /// Copies all PDFs from TestFixturePDFs/ into the tested app's Documents folder. | ||
| /// Xcode 15+ runs the test runner inside XCTestDevices, so NSHomeDirectory() returns: | ||
| /// .../XCTestDevices/{UDID}/data/Containers/Data/Application/{runner-UUID} | ||
| /// Going one level up reaches the shared Application/ directory where all app containers | ||
| /// for this test device live — including the tested app's container. |
| try? fileManager.createDirectory(at: docsURL, withIntermediateDirectories: true) | ||
| for pdf in pdfFiles { | ||
| let dest = docsURL.appendingPathComponent(pdf.lastPathComponent) | ||
| try? fileManager.copyItem(at: pdf, to: dest) |
|
|
||
| // After selecting a file from a folder in "On My iPhone", the document picker | ||
| // shows an "Open" button in the navigation bar to confirm the selection. | ||
| // Tap it here so callers do not need a separate openGalleryButton.tap() call. | ||
| let openButton = app.buttons["Open"].firstMatch | ||
| let openButtonDE = app.buttons["Öffnen"].firstMatch | ||
| if openButton.waitForExistence(timeout: 3) { | ||
| openButton.tap() | ||
| } else if openButtonDE.waitForExistence(timeout: 1) { | ||
| openButtonDE.tap() | ||
| } |
|
|
||
| if answer { | ||
| buttonToTap = allowFullAccess.exists ? allowFullAccess : allowFullAccessDE | ||
| /// Wait for the dialog to actually appear before checking which button is present. |
|
- Guard VoiceOver announcement in handleAmountFocusChange with !wasAlreadyInError so the error is announced exactly once when the Done button triggers two consecutive focus-lost calls - Pin picker width at exactly 96 pt in the default layout by setting minWidth == maxWidth == paymentProviderPickerSize.width, restoring the original fixed-width behaviour (only maxWidth was set before, allowing the picker to shrink below the intended size) - Update test comment to document the VoiceOver guard and its indirect verification via the hasError state HEAL-368 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eck exact localized string HEAL-368 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…me font size changes - Refactor FontProvider to compute UIFonts fresh on every font(for:) call using UIFontMetrics at call time instead of storing pre-scaled fonts in a static let dictionary. Fonts now always reflect the current Dynamic Type size. - Add TextFieldConfiguration.dynamicTextFont closure and resolvedTextFont computed property so GiniTextFieldStyle obtains a fresh UIFont on every SwiftUI render pass triggered by @Environment(\.dynamicTypeSize). - Update GiniTextFieldStyle to use resolvedTextFont for all three font usages (input text, title/placeholder, error message). - Change GiniHealthConfiguration and GiniMerchantConfiguration *InputFieldConfiguration properties from lazy var (computed once) to computed var with dynamicTextFont closures set to the shared singleton's font(for:), ensuring each render gets the current size. - Add PaymentInfoConfiguration.dynamicFont closure and wire it in the Health and Merchant configuration providers. - Add PaymentInfoViewModel.refreshAttributedContent() which rebuilds payBillsDescriptionAttributedText and FAQ answer attributed strings using freshly-scaled fonts from the dynamicFont closure. - Add UIContentSizeCategory.didChangeNotification observer in PaymentInfoViewController that calls refreshAttributedContent() and reloads the description text view and FAQ table on runtime size changes. - Remove payBillsTitleLabel height cap (lessThanOrEqualToConstant: 100 pt) which was clipping the title at Accessibility Extra Large and above sizes. HEAL-344 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…EAL-359 refactor - Restore PaymentTestMocks: full MockPaymentReviewDelegate tracking properties, MockBottomSheetsProvider with real view creation, MockPaymentReviewViewModelDelegate, and remove dead didTapOnClose from MockBanksSelectionDelegate (protocol no longer requires it) - Restore PaymentReviewTestHelpers: Document.testDocument() factory and makePaymentReviewModelWithDocument convenience builder - Add PaymentInfoTests: 9 tests covering isComplete all branches, IBAN uppercasing, and optional field defaults - Add MoreInformationViewModelTests: delegate notification and nil-safe path - Add PaymentReviewContainerViewModelTests: onExtractionFetched callbacks, shouldShowBrandedView for all IngredientBrandTypeEnum cases, and selectedPaymentProvider mutation - Add PaymentReviewModelTests: 28 tests covering viewDidDisappear, sendFeedback, createPaymentRequest, closePaymentReview, fetchImages, all BanksSelectionProtocol and ShareInvoiceBottomViewProtocol conformances, and bottom sheet guard paths - Extend PaymentReviewObservableModelTests: didTapClose, invoiceImageAccessibilityLabel, and all 5 model binding callbacks - Update sonar-project.properties: extend coverage exclusions to include *ViewController.swift, *TableViewCell.swift, *CollectionViewCell.swift, *ViewCell.swift and five UIKit/system-level files HEAL-359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…des' into HEAL-359-Cleanup-the-close-button-container-and-button-from-the-bottom-sheet-implementation # Conflicts: # GiniComponents/InternalPaymentSDK/GiniInternalPaymentSDK/Tests/GiniInternalPaymentSDKTests/PaymentReviewModelTests.swift # GiniComponents/InternalPaymentSDK/GiniInternalPaymentSDK/Tests/GiniInternalPaymentSDKTests/PaymentReviewObservableModelTests.swift
- Add expanded/collapsed accessibility value to question header cells - Post layoutChanged notification on FAQ section toggle for VoiceOver focus - Add accessibilityExpandedText/accessibilityCollapsedText to PaymentInfoStrings HEAL-328
- Post accessibility announcement for first field error when payment form validation fails on pay button tap - Expose error message as accessibilityValue on text fields in error state - Hide error label from accessibility tree to avoid duplicate announcements HEAL-328
Replace accessibilityValue with accessibilityHintIfPresent so validation errors are announced as hints, preserving the TextField's default accessibility value (user-entered text). HEAL-328
…des' into fix/HEAL-344_dynamic_fonts
…fter merge - Remove duplicate makePaymentReviewModelWithDocument introduced by auto-merge with release/health_refactor_error_codes - Remove didTapOnClose test from BanksBottomViewModelTests — BanksSelectionProtocol no longer declares didTapOnClose after HEAL-359 HEAL-359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… code
- Add 5 tests to PaymentInfoViewModelTests covering the new
toggleAccessibilityStrings and isExpanded fields introduced in
infoQuestionHeaderViewModel(at:):
· expanded/collapsed text round-trips through the strings fixture
· isExpanded false by default, true after question is extended
· per-question expansion state is independent
· title is resolved by index correctly
- Add View+AccessibilityTests (new file) with 3 tests covering all
branches of accessibilityHintIfPresent(_:):
· nil message → else branch, no hint injected
· empty string → else branch, no hint injected
· non-empty message → if branch, modifier applied without error
HEAL-328
…t from 19 to 6 params Group the 19 flat parameters into 6 semantically cohesive sub-structs to resolve Sonar S107 (Functions should not have too many parameters): - PaymentInfoAnswerCellConfiguration (font, textColor, linkColor) - PaymentInfoQuestionHeaderConfiguration (font, titleColor, minusIcon, plusIcon, iconTintColor) - PaymentInfoQuestionsTitleConfiguration (font, color) - PaymentInfoPayBillsConfiguration (titleFont, titleColor, descriptionFont) - PaymentInfoLinkConfiguration (giniFont, font, color) - PaymentInfoLayoutConfiguration (bankCellBorderColor, separatorColor, backgroundColor) Update all call sites: PaymentInfoViewModel, PaymentInfoViewController, GiniHealth/GiniMerchant configuration providers, and test helpers. HEAL-359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Heal 328 medium priority issues
… 11 to 7 params Group the 11 flat parameters into 3 semantically cohesive sub-structs to resolve Sonar S107 (Functions should not have too many parameters): - PaymentInfoGiniLinkStrings (websiteText, urlText) - PaymentInfoPrivacyPolicyStrings (text, urlText) - PaymentInfoFAQStrings (titleText, questions, answers) Update all call sites: PaymentInfoViewModel, PaymentInfoViewController, GiniHealth/GiniMerchant string providers, and test helpers. HEAL-359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Integrated accessibility strings (accessibilityExpandedText, accessibilityCollapsedText) from the release branch into the PaymentInfoFAQStrings sub-struct introduced by HEAL-359, keeping the Sonar S107 fix intact across all call sites. HEAL-359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…container-and-button-from-the-bottom-sheet-implementation Heal 359 cleanup the close button container and button from the bottom sheet implementation
Replaced the local accessibilityErrorHint computed property with the accessibilityHintIfPresent extension introduced by the release branch, which is semantically identical but more reusable. HEAL-368 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rate_sboms lane Replace .first with the destructuring pattern (swift_package_repo_urls,) = consistent with every other check_and_get_options call in the Fastfile. PP-2292
…ase.swift GiniInternalPaymentTests was a typo — the actual directory is Tests/GiniInternalPaymentSDKTests. This mismatch caused SPM to fail when resolving the package, breaking SBOM generation with cdxgen. PP-2292
Pp 2326 removed merchant sdk
…ar ranges Add LICENSE files for GiniComponents/InternalPaymentSDK and GiniComponents/Utilities, add a module license index to the root LICENSE, simplify copyright year ranges to start year only, and remove the stale third-party MIT license block from the CaptureSDK LICENSE. PP-2637
- Fix "Utilites" typo → "Utilities" in root LICENSE index and BankSDK LICENSE - Remove trailing whitespace from GiniComponents/Utilities and InternalPaymentSDK LICENSE files (line 11) - Simplify CaptureSDK/GiniCaptureSDK/LICENSE header year to 2014 to match the body and be consistent with the PR goal - Fix trailing whitespace and add missing newline in BankSDK/GiniBankSDK/LICENSE - Add .build dirs to .gitignore PP-2637
Remove outdated header and indented duplicate block, align with the format used by all other module licenses. PP-2637
Add dependency index tables with pinned commit URLs to BankSDK, CaptureSDK, HealthSDK, and InternalPaymentSDK licenses. Also update API library licenses. PP-2637
The actual files are named LICENSE, not LICENSE.md; update labels to match the real filenames. PP-2637
Remove year range 2021-2023 in favour of single start year 2021, consistent with all other module licenses. PP-2637
ci: introduce reusable sdk.release.yml workflow with GitHub App auth
ci: migrate generate-sboms to GitHub App auth and drop archived pinning repos
Add missing module licenses and clean up copyright year
a6626c3 to
2edc9a8
Compare
# Conflicts: # .gitignore
|
|
|
|
|
|



Pull Request Description
This PR aims to make the BankSDK example app UI tests runnable on simulators by ensuring required PDF fixtures are available in the simulator’s Files app / app Documents container and by updating UI test navigation in the document picker.
Changes:
Add a script + fixture folder documentation to place/copy required PDF test fixtures into the simulator app container.
Update UI test “Files picker” navigation to reliably reach “On My iPhone → GiniBankSDKExample” and select a fixture.
Add automatic fixture-copy logic in the UI test base class and adapt Skonto UI tests for optional review/analysis steps.