mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -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()
|
||||
|
||||
|
||||
@@ -58,4 +58,6 @@ targets:
|
||||
sources:
|
||||
- path: ../Sources
|
||||
- path: ../SupportingFiles
|
||||
- path: ../../ElementX/Sources/Other/AccessibilityIdentifiers.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/XCUIElement.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/NSRegularExpresion.swift
|
||||
|
||||
Reference in New Issue
Block a user