> For the complete documentation index, see [llms.txt](https://docs.testery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testery.io/get-to-know-testery/test-runs/test-selection-rules.md).

# Test Selection Rules

The Test Selection feature enables your team to run a subset of the tests based on changes made to the source files.

In order to start using this feature, your repository should have a `testery.yml` file defined. This file should include a section as described below.

When running tests from the UI, be sure to select the "Use testery.yml" option.

<figure><img src="/files/yAG22oB5lebJOjtNVi1f" alt=""><figcaption></figcaption></figure>

### testery.yml syntax for defining test selection rules

```
test_selection:
  suites:
    - default:
      rules:
        - employeeRule:
          when:
            - src_changes:
                - "src/employees/*"
          then:
            - include_tags:
                - "employees"
                - "smoke"   
        - itemRule:
          when:
            - src_changes:
                - "src/items/*"
          then:
            - include_tags:
                - "items"
```

Currently, Testery supports 1 suite of rules, named "default". Within the suite, you'll need a list of "rules". Each rule has a "when" and a "then".

#### When Conditions

When conditions are used to trigger a set of tests to be selected.

* **src\_changes** - This trigger will apply a glob expression to the list of files changed in the code branch.

#### Then Conditions

Then conditions refine the tests that will be selected

* **include\_tags**: If your testing framework supports tags, then this can be used to specify the tags that will be included in the test run
* **exclude\_tags:** If your testing framework supports tags, then this can be used to specify the tags that will be excluded in the test run
* **test\_filters:** A glob expression that can be applied to choose the tests to run
