---
title: ConditionTrait
framework: testing
role: symbol
role_heading: Structure
path: testing/conditiontrait
---

# ConditionTrait

A type that defines a condition which must be satisfied for the testing library to enable a test.

## Declaration

```swift
struct ConditionTrait
```

## Mentioned in

Migrating a test from XCTest

## Overview

Overview To add this trait to a test, use one of the following functions: enabled(if:_:sourceLocation:) enabled(_:sourceLocation:_:) disabled(_:sourceLocation:) disabled(if:_:sourceLocation:) disabled(_:sourceLocation:_:)

## Topics

### Instance Properties

- [sourceLocation](testing/conditiontrait/sourcelocation.md)

### Instance Methods

- [evaluate()](testing/conditiontrait/evaluate().md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SuiteTrait](testing/suitetrait.md)
- [TestTrait](testing/testtrait.md)
- [Trait](testing/trait.md)

## See Also

### Supporting types

- [Bug](testing/bug.md)
- [Comment](testing/comment.md)
- [IssueHandlingTrait](testing/issuehandlingtrait.md)
- [ParallelizationTrait](testing/parallelizationtrait.md)
- [Tag](testing/tag.md)
- [Tag.List](testing/tag/list.md)
- [TimeLimitTrait](testing/timelimittrait.md)
