title: Swift UI Testing Access string in the TextField
body: <p>I am using the <code>UI Test Case</code> class integrated in Xcode and <code>XCTest</code> to test app UI. I want to test something like this:</p>
  
  <pre><code>app = XCUIApplication()
  let textField = app.textFields["Apple"]
  textField.typeText("text_user_typed_in")
  XCTAssertEqual(textField.text, "text_user_typed_in")
  </code></pre>
  
  <p>I've tried the <code>textField.value as! String</code> method; it does not work.
  I've also tried using the new async method with <code>expectationForPredicate()</code>, and it will result in a timeout.</p>
  
  <p>Any idea how to do this or validation of this kind is not possible with UI Test and I could only write black-box tests?</p>