Skip to content

Commit 1cd717d

Browse files
committed
fix conflicts
1 parent 8a493dc commit 1cd717d

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

wire-ios/WireUITests/Pages/AccountSettingsPage.swift

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,61 @@
1616
// along with this program. If not, see http://www.gnu.org/licenses/.
1717
//
1818

19+
import WireLocators
1920
import XCTest
2021

2122
class AccountSettingsPage: PageModel {
2223

2324
override var pageMainElement: XCUIElement {
24-
accountSettingsPageHeader
25-
}
26-
27-
var accountSettingsPageHeader: XCUIElement {
28-
app.staticTexts["Account"]
25+
nameField
2926
}
3027

3128
var nameField: XCUIElement {
32-
app.descendants(matching: .any)["NameField"].firstMatch
29+
app.textFields[Locators.AccountSettingsPage.nameField.rawValue]
3330
}
3431

3532
var usernameField: XCUIElement {
36-
app.descendants(matching: .any)["UsernameField"].firstMatch
33+
app.staticTexts[Locators.AccountSettingsPage.usernameField.rawValue]
3734
}
3835

3936
var emailField: XCUIElement {
40-
app.descendants(matching: .any)["EmailField"].firstMatch
37+
app.staticTexts[Locators.AccountSettingsPage.emailField.rawValue]
4138
}
4239

4340
var domainField: XCUIElement {
44-
app.descendants(matching: .any)["DomainFieldDisabled"].firstMatch
41+
app.descendants(matching: .any)[Locators.AccountSettingsPage.domainFieldDisabled.rawValue].firstMatch
4542
}
4643

4744
var logoutButton: XCUIElement {
48-
app.staticTexts["Log Out"]
45+
app.staticTexts[Locators.AccountSettingsPage.logOut.rawValue]
4946
}
5047

5148
var deleteAccountButtonOnAccount: XCUIElement {
52-
app.descendants(matching: .any)["Delete AccountField"].firstMatch
49+
app.descendants(matching: .any)[Locators.AccountSettingsPage.deleteAccountField.rawValue].firstMatch
5350
}
5451

5552
var oKButtonOnDeleteAccountAlert: XCUIElement {
56-
app.buttons["OK"]
53+
app.buttons[Locators.AccountSettingsPage.ok.rawValue]
5754
}
5855

59-
var backToSettingsButton: XCUIElement {
60-
app.buttons["Settings"]
56+
var backToPreviousPage: XCUIElement {
57+
app.navigationBars.buttons.element(boundBy: 0)
6158
}
6259

6360
var backupOrRestoreButton: XCUIElement {
64-
app.descendants(matching: .any)["Back up or RestoreField"].firstMatch
61+
app.descendants(matching: .any)[Locators.AccountSettingsPage.backuporRestoreField.rawValue].firstMatch
6562
}
6663

6764
var resetPasswordButton: XCUIElement {
68-
app.descendants(matching: .any)["Reset Password"].firstMatch
65+
app.descendants(matching: .any)[Locators.AccountSettingsPage.resetPasswordField.rawValue].firstMatch
6966
}
7067

7168
func getAccountName() -> String? {
72-
nameField.value as? String
69+
XCTAssertTrue(
70+
nameField.waitForExistence(timeout: 5.0),
71+
"NameField should exist before reading account name"
72+
)
73+
return nameField.value as? String
7374
}
7475

7576
func getUsername() -> String {
@@ -85,9 +86,7 @@ class AccountSettingsPage: PageModel {
8586
}
8687

8788
func backToSettings() throws -> SettingsPage {
88-
if backToSettingsButton.exists {
89-
backToSettingsButton.tap()
90-
}
89+
backToPreviousPage.tap()
9190
return try SettingsPage()
9291
}
9392

@@ -115,15 +114,17 @@ class AccountSettingsPage: PageModel {
115114
}
116115

117116
func goBackToSettingsPage() throws -> SettingsPage {
117+
118118
if app.iPadOnly() {
119119
return try SettingsPage()
120120
}
121-
backToSettingsButton.tap()
121+
backToPreviousPage.tap()
122122
return try SettingsPage()
123123
}
124124

125125
func tapOnResetPasswordButton() throws -> WebViewPage {
126126
resetPasswordButton.tap()
127127
return try WebViewPage()
128128
}
129+
129130
}

wire-ios/WireUITests/Pages/ConversationsPage.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ class ConversationsPage: PageModel {
2929
}
3030

3131
var plusButtonToCreateGroupOrSearch: XCUIElement {
32-
app.descendants(matching: .any)["create_group_or_search_button"].firstMatch
32+
app.descendants(matching: .any)[Locators.ConversationsPage.createGroupOrSearchButton.rawValue].firstMatch
3333
}
3434

3535
var conversationCell: XCUIElement {
36-
app.buttons["title"]
36+
app.buttons[Locators.ConversationsPage.conversationCell.rawValue]
3737
}
3838

3939
var blockButtonOnMoreOptions: XCUIElement {
40-
app.buttons["Block…"]
40+
app.buttons[Locators.ConversationsPage.blockOptionOnContextMenu.rawValue]
4141
}
4242

4343
var blockButtonOnBottomSheet: XCUIElement {
44-
app.buttons["Block"]
44+
app.buttons[Locators.ConversationsPage.blockButtonOnBottomSheet.rawValue].firstMatch
4545
}
4646

4747
var videoCallButton: XCUIElement {
48-
app.descendants(matching: .any)["videoCallBarButton"].firstMatch
48+
app.descendants(matching: .any)[Locators.ActiveConversationPage.videoCallBarButton.rawValue].firstMatch
4949
}
5050

5151
var acceptRequestButton: XCUIElement {
52-
app.buttons["accept"]
52+
app.buttons[Locators.ConnectionRequestsPage.connectRequestButton.rawValue]
5353
}
5454

5555
var sidePanel: XCUIElement {
@@ -70,7 +70,8 @@ class ConversationsPage: PageModel {
7070
return try SettingsPage()
7171
}
7272

73-
func openUserAccountPageForUser(with input: String) throws -> UserAccountPage {
73+
74+
func openUserAccountPageForUser(with input: String) throws -> UserProfilePage {
7475
app.iPadOnly {
7576
if self.sideBarPanel.exists {
7677
self.sideBarPanel.tap()
@@ -81,7 +82,7 @@ class ConversationsPage: PageModel {
8182
if button.waitForExistence(timeout: 2), button.isHittable {
8283
button.tap()
8384
}
84-
return try UserAccountPage()
85+
return try UserProfilePage()
8586
}
8687

8788
func tapPlusButtonToCreateGroup() throws -> NewConversationPage {

wire-ios/WireUITests/Pages/OnMyDevicePage.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// along with this program. If not, see http://www.gnu.org/licenses/.
1717
//
1818

19+
import WireLocators
1920
import XCTest
2021

2122
class OnMyDevicePage: PageModel {
@@ -30,7 +31,7 @@ class OnMyDevicePage: PageModel {
3031
}
3132

3233
var saveButton: XCUIElement {
33-
app.buttons["Save"]
34+
app.buttons[Locators.OnMyiPhonePage.save.rawValue]
3435
}
3536

3637
var backupFile: (String) -> XCUIElement {

0 commit comments

Comments
 (0)