Top "Xctest" questions

XCTest is an Apple-provided framework which implements unit testing functions.

Use of undeclared type 'ViewController' when unit testing my own ViewController in Swift?

I have been trying to write test cases in Swift to test my ViewController. However, when I try to instantiate …

swift xctest
iOS XCUITests access element by accessibility

How do I assert a button exists by his accessibilityLabel or identifier? func testExitsButton() { XCTAssertTrue(app.windows.containing(.button, identifier: "…

ios swift xctest
When do app sources need to be included in test targets?

In a new project I have this simple test #import <XCTest/XCTest.h> #import "ViewController.h" @interface ViewControllerTests : …

ios objective-c xcode unit-testing xctest
XCTest and asynchronous testing in Xcode 6

So Apple said in the release note of Xcode 6 that we can now do asynchronous testing directly with XCTest. Anyone …

ios xcode xctest
Xcode 7 UI Testing: how to dismiss a series of system alerts in code

I am writing UI test cases using the new Xcode 7 UI Testing feature. At some point of my app, I …

ios objective-c xctest xcode7 xcode-ui-testing
Xcode UI Testing - typing text with typeText() method and autocorrection

I've got a test like below: let navnTextField = app.textFields["First Name"] let name = "Henrik" navnTextField.tap() navnTextField.typeText("Henrik") …

uitextfield ios9 xctest xcode-ui-testing
XCode 5 unit testing: starts my app

When I run my tests in XCode 5, the main window of my OS X app appears on the screen for …

objective-c xcode xcode5 xctest
How to select a picker view item in an iOS UI test in Xcode?

I have a picker view with few items: "Red", "Green", "Yellow", "Black". In my UI test I need to select …

ios xcode swift xctest xcode-ui-testing
How to test that staticTexts contains a string using XCTest

In Xcode UI testing, how do I test that staticTexts contains a string? In the debugger, I can run something …

swift xctest
failing a XCTestCase with assert without the test continuing to run but without stopping other tests

I'm trying to test my application using the XCTest framework. I want my single test case to fail if some …

xcode xctest