Created
April 23, 2020 19:21
-
-
Save azamsharp/3d4217dcd481450760cebcb9c736e48f 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
Given("I have following tasks") { args, userInfo in | |
XCUIApplication().launch() | |
let rows: NSArray = (userInfo?["DataTable"]) as! NSArray | |
let taskTextField = XCUIApplication().textFields["taskTextField"] | |
for index in 1...rows.count { | |
let taskName = (rows[index] as! NSArray)[0] as! String | |
taskTextField.tap() | |
taskTextField.typeText(taskName + "\n") | |
XCUIApplication().buttons["addTaskButton"].tap() | |
taskTextField.tap() | |
let deleteString = String(repeating: XCUIKeyboardKey.delete.rawValue, count: taskName.count) | |
// clear the textfield | |
taskTextField.typeText(deleteString) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment