Pp 2483 enable UI test simulators#1177
Open
ValentinaIancu-Gini wants to merge 12 commits into
Open
Conversation
…arity - Rename `testSkontoInFuture` to `testSkontoSwitchEnabledForValidDiscount` - Rename `testSkontoInPast` to `testSkontoSwitchDisabledForExpiredDiscount` - Names now reflect what each test verifies rather than the document state PP-2483 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…llery upload test PP-2483
This reverts commit 779c94f.
…argetEnvironment compiler directive PP-2483
# Conflicts: # BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift # BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniSkontoScreenUITests.swift
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Bank SDK example app’s UI test suite, mainly around Skonto flows and simulator/device handling for UI test execution.
Changes:
- Expanded Skonto UI tests with new end-to-end “full flow” coverage for Files- and Gallery-based uploads.
- Renamed several Skonto tests to clearer, intent-revealing names.
- Refactored simulator/device gating in the shared UI test base class.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniSkontoScreenUITests.swift | Adds/renames Skonto UI tests and introduces new “full flow” tests for Files and Gallery upload paths. |
| BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift | Adjusts simulator gating in setUpWithError / tearDownWithError and test setup utilities used by all UI test classes. |
Comments suppressed due to low confidence (1)
BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniSkontoScreenUITests.swift:55
- This test is documented/named as a “valid discount” flow (
skonto_valid), but it currently uploadsTestFixtures.Files.skontoPastand asserts the expired-discount UI (gotItButton). This is a behavior mismatch that can hide regressions and makes the test intent unclear. Use the valid fixture (or rename the test + doc to reflect an expired-discount flow).
//tap Skonto document
mainScreen.tapFileFromBestAvailableSource(fileName: TestFixtures.Files.skontoPast)
//Open button appears on some iOS versions/flows; safe to skip if absent.
if captureScreen.openGalleryButton.waitForExistence(timeout: 3) {
captureScreen.openGalleryButton.tap()
}
//Assert that Got it button is displayed
XCTAssertTrue(skontoScreen.gotItButton.waitForExistence(timeout: 10))
//Tap Got it button
skontoScreen.gotItButton.tap()
//Tap Proceed button
skontoScreen.proceedButton.tap()
Comment on lines
29
to
31
| var cxExtractionScreen: CXExtractionScreen! | ||
| var isSimulator = true | ||
|
|
||
| /** | ||
| Override in a subclass to inject extra launch arguments before the app launches. | ||
| The base argument `-StartFromCleanState YES` is always included. | ||
| */ | ||
| var additionalLaunchArguments: [String] { [] } | ||
|
|
||
| override func setUpWithError() throws { |
Comment on lines
+32
to
+34
| #if targetEnvironment(simulator) | ||
| throw XCTSkip("Skipping test on simulator") | ||
| #endif |
Comment on lines
197
to
200
| XCTAssertTrue(skontoScreen.proceedButton.waitForExistence(timeout: 10)) | ||
| //Assert that switch is enabled (skonto is still active) | ||
| XCTAssertTrue((skontoScreen.skontoSwitch.value != nil), "1") | ||
| } |
Comment on lines
228
to
231
| XCTAssertTrue(skontoScreen.gotItButton.waitForExistence(timeout: 10)) | ||
| //Assert that Switch is disabled | ||
| //Assert that Switch is disabled for expired skonto | ||
| XCTAssertTrue((skontoScreen.skontoSwitch.value != nil), "0") | ||
| } |
Comment on lines
+36
to
+42
| //TODO: Check if we need this or the below implementation `tapFileFromBestAvailableSource` | ||
| // //Tap valid skonto document | ||
| // mainScreen.tapFileWithName(fileName: TestFixtures.Files.skontoValid) | ||
| // //Tap Open button | ||
| // captureScreen.openGalleryButton.tap() | ||
| // //Assert Skonto screen appeared — proves Files upload was processed successfully | ||
| // XCTAssertTrue(skontoScreen.proceedButton.waitForExistence(timeout: 10)) |
Comment on lines
+183
to
+190
| //TODO: Check if we need this or the below implementation `tapFileFromBestAvailableSource` | ||
| // mainScreen.tapFileWithName(fileName: TestFixtures.Files.skontoValid) | ||
| // //tap Open button | ||
| // captureScreen.openGalleryButton.tap() | ||
| // //Assert Skonto screen is shown (Got it button does NOT appear for valid/future skonto) | ||
| // XCTAssertTrue(skontoScreen.proceedButton.waitForExistence(timeout: 10)) | ||
| // //Assert that Switch is enabled for valid skonto | ||
|
|
Comment on lines
+215
to
+220
| //TODO: Check if we need this or the below implementation `tapFileFromBestAvailableSource` | ||
| // mainScreen.tapFileWithName(fileName: TestFixtures.Files.skontoPast) | ||
| // //tap Open button | ||
| // captureScreen.openGalleryButton.tap() | ||
| // //Assert that Got it button is displayed for expired skonto | ||
|
|
Comment on lines
61
to
+65
| override func tearDownWithError() throws { | ||
| #if !targetEnvironment(simulator) | ||
| let screenshot = XCUIScreen.main.screenshot() | ||
| let attachment = XCTAttachment(screenshot: screenshot) | ||
| if !isSimulator { | ||
| attachment.lifetime = .deleteOnSuccess | ||
| add(attachment) | ||
| app.terminate() | ||
| } | ||
| attachment.lifetime = .deleteOnSuccess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
[PP-####]
Notes for Reviewers