---
title: Content Test
description: "A content test allows you to create a rule that checks the text of an element to see if it applies. The following variations are available: | test | description | | --- | --- | | contains | the…"
url: "https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/content-test/"
updated: "2021-04-25"
category: Rules / Types of Tests Used in Rules
tags:
  - Rules
---

# Content Test

A content test allows you to create a rule that checks the text of an element to see if it applies. The following variations are available:

| test | description |
| --- | --- |
| contains | the element contains the indicated text anywhere within it |
| ends with | the element ends with the indicated text |
| equals | the element contains precisely the indicated text with nothing extra before or after |
| matches | the element's content matches the provided pattern |
| starts with | the element begins with the indicated text |

For more information on patterns see [Patterns](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/patterns/)

*Example: content starts with test*

[![content starts with test](https://www.stilo.com/wp-content/uploads/2021/03/content-starts-with-test.png)](https://www.stilo.com/wp-content/uploads/2021/03/content-starts-with-test.png)

#### Prerequisite Concepts

- [Edit Mode](https://www.stilo.com/docs/migrate/getting-started-rules/edit-mode/)
- [Rule Conditions](https://www.stilo.com/docs/migrate/getting-started-rules/rule-conditions/)

#### Supporting Reference Material

- [Style Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/style-test/)
- [Property Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/property-test/)
- [Logical Group Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/logical-group-test/)
- [Context Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/context-test/)
- [Contains Element Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/contains-element-test/)
- [Patterns](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/patterns/)

#### Related Tasks

- [Deleting a Rule](https://www.stilo.com/docs/migrate/editing-rules/deleting-a-rule/)
- [Turning a rule on or off](https://www.stilo.com/docs/migrate/editing-rules/turning-a-rule-on-or-off/)
- [Commenting a rule](https://www.stilo.com/docs/migrate/editing-rules/commenting-a-rule/)
- [Adding a Test in a Condition](https://www.stilo.com/docs/migrate/editing-rules/adding-a-test-in-a-condition/)
- [Deleting a Test From a Condition](https://www.stilo.com/docs/migrate/editing-rules/deleting-a-test-from-a-condition/)
- [Moving a Test in a Condition](https://www.stilo.com/docs/migrate/editing-rules/moving-a-test-in-a-condition/)
- [Adding an Annotation](https://www.stilo.com/docs/migrate/editing-rules/adding-an-annotation/)
- [Deleting an Annotation](https://www.stilo.com/docs/migrate/editing-rules/deleting-an-annotation/)
- [Moving an Annotation](https://www.stilo.com/docs/migrate/editing-rules/moving-an-annotation/)
