如何在XCode7 iOS9中断言TextView值?

Sar*_*rit 6 xcode unit-testing ios swift xcode-ui-testing

我正在进行UI单元测试.在图片里.
它们是UILabel,除了长描述是UITextView.
在我想要做的页面断言测试答案中的值.

对于UILabels的答案很好.我可以按照Xcode UI测试示例
这个方法非常容易理解,只需点击元素并将方法更改.tap().exist()然后将其括起来assert();

我的问题UITextView比复杂得多UILabel.
我怎样才能获得UITextView断言检查的价值?

func testG(){

let app = XCUIApplication()
app.launch();
app.buttons["Enter"].tap()
app.tables.staticTexts["Bee"].tap()

assert(app.scrollViews.staticTexts["Name :"].exists);
assert(app.scrollViews.staticTexts["Age :"].exists);
assert(app.scrollViews.staticTexts["Specialty :"].exists);
assert(app.scrollViews.staticTexts["Description :"].exists);

assert(app.scrollViews.staticTexts["Bee"].exists);
assert(app.scrollViews.staticTexts["11"].exists);
assert(app.scrollViews.staticTexts["Sky Diver"].exists);
let text = "Bees are flying insects closely related to wasps and ants, known for their role in pollination and, in the case of the best-known bee species, the European honey bee, for producing honey and beeswax. Bees are a monophyletic lineage within the superfamily Apoidea, presently considered as a clade Anthophila. There are nearly 20,000 known species of bees in seven to nine recognized families,[1] though many are undescribed and the actual number is probably higher. They are found on every continent except Antarctica, in every habitat on the planet that contains insect-pollinated flowering plants.EOF";
assert(app.scrollViews.childrenMatchingType(.TextView).element.exists);
}
Run Code Online (Sandbox Code Playgroud)

带滚动条的UI

Chr*_*isH 3

如果其他人发现这个问题,我可以UITextView通过使用获取 a 的文本

app.textViews.element.value as? String
Run Code Online (Sandbox Code Playgroud)

这假设当时屏幕上只有一个文本视图。