Skip to content

Pp 2483 enable UI test simulators#1177

Open
ValentinaIancu-Gini wants to merge 12 commits into
mainfrom
PP-2483-enable-ui-test-Simulators
Open

Pp 2483 enable UI test simulators#1177
ValentinaIancu-Gini wants to merge 12 commits into
mainfrom
PP-2483-enable-ui-test-Simulators

Conversation

@ValentinaIancu-Gini

Copy link
Copy Markdown
Contributor

Pull Request Description

[PP-####]

Notes for Reviewers

qnaveed87 and others added 12 commits April 10, 2026 16:01
…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>
# Conflicts:
#	BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift
#	BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniSkontoScreenUITests.swift

Copilot AI left a comment

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.

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 uploads TestFixtures.Files.skontoPast and 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants