0

When using XCTest method recordFailureWithDescription like this:

func testRecordFailureMessageNotWorking() {
    XCUIApplication().button["Login"].tap()
    self.recordFailureWithDescription("Custom Description", inFile: #file, atLine: #line, expected: true)
}

The console output no longer provides the custom description or the file name or the line number as it did in xcode 7.

Anyone have any thoughts on this? or a way to get the custom description?

h.w.powers
  • 820
  • 8
  • 10

2 Answers2

0

Upgrade your OS to macOS Sierra - this will improve the console functionality.

Oletha
  • 7,324
  • 1
  • 26
  • 46
  • Although I have not upgraded to Sierra, I am not sure this will solve my problem. I would like the custom description added to the failure description so it is accessible from external programs like xcpretty etc. – h.w.powers Oct 20 '16 at 15:04
-1

Xcode 8 changed the output for logs, for me it included a lot of 'garbage' code. Are you getting any of that or is it just the omission of the file name/ line number that is affecting you? If its the former, you can edit the projects scheme:

1- From Xcode menu open: Product > Scheme > Edit Scheme

2- On your Environment Variables set OS_ACTIVITY_MODE = disable

The above is detailed more here: Hide strange unwanted Xcode 8 logs

(Sorry if I am totally off, first time poster)

Community
  • 1
  • 1