Created
May 21, 2019 19:20
-
-
Save FabiolaRamirez/4cdff9af2eb47b55b37ccda008ce2731 to your computer and use it in GitHub Desktop.
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 testRewardsModule(email: String, password: String) { | |
| let rewardsKey = "REWARDS" | |
| let clickApplyId = "ccApplyId" | |
| testLogIn(email: email, password: password) | |
| let app = XCUIApplication() | |
| var row = 0 | |
| var element = app.tables.staticTexts.element(matching: .any, identifier: "\(rewardsKey),\(row)") | |
| while !element.exists { | |
| row += 1 | |
| element = app.tables.staticTexts.element(matching: .any, identifier: "\(rewardsKey),\(row)") | |
| } | |
| if app.scrollToElement(element: element) { | |
| app.swipeUp() | |
| let cellQuery = app.tables.cells.element(boundBy: row) | |
| cellQuery.buttons[clickApplyId].tap() | |
| sleep(5) | |
| app.buttons["Done"].tap() | |
| app.navigationBars["finance.AOOPView"].otherElements["Profile and Settings button"].tap() | |
| app.tables/*@START_MENU_TOKEN@*/.staticTexts["Log Out"]/*[[".cells.staticTexts[\"Log Out\"]",".staticTexts[\"Log Out\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() | |
| app.alerts["Log Out"].buttons["Yes"].tap() | |
| } else { | |
| XCTAssert(false, "Rewards Module not found") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment