class MyTest: XCTestCase {
override class func setUp() {
super.setUp()
let checksToBeInstalled: [GTXChecking] = GTXChecksCollection.allGTXChecks()
let tmp = GTXTestSuite(allTestsIn: self)
GTXiLib.install(on: tmp ?? GTXTestSuite(), checks: checksToBeInstalled, elementBlacklists: [])
}
}
The missing link is that in your test case you have to create the view and add it to the keyWindow (make sure your view's fame is >0).
This is because the library uses the keyWindow as it's root object and then traverses its subviews to run the checks on. https://github.com/google/GTXiLib/blob/d9161c0cefd07556cd97739fdc8862a2711bc1d3/Classes/GTXiLibCore.m#L159

This is the error I get.

I would also recommend doing some type of window management to support these tests. In my case, I saw some accessibility failures because other objects in the window were being tested that were not the view I was interested in testing.
Final note: I ended up integrating GTXiLib 3.1 because newer versions depend on c++ which requires importing protobuf. There was an issue we encountered with protobuf not playing well with Carthage. May only be an issue with Carthage though since the Google team appears to be using Cocoapods.
Hope this helps!
Mary