Skip to content

Instantly share code, notes, and snippets.

@FabiolaRamirez
Created May 21, 2019 19:20
Show Gist options
  • Select an option

  • Save FabiolaRamirez/4cdff9af2eb47b55b37ccda008ce2731 to your computer and use it in GitHub Desktop.

Select an option

Save FabiolaRamirez/4cdff9af2eb47b55b37ccda008ce2731 to your computer and use it in GitHub Desktop.
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