Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few failing UI tests. #6386

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum MockAuthenticationServerSelectionScreenState: MockScreenState, CaseIterable
let viewModel: AuthenticationServerSelectionViewModel
switch self {
case .matrix:
viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: "https://matrix.org",
viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: "matrix.org",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed in the Coordinator as is now gives the view model an address that has already been formatted.

hasModalPresentation: true)
case .emptyAddress:
viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: "",
Expand All @@ -48,7 +48,7 @@ enum MockAuthenticationServerSelectionScreenState: MockScreenState, CaseIterable
hasModalPresentation: true)
Task { await viewModel.displayError(.footerMessage(VectorL10n.errorCommonMessage)) }
case .nonModal:
viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: "https://matrix.org",
viewModel = AuthenticationServerSelectionViewModel(homeserverAddress: "matrix.org",
hasModalPresentation: false)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AuthenticationServerSelectionUITests: MockScreenTest {

func verifyNormalState() {
let serverTextField = app.textFields.element
XCTAssertEqual(serverTextField.value as? String, "matrix.org", "The server shown should be matrix.org with the https scheme hidden.")
XCTAssertEqual(serverTextField.value as? String, "matrix.org", "The server shown should be matrix.org as passed to the view model init.")

let confirmButton = app.buttons["confirmButton"]
XCTAssertEqual(confirmButton.label, VectorL10n.confirm, "The confirm button should say Confirm when in modal presentation.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class ChangePasswordUITests: MockScreenTest {

let oldPasswordTextField = app.secureTextFields["oldPasswordTextField"]
XCTAssertTrue(oldPasswordTextField.exists, "The text field should be shown.")
XCTAssertEqual(oldPasswordTextField.label, "old password", "The text field should be showing the placeholder before text is input.")
XCTAssertEqual(oldPasswordTextField.label, "Old password", "The text field should be showing the placeholder before text is input.")

let newPasswordTextField1 = app.secureTextFields["newPasswordTextField1"]
XCTAssertTrue(newPasswordTextField1.exists, "The text field should be shown.")
XCTAssertEqual(newPasswordTextField1.label, "new password", "The text field should be showing the placeholder before text is input.")
XCTAssertEqual(newPasswordTextField1.label, "New password", "The text field should be showing the placeholder before text is input.")

let newPasswordTextField2 = app.secureTextFields["newPasswordTextField2"]
XCTAssertTrue(newPasswordTextField2.exists, "The text field should be shown.")
XCTAssertEqual(newPasswordTextField2.label, "confirm password", "The text field should be showing the placeholder before text is input.")
XCTAssertEqual(newPasswordTextField2.label, "Confirm password", "The text field should be showing the placeholder before text is input.")

let submitButton = app.buttons["submitButton"]
XCTAssertTrue(submitButton.exists, "The submit button should be shown.")
Expand All @@ -80,7 +80,7 @@ class ChangePasswordUITests: MockScreenTest {

let newPasswordTextField2 = app.secureTextFields["newPasswordTextField2"]
XCTAssertTrue(newPasswordTextField2.exists, "The text field should be shown.")
XCTAssertEqual(newPasswordTextField2.label, "confirm password", "The text field should be showing the placeholder before text is input.")
XCTAssertEqual(newPasswordTextField2.label, "Confirm password", "The text field should be showing the placeholder before text is input.")

let submitButton = app.buttons["submitButton"]
XCTAssertTrue(submitButton.exists, "The submit button should be shown.")
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6386.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a few failing UI tests.