top of page

Cypress Test Tags

Tags help organize and filter tests so you can run only what you need.


Examples:

  • smoke

  • regression

  • api

  • auth

  • critical

  • mobile


Unlike some frameworks, Cypress does not have built-in tagging. Instead, it recommends using the @cypress/grep plugin.


Installing tag support

Registering the plugin


In cypress/support/e2e.js:


Tagging tests


Tag a suite

Tag individual tests

Running tests by tag


Run only smoke tests:

Run only auth tests:

You can also filter by test titles using grep.


NPM scripts example

This makes it easy to run subsets locally or in CI.


Using sessions and tags together

  • tags define what kind of test it is

  • sessions make it fast and reusable


Good tagging strategy


Keep it simple.


Useful tags:

  • @smoke

  • @regression

  • @api

  • @auth

  • @critical


Too many tags create confusion and lose value.

 
 
bottom of page