Created
September 20, 2021 21:12
-
-
Save dheerajn/fc0681c847deb915f0ca4bc436a2d2cc to your computer and use it in GitHub Desktop.
This file contains 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
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