Align accessibility IDs with elementX android (#567)

* Rename onboarding and login user/pass accessibility ids.

* Refactor remaining server change accessibility IDs

* Avoid accessibilityIdentifier spreading to all decorations on the textBox.

Required because otherwise there are multiple items tagged with the accessibilityId
which means we can't click on "the" item.

* Move all accessibility identifiers to `AccessibilityIdentifiers.swft`
- use same naming convention on all of them
- remove the unused ones
- fix build errors in integration tests and invalid identifiers (still broken until autodiscovery lands on rosa)

---------

Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
Michael Kaye
2023-02-15 05:53:04 +00:00
committed by GitHub
parent 21154c7eef
commit a06365517c
29 changed files with 215 additions and 141 deletions
+9 -14
View File
@@ -38,46 +38,41 @@ class LoginTests: XCTestCase {
private func runLoginLogoutFlow() {
let app = Application.launch()
let getStartedButton = app.buttons["Get started"]
let getStartedButton = app.buttons[A11yIdentifiers.onboarding.signIn]
XCTAssertTrue(getStartedButton.waitForExistence(timeout: 5.0))
getStartedButton.tap()
let editHomeserverButton = app.buttons["editServerButton"]
let editHomeserverButton = app.buttons[A11yIdentifiers.loginScreen.changeServer]
XCTAssertTrue(editHomeserverButton.waitForExistence(timeout: 5.0))
editHomeserverButton.tap()
let homeserverTextField = app.textFields["addressTextField"]
let homeserverTextField = app.textFields[A11yIdentifiers.changeServer.server]
XCTAssertTrue(homeserverTextField.waitForExistence(timeout: 5.0))
homeserverTextField.clearAndTypeText(app.homeserver)
let slidingSyncTextField = app.textFields["slidingSyncProxyAddressTextField"]
XCTAssertTrue(slidingSyncTextField.waitForExistence(timeout: 5.0))
slidingSyncTextField.clearAndTypeText(app.homeserver)
let confirmButton = app.buttons["confirmButton"]
let confirmButton = app.buttons[A11yIdentifiers.changeServer.server]
XCTAssertTrue(confirmButton.exists)
confirmButton.tap()
let usernameTextField = app.textFields["usernameTextField"]
let usernameTextField = app.textFields[A11yIdentifiers.loginScreen.emailUsername]
XCTAssertTrue(usernameTextField.exists)
usernameTextField.clearAndTypeText(app.username)
let passwordTextField = app.secureTextFields["passwordTextField"]
let passwordTextField = app.secureTextFields[A11yIdentifiers.loginScreen.password]
XCTAssertTrue(passwordTextField.exists)
passwordTextField.clearAndTypeText(app.password)
let nextButton = app.buttons["nextButton"]
let nextButton = app.buttons[A11yIdentifiers.loginScreen.continue]
XCTAssertTrue(nextButton.exists)
XCTAssertTrue(nextButton.isEnabled)
nextButton.tap()
let profileButton = app.buttons["userAvatarImage"]
let profileButton = app.buttons[A11yIdentifiers.homeScreen.userAvatar]
XCTAssertTrue(profileButton.waitForExistence(timeout: expectedDuration))
profileButton.tap()