forked from gini/gini-mobile-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gini#729 from gini/Add-automation-tests
Add automation tests
- Loading branch information
Showing
28 changed files
with
2,714 additions
and
2 deletions.
There are no files selected for viewing
342 changes: 341 additions & 1 deletion
342
BankSDK/GiniBankSDKExample/GiniBankSDKExample.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
16 changes: 16 additions & 0 deletions
16
...niBankSDKExampleUITests/AccessibilityIdentifiers/MainScreenAccessibilityIdentifiers.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// MainScreenAccessibilityIdentifiers.swift | ||
// | ||
// Copyright © 2024 Gini GmbH. All rights reserved. | ||
// | ||
|
||
|
||
import Foundation | ||
public enum MainScreenAccessibilityIdentifiers: String { | ||
case photoPaymentButton = "photoPaymentButtonIdentifier" | ||
case cameraIconButton = "cameraIconButtonIdentifier" | ||
case ibanTextField = "ibanTextFieldIdentifier" | ||
case welcomeTextTitle = "welcomeTextTitleIdentifier" | ||
case descriptionTextTitle = "descriptionTextTitleIdentifier" | ||
case metaInformationLabel = "metaInformationLabelIdentifier" | ||
} |
15 changes: 15 additions & 0 deletions
15
...ankSDKExampleUITests/AccessibilityIdentifiers/SettingScreenAccessibilityIdentifiers.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// SettingScreenAccessibilityIdentifiers.swift | ||
// | ||
// Copyright © 2024 Gini GmbH. All rights reserved. | ||
// | ||
|
||
|
||
import Foundation | ||
public enum SettingScreenAccessibilityIdentifiers: String { | ||
case closeButton = "closeButtonIdentifier" | ||
case qrCodeScanSwitch = "qrCodeScanSwitchIdentifier" | ||
case qrCodeScanOnlySwitch = "qrCodeScanOnlySwitchIdentifier" | ||
case multiPageSwitch = "multipageSwitch" | ||
case flashToggleSwitch = "flashToggleSwitchIdentifier" | ||
} |
62 changes: 62 additions & 0 deletions
62
BankSDK/GiniBankSDKExample/GiniBankSDKExampleUITests/GiniBankSDKExampleUITests.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// GiniBankSDKExampleUITests.swift | ||
// | ||
// Copyright © 2024 Gini GmbH. All rights reserved. | ||
// | ||
|
||
|
||
|
||
import XCTest | ||
import GiniCaptureSDK | ||
import GiniBankSDK | ||
|
||
class GiniBankSDKExampleUITests: XCTestCase { | ||
|
||
var app: XCUIApplication! | ||
var mainScreen: MainScreen! | ||
var helpScreen: HelpScreen! | ||
var settingScreen: SettingScreen! | ||
var captureScreen: CaptureScreen! | ||
var errorScreen: ErrorScreen! | ||
var cameraAccessScreen: CameraAccessScreen! | ||
var onboadingScreen: OnboardingScreen! | ||
var skontoScreen: SkontoScreen! | ||
var returnAssistantScreen: ReturnAssistantScreen! | ||
var reviewScreen: ReviewScreen! | ||
var transactionDocsScreen: TransactionDocsScreen! | ||
var isSimulator = true | ||
|
||
override func setUpWithError() throws { | ||
|
||
if isSimulator { | ||
throw XCTSkip("Skipping test") | ||
} | ||
continueAfterFailure = false | ||
app = XCUIApplication() | ||
app.launchArguments = ["-testing"] | ||
app.launch() | ||
//Initialize Identifiers based on current locale | ||
let currentLocale = Locale.current.languageCode ?? "en" | ||
mainScreen = MainScreen(app: app, locale: currentLocale) | ||
helpScreen = HelpScreen(app: app, locale: currentLocale) | ||
settingScreen = SettingScreen(app: app, locale: currentLocale) | ||
captureScreen = CaptureScreen(app: app, locale: currentLocale) | ||
errorScreen = ErrorScreen(app: app, locale: currentLocale) | ||
cameraAccessScreen = CameraAccessScreen(app: app, locale: currentLocale) | ||
onboadingScreen = OnboardingScreen(app: app, locale: currentLocale) | ||
skontoScreen = SkontoScreen(app: app, locale: currentLocale) | ||
returnAssistantScreen = ReturnAssistantScreen(app: app, locale: currentLocale) | ||
reviewScreen = ReviewScreen(app: app, locale: currentLocale) | ||
transactionDocsScreen = TransactionDocsScreen(app: app, locale: currentLocale) | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
let screenshot = XCUIScreen.main.screenshot() | ||
let attachment = XCTAttachment(screenshot: screenshot) | ||
if !isSimulator { | ||
attachment.lifetime = .deleteOnSuccess | ||
add(attachment) | ||
app.terminate() | ||
} | ||
} | ||
} |
Oops, something went wrong.