Skip to content

Commit

Permalink
Merge pull request #393 from storybookjs/docs/define-tags-as-experime…
Browse files Browse the repository at this point in the history
…ntal

Docs: Update tags documentation
  • Loading branch information
yannbf committed Nov 17, 2023
2 parents d2665d1 + bc4821e commit f437e72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Storybook test runner turns all of your stories into executable tests.
- [Render lifecycle](#render-lifecycle)
- [prepare](#prepare)
- [getHttpHeaders](#gethttpheaders)
- [tags](#tags)
- [tags (experimental)](#tags-experimental)
- [Utility functions](#utility-functions)
- [getStoryContext](#getstorycontext)
- [waitForPageReady](#waitforpageready)
Expand Down Expand Up @@ -161,9 +161,9 @@ Usage: test-storybook [options]
| `--ci` | Instead of the regular behavior of storing a new snapshot automatically, it will fail the test and require Jest to be run with `--updateSnapshot`. <br/>`test-storybook --ci` |
| `--shard [shardIndex/shardCount]` | Splits your test suite across different machines to run in CI. <br/>`test-storybook --shard=1/3` |
| `--failOnConsole` | Makes tests fail on browser console errors<br/>`test-storybook --failOnConsole` |
| `--includeTags` | Only test stories that match the specified tags, comma separated<br/>`test-storybook --includeTags="test-only"` |
| `--excludeTags` | Do not test stories that match the specified tags, comma separated<br/>`test-storybook --excludeTags="broken-story,todo"` |
| `--skipTags` | Skip test stories that match the specified tags, comma separated<br/>`test-storybook --skipTags="design"` |
| `--includeTags` | (experimental) Only test stories that match the specified tags, comma separated<br/>`test-storybook --includeTags="test-only"` |
| `--excludeTags` | (experimental) Do not test stories that match the specified tags, comma separated<br/>`test-storybook --excludeTags="broken-story,todo"` |
| `--skipTags` | (experimental) Skip test stories that match the specified tags, comma separated<br/>`test-storybook --skipTags="design"` |

## Ejecting configuration

Expand Down Expand Up @@ -236,7 +236,7 @@ export const Secondary = {
> **Note**
> You can't import constants from another file and use them to define tags in your stories. The tags in your stories or meta **have to be** defined inline, as an array of strings. This is a limitation due to Storybook's static analysis.
Once your stories have your own custom tags, you can filter them via the [tags property](#tags) in your test-runner configuration file. You can also use the CLI flags `--includeTags`, `--excludeTags` or `--skipTags` for the same purpose. The CLI flags will take precedence over the tags in the test-runner config, therefore overriding them.
Once your stories have your own custom tags, you can filter them via the [tags property](#tags-experimental) in your test-runner configuration file. You can also use the CLI flags `--includeTags`, `--excludeTags` or `--skipTags` for the same purpose. The CLI flags will take precedence over the tags in the test-runner config, therefore overriding them.

## Test reporters

Expand Down Expand Up @@ -654,7 +654,7 @@ module.exports = {
};
```

#### tags
#### tags (experimental)

The `tags` property contains three options: `include | exclude | skip`, each accepting an array of strings:

Expand Down
1 change: 1 addition & 0 deletions src/playwright/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface TestRunnerConfig {
prepare?: PrepareSetter;
/**
* Tags to include, exclude, or skip. These tags are defined as annotations in your story or meta.
* @see https://github.com/storybookjs/test-runner#filtering-tests-experimental
*/
tags?: {
include?: string[];
Expand Down

0 comments on commit f437e72

Please sign in to comment.