diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-05-27 16:05:12 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-05-27 16:05:12 +0200 |
| commit | 6169afd3d5c1fcc2e4dbe6eeceaa75b479fb32fe (patch) | |
| tree | e07fe2978fa5b2d2b47dbb1f0af33bd17a26bb9a | |
| parent | 73f885dd9d58e3dfb7756192357206d0d591cea2 (diff) | |
| parent | 96170abd51592d05c4ab3e65f658046b17435f72 (diff) | |
| download | mullvadvpn-6169afd3d5c1fcc2e4dbe6eeceaa75b479fb32fe.tar.xz mullvadvpn-6169afd3d5c1fcc2e4dbe6eeceaa75b479fb32fe.zip | |
Merge branch 'fix-screenshots'
| -rw-r--r-- | ios/MullvadVPN/ConsentContentView.swift | 1 | ||||
| -rw-r--r-- | ios/MullvadVPN/LoginContentView.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/LoginViewController.swift | 5 | ||||
| -rw-r--r-- | ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift | 26 | ||||
| -rw-r--r-- | ios/Snapfile | 3 |
5 files changed, 26 insertions, 11 deletions
diff --git a/ios/MullvadVPN/ConsentContentView.swift b/ios/MullvadVPN/ConsentContentView.swift index 9d870ba420..40499a8914 100644 --- a/ios/MullvadVPN/ConsentContentView.swift +++ b/ios/MullvadVPN/ConsentContentView.swift @@ -58,6 +58,7 @@ We strongly believe in retaining as little data as possible because we want you let button = AppButton(style: .default) button.translatesAutoresizingMaskIntoConstraints = false button.setTitle(NSLocalizedString("Agree and continue", comment: ""), for: .normal) + button.accessibilityIdentifier = "AgreeButton" return button }() diff --git a/ios/MullvadVPN/LoginContentView.swift b/ios/MullvadVPN/LoginContentView.swift index 714beda334..8f804e556a 100644 --- a/ios/MullvadVPN/LoginContentView.swift +++ b/ios/MullvadVPN/LoginContentView.swift @@ -99,6 +99,8 @@ class LoginContentView: UIView { backgroundColor = .primaryColor layoutMargins = UIMetrics.contentLayoutMargins + accountTextField.accessibilityIdentifier = "LoginTextField" + keyboardResponder = AutomaticKeyboardResponder(targetView: self, handler: { [weak self] (view, adjustment) in self?.contentContainerBottomConstraint?.constant = adjustment diff --git a/ios/MullvadVPN/LoginViewController.swift b/ios/MullvadVPN/LoginViewController.swift index 1b59c086fc..a061fffecf 100644 --- a/ios/MullvadVPN/LoginViewController.swift +++ b/ios/MullvadVPN/LoginViewController.swift @@ -41,7 +41,10 @@ class LoginViewController: UIViewController, RootContainment { }() private lazy var accountInputAccessoryLoginButton: UIBarButtonItem = { - return UIBarButtonItem(title: NSLocalizedString("Log in", comment: ""), style: .done, target: self, action: #selector(doLogin)) + let barButtonItem = UIBarButtonItem(title: NSLocalizedString("Log in", comment: ""), style: .done, target: self, action: #selector(doLogin)) + barButtonItem.accessibilityIdentifier = "LoginBarButtonItem" + + return barButtonItem }() private lazy var accountInputAccessoryToolbar: UIToolbar = { diff --git a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift index c584d280a4..e9e2db3ce1 100644 --- a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift +++ b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift @@ -45,11 +45,17 @@ class MullvadVPNScreenshots: XCTestCase { textField.typeText(accountToken) // Tap "Log in" button to log in - app.toolbars["Toolbar"].buttons["LoginBarButtonItem"].tap() + if case .phone = UIDevice.current.userInterfaceIdiom { + app.toolbars["Toolbar"].buttons["LoginBarButtonItem"].tap() + } else { + textField.typeText("\n") + } // Select Australia, Melbourne in Select location controller - _ = app.buttons["SelectLocationButton"].waitForExistence(timeout: 10) - app.buttons["SelectLocationButton"].tap() + if case .phone = UIDevice.current.userInterfaceIdiom { + _ = app.buttons["SelectLocationButton"].waitForExistence(timeout: 10) + app.buttons["SelectLocationButton"].tap() + } let countryCell = app.cells["au"] let cityCell = app.cells["au-mel"] @@ -68,13 +74,15 @@ class MullvadVPNScreenshots: XCTestCase { snapshot("MainSecured") - // Re-open Select location controller - app.buttons["SelectLocationButton"].tap() - cityCell.buttons["CollapseButton"].tap() - snapshot("SelectLocation") + // Re-open Select location controller (iPhone only) + if case .phone = UIDevice.current.userInterfaceIdiom { + app.buttons["SelectLocationButton"].tap() + cityCell.buttons["CollapseButton"].tap() + snapshot("SelectLocation") - // Tap the "Done" button to dismiss the "Select location" controller - app.navigationBars.buttons.firstMatch.tap() + // Tap the "Done" button to dismiss the "Select location" controller + app.navigationBars.buttons.firstMatch.tap() + } // Open Settings app.buttons["SettingsButton"].tap() diff --git a/ios/Snapfile b/ios/Snapfile index d73fe87c62..d3382aafc5 100644 --- a/ios/Snapfile +++ b/ios/Snapfile @@ -4,7 +4,8 @@ devices([ "iPhone 8 Plus", "iPhone 11", "iPhone 11 Pro", - "iPhone 11 Pro Max" + "iPhone 11 Pro Max", + "iPad Pro (12.9-inch) (5th generation)" ]) languages([ |
