Skip to content

Instantly share code, notes, and snippets.

@KaneCheshire
Last active July 9, 2018 12:02
Show Gist options
  • Save KaneCheshire/1626aa578d1b240a50d94004108892df to your computer and use it in GitHub Desktop.
Save KaneCheshire/1626aa578d1b240a50d94004108892df to your computer and use it in GitHub Desktop.
// PhotosTests.swift
class PhotosTests: XCTestCase, LoginContext {
func test_editingPhotos() {
Given(I: navigateToPhotos)
When(I: selectEditButton)
Then(I: seeEditOptions)
}
private func navigateToPhotos() {
logIn()
selectPhotosButton()
seePhotosScreen()
}
private func selectPhotosButton() {
// Select photos button code
}
private func seePhotosScreen() {
// Assert photos screen is visible
}
private func selectEditButton() {
// Select edit button
}
private func seeEditOptions() {
// Assert in edit mode
}
}
// CameraTests.swift
class CameraTests: XCTestCase, LoginContext {
func test_navigatingToCamera() {
Given(I: navigateToPhotos)
When(I: selectCameraButton)
Then(I: seeCameraOptions)
}
private func navigateToPhotos() {
logIn()
selectPhotosButton()
seePhotosScreen()
}
private func selectPhotosButton() {
// Select photos button code
}
private func seePhotosScreen() {
// Assert photos screen is visible
}
private func selectCameraButton() {
// Select camera button code
}
private func seeCameraOptions() {
// Assert camera options
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment