Created
August 15, 2020 17:17
-
-
Save cipolleschi/745a49f3d506a349a728119d860b963e 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
func testPurchasingCoins_success() { | |
self.app.launchArguments.append(contentsOf: ["-mockPurchase", "true"]) | |
self.app.launch() | |
let homeView = self.app.otherElements[HomeView.AccessibilityIdentifiers.homeView.rawValue] | |
XCTAssertTrue(homeView.exists) | |
self.app.buttons[HomeView.AccessibilityIdentifiers.purchase.rawValue].tap() | |
XCTAssertEqual(self.app.staticTexts[HomeView.AccessibilityIdentifiers.coins.rawValue].label, "1000") | |
} | |
func testPurchasingCoins_failure() { | |
self.app.launchArguments.append(contentsOf: ["-mockPurchase", "false"]) | |
self.app.launch() | |
let homeView = self.app.otherElements[HomeView.AccessibilityIdentifiers.homeView.rawValue] | |
XCTAssertTrue(homeView.exists) | |
self.app.buttons[HomeView.AccessibilityIdentifiers.purchase.rawValue].tap() | |
XCTAssertEqual(self.app.staticTexts[HomeView.AccessibilityIdentifiers.coins.rawValue].label, "0") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment