This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func test_settings() { | |
Scenario("Logging in and navigating to settings") { | |
Given(I: logIn) | |
When(I: selectTabBar(tab: .settings)) | |
Then(I: seeSettingsScreen) | |
} | |
Scenario("Selecting support") { | |
Given(I: seeSettingsScreen) | |
When(I: selectSupportCell) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func test_settings() { | |
Scenario("Logging in and navigating to settings") { | |
Given(I: logIn) | |
When(I: selectTabBar(tab: .settings)) | |
Then(I: seeSettingsScreen) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Scenario { | |
@discardableResult | |
init(_ name: String, _ handler: () -> Void) { | |
XCTContext.runActivity(named: name) { _ in | |
handler() | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Step { | |
@discardableResult | |
init(I handler: () -> Void) { | |
runActivity(for: handler) | |
} | |
@discardableResult | |
init(I handler: @autoclosure () -> Void) { | |
runActivity(for: handler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhotosTests.swift | |
class PhotosTests: XCTestCase, LoginContext, PhotosContext { | |
func test_editingPhotos() { | |
Given(I: navigateToPhotos) | |
When(I: selectEditButton) | |
Then(I: seeEditOptions) | |
} | |
private func selectEditButton() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhotosContext.swift | |
protocol PhotosContext {} | |
extension PhotosContext where Self: LoginContext { | |
func navigateToPhotos() { | |
logIn() | |
selectPhotosButton() | |
seePhotosScreen() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhotosTests.swift | |
class PhotosTests: XCTestCase, LoginContext { | |
func test_editingPhotos() { | |
Given(I: navigateToPhotos) | |
When(I: selectEditButton) | |
Then(I: seeEditOptions) | |
} | |
private func navigateToPhotos() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhotosTests.swift | |
class PhotosTests: XCTestCase, LoginContext { | |
func test_navigatingToPhotos() { | |
Given(I: logIn) | |
When(I: selectPhotosButton) | |
Then(I: seePhotosScreen) | |
} | |
private func selectPhotosButton() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LoginContext.swift | |
protocol LoginContext {} | |
extension LoginContext { | |
func logIn() { | |
// Log in code | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhotosTests.swift | |
class PhotosTests: XCTestCase { | |
func test_navigatingToPhotos() { | |
Given(I: logIn) | |
When(I: selectPhotosButton) | |
Then(I: seePhotosScreen) | |
} | |
private func logIn() { |