-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathHome.swift
40 lines (33 loc) · 1009 Bytes
/
Home.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@testable import Example
import XCTest
class Home: Base {
var settingsButton: XCUIElement {
app.buttons[AccessibilityIdentifier.HomeScreen.settingsNavigationBarItem].await()
}
func detail(for id: String) -> XCUIElement {
app.buttons[AccessibilityIdentifier.HomeScreen.detail(for: id)].await()
}
func detailSettings(for id: String) -> XCUIElement {
app.buttons[AccessibilityIdentifier.HomeScreen.detailSettings(for: id)].await()
}
@discardableResult
func assertVisible() -> Self {
XCTAssertTrue(settingsButton.exists)
return self
}
@discardableResult
func goToSettings() -> Settings<Home> {
settingsButton.tap()
return Settings(predecessor: self, prefix: "home", app: app)
}
@discardableResult
func goToDetail(for id: String) -> Detail {
detail(for: id).tap()
return Detail(app: app, id: id)
}
@discardableResult
func goToDetailSettings(for id: String) -> Detail {
detail(for: id).tap()
return Detail(app: app, id: id)
}
}