This is my simple test case:
import XCTest
@testable import MyApp //it doesn't work
because of this:
class TabBarControllerTests: XCTestCase {
override func setUp() {
super.setUp()
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject([], forKey: DBTabBarOrderedIndexesKey) //key is undefined, because of lack of my app module
defaults.synchronize()
continueAfterFailure = false
XCUIApplication().launch()
}
func testIsOrderOfTabsSaved() {
XCUIApplication().tabBars.buttons["Catering"].tap()
//what next?
}
}
Once I tap UITabBarItem
I change the value of DBAppSettings.mode
, so here I would like to have an access to my DBAppSettings.mode
property to check if it is really changed.
I noticed that there is one weird thing, when I build my app, and check what was built, there is no build for my UITest target. Is it important?
key
, but in common I need access to some singletons. – Nonaligned