I am using following code in swift
@IBAction func letsPlay(_ sender: UIButton) {
if(input.text == "xxx@123")
{
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4), execute: {
let storybord = UIStoryboard(name: "Main", bundle: nil)
let vc = storybord.instantiateViewController(withIdentifier: "ViewController2")as! ViewController2
self.navigationController?.pushViewController(vc, animated: true)
})
}
In my Test I am using following code
func testValidKey() {
EarlGreyImpl.invoked(fromFile: #file, lineNumber: #line).selectElement(with: grey_accessibilityID("inner")).perform(grey_replaceText("xxx@123"))
var error:NSError?
EarlGreyImpl.invoked(fromFile: #file, lineNumber: #line).selectElement(with: grey_accessibilityID("logo")).perform(grey_tap(), error:&error)
EarlGreyImpl.invoked(fromFile: #file, lineNumber: #line).selectElement(with: grey_accessibilityID("View2")).assert(grey_sufficientlyVisible())
}
While testing, earlgrey should wait because it has synchronization property but its showing me error with "No matching element"