<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestObservation/testCaseDidFinish(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(pl)XCTestObservation(im)testCaseDidFinish:"
  },
  "title" : "testCaseDidFinish(_:)"
}
-->

# testCaseDidFinish(_:)

Notifies the observer immediately after a test case finishes executing.

```
optional func testCaseDidFinish(_ testCase: XCTestCase)
```

## Parameters

`testCase`

The test case that finished executing. Additional information about the test case can be retrieved from the test case’s associated [`XCTestRun`](/documentation/XCTest/XCTestRun).

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)