Skip to content

Commit

Permalink
Update screenshots test to work with updated UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Petersson committed Sep 18, 2023
1 parent 0d95c88 commit d63379b
Show file tree
Hide file tree
Showing 28 changed files with 578 additions and 70 deletions.
2 changes: 1 addition & 1 deletion ios/MullvadVPN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2581,9 +2581,9 @@
7A83C3FC2A55B39500DFB83A /* TestPlans */ = {
isa = PBXGroup;
children = (
7A02D4EA2A9CEC7A00C19E31 /* MullvadVPNScreenshots.xctestplan */,
7A83C3FE2A55B72E00DFB83A /* MullvadVPNApp.xctestplan */,
7A83C4002A55B81A00DFB83A /* MullvadVPNCI.xctestplan */,
7A02D4EA2A9CEC7A00C19E31 /* MullvadVPNScreenshots.xctestplan */,
);
path = TestPlans;
sourceTree = "<group>";
Expand Down
1 change: 1 addition & 0 deletions ios/MullvadVPN/Coordinators/AccountCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ final class AccountCoordinator: Coordinator, Presentable, Presenting {
let presentation = AlertPresentation(
id: "account-logout-alert",
icon: .spinner,
message: nil,
buttons: []
)

Expand Down
7 changes: 6 additions & 1 deletion ios/MullvadVPN/Coordinators/AlertCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ final class AlertCoordinator: Coordinator, Presentable {
}

presentation.buttons.forEach { action in
alertController.addAction(title: action.title, style: action.style, handler: action.handler)
alertController.addAction(
title: action.title,
style: action.style,
accessibilityId: action.accessibilityID,
handler: action.handler
)
}
}
}
7 changes: 0 additions & 7 deletions ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1008,10 +1008,3 @@ fileprivate extension AppPreferencesDataSource {

// swiftlint:disable:next file_length
}

private protocol Poppable: Presentable {
func popFromNavigationStack(
animated: Bool,
completion: () -> Void
)
}
1 change: 1 addition & 0 deletions ios/MullvadVPN/Coordinators/ChangeLogCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ final class ChangeLogCoordinator: Coordinator, Presentable {
comment: ""
),
style: .default,
accessibilityId: "OkButton",
handler: { [weak self] in
guard let self else { return }
didFinish?(self)
Expand Down
59 changes: 0 additions & 59 deletions ios/MullvadVPN/Operations/PresentAlertOperation.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct AlertMetadata {
struct AlertAction {
let title: String
let style: AlertActionStyle
var accessibilityID: String?
var handler: (() -> Void)?
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ class AlertViewController: UIViewController {
}
}

func addAction(title: String, style: AlertActionStyle, handler: (() -> Void)? = nil) {
func addAction(title: String, style: AlertActionStyle, accessibilityId: String?, handler: (() -> Void)? = nil) {
// The presence of a button should reset any custom button margin to default.
containerView.directionalLayoutMargins.bottom = UIMetrics.CustomAlert.containerMargins.bottom

let button = AppButton(style: style.buttonStyle)

button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
button.setTitle(title, for: .normal)
button.accessibilityIdentifier = accessibilityId
button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)

containerView.addArrangedSubview(button)
handler.flatMap { handlers[button] = $0 }
Expand Down
1 change: 1 addition & 0 deletions ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class MullvadVPNScreenshots: XCTestCase {
if cityCell.exists {
cityCell.tap()
} else {
_ = countryCell.buttons["CollapseButton"].waitForExistence(timeout: 5)
countryCell.buttons["CollapseButton"].tap()
cityCell.tap()
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ios/Screenshots/en-US/iPhone 8 Plus-Account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d63379b

Please sign in to comment.