Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit a440875

Browse files
authored
Merge pull request #102 from wordpress-mobile/fix/signup-a11y-ids
Add accessibility identifiers needed for UI tests
2 parents 7a60074 + c4f6279 commit a440875

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.5.3-beta.1"
3+
s.version = "1.5.3-beta.2"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/NUX/NUXButtonViewController.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,19 @@ open class NUXButtonViewController: UIViewController {
7676
///
7777
/// - Parameters:
7878
/// - primary: Title string for primary button. Required.
79+
/// - primaryAccessibilityId: Accessibility identifier string for primary button. Optional.
7980
/// - secondary: Title string for secondary button. Optional.
81+
/// - secondaryAccessibilityId: Accessibility identifier string for secondary button. Optional.
8082
/// - tertiary: Title string for the tertiary button. Optional.
83+
/// - tertiaryAccessibilityId: Accessibility identifier string for tertiary button. Optional.
8184
///
82-
public func setButtonTitles(primary: String, secondary: String? = nil, tertiary: String? = nil) {
83-
bottomButtonConfig = NUXButtonConfig(title: primary, isPrimary: true, callback: nil)
85+
public func setButtonTitles(primary: String, primaryAccessibilityId: String? = nil, secondary: String? = nil, secondaryAccessibilityId: String? = nil, tertiary: String? = nil, tertiaryAccessibilityId: String? = nil) {
86+
bottomButtonConfig = NUXButtonConfig(title: primary, isPrimary: true, accessibilityIdentifier: primaryAccessibilityId, callback: nil)
8487
if let secondaryTitle = secondary {
85-
topButtonConfig = NUXButtonConfig(title: secondaryTitle, isPrimary: false, callback: nil)
88+
topButtonConfig = NUXButtonConfig(title: secondaryTitle, isPrimary: false, accessibilityIdentifier: secondaryAccessibilityId, callback: nil)
8689
}
8790
if let tertiaryTitle = tertiary {
88-
tertiaryButtonConfig = NUXButtonConfig(title: tertiaryTitle, isPrimary: false, callback: nil)
91+
tertiaryButtonConfig = NUXButtonConfig(title: tertiaryTitle, isPrimary: false, accessibilityIdentifier: tertiaryAccessibilityId, callback: nil)
8992
}
9093
}
9194

WordPressAuthenticator/Signin/LoginPrologueSignupMethodViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
3838

3939
let loginTitle = NSLocalizedString("Sign up with Email", comment: "Button title. Tapping begins our normal sign up process.")
4040
let createTitle = NSLocalizedString("Sign up with Google", comment: "Button title. Tapping begins sign up using Google.")
41-
buttonViewController.setupTopButton(title: loginTitle, isPrimary: false) { [weak self] in
41+
buttonViewController.setupTopButton(title: loginTitle, isPrimary: false, accessibilityIdentifier: "Sign up with Email Button") { [weak self] in
4242
defer {
4343
WordPressAuthenticator.track(.signupEmailButtonTapped)
4444
}
4545
self?.dismiss(animated: true)
4646
self?.emailTapped?()
4747
}
4848

49-
buttonViewController.setupBottomButton(title: createTitle, isPrimary: false) { [weak self] in
49+
buttonViewController.setupBottomButton(title: createTitle, isPrimary: false, accessibilityIdentifier: "Sign up with Google Button") { [weak self] in
5050
defer {
5151
WordPressAuthenticator.track(.signupSocialButtonTapped)
5252
}

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LoginPrologueViewController: LoginViewController {
6666
buttonViewController.setupTopButton(title: loginTitle, isPrimary: true, accessibilityIdentifier: "Prologue Log In Button") { [weak self] in
6767
self?.loginTapped()
6868
}
69-
buttonViewController.setupBottomButton(title: createTitle, isPrimary: false) { [weak self] in
69+
buttonViewController.setupBottomButton(title: createTitle, isPrimary: false, accessibilityIdentifier: "Prologue Signup Button") { [weak self] in
7070
self?.signupTapped()
7171
}
7272
if showCancel {

0 commit comments

Comments
 (0)