Skip to content

Instantly share code, notes, and snippets.

@dheerajn
Created September 20, 2021 21:12
Show Gist options
  • Save dheerajn/fc0681c847deb915f0ca4bc436a2d2cc to your computer and use it in GitHub Desktop.
Save dheerajn/fc0681c847deb915f0ca4bc436a2d2cc to your computer and use it in GitHub Desktop.
import Foundation
import XCTest
struct ContentViewHelper {
static let app = XCUIApplication()
enum StaticText {
static let titleText = app.staticTexts["Normal Text"]
static let overriddenTitleText = app.staticTexts["Text Overridden for UI Tests"]
static let view1Text = app.staticTexts["View - 1"]
static let view2Text = app.staticTexts["View - 2"]
}
enum Button {
static let navigationButton = app.buttons["customButton"]
}
static func testTitleText() {
XCTAssertTrue(StaticText.titleText.exists)
}
static func testOverriddenTitleText() {
XCTAssertTrue(StaticText.overriddenTitleText.exists)
}
static func navigateToView1() {
Button.navigationButton.tap()
XCTAssertTrue(StaticText.view1Text.exists)
}
static func navigateToView2() {
Button.navigationButton.tap()
XCTAssertTrue(StaticText.view2Text.exists)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment