OLD | NEW |
1 Each package may include a configuration file that applies to the package as a | 1 Each package may include a configuration file that applies to the package as a |
2 whole. This file can be used to provide custom defaults for various options, to | 2 whole. This file can be used to provide custom defaults for various options, to |
3 define configuration for multiple files, and more. | 3 define configuration for multiple files, and more. |
4 | 4 |
5 The file is named `dart_test.yaml` and lives at the root of the package, next to | 5 The file is named `dart_test.yaml` and lives at the root of the package, next to |
6 the package's pubspec. Like the pubspec, it's a [YAML][] file. Here's an | 6 the package's pubspec. Like the pubspec, it's a [YAML][] file. Here's an |
7 example: | 7 example: |
8 | 8 |
9 [YAML]: http://yaml.org/ | 9 [YAML]: http://yaml.org/ |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 * [`verbose_trace`](#verbose_trace) | 29 * [`verbose_trace`](#verbose_trace) |
30 * [`js_trace`](#js_trace) | 30 * [`js_trace`](#js_trace) |
31 * [Runner Configuration](#runner-configuration) | 31 * [Runner Configuration](#runner-configuration) |
32 * [`paths`](#paths) | 32 * [`paths`](#paths) |
33 * [`filename`](#filename) | 33 * [`filename`](#filename) |
34 * [`platforms`](#platforms) | 34 * [`platforms`](#platforms) |
35 * [`concurrency`](#concurrency) | 35 * [`concurrency`](#concurrency) |
36 * [`pub_serve`](#pub_serve) | 36 * [`pub_serve`](#pub_serve) |
37 * [`reporter`](#reporter) | 37 * [`reporter`](#reporter) |
38 * [Configuring Tags](#configuring-tags) | 38 * [Configuring Tags](#configuring-tags) |
| 39 * [`add_tags`](#add_tags) |
39 | 40 |
40 ## Test Configuration | 41 ## Test Configuration |
41 | 42 |
42 There are two major categories of configuration field: "test" and "runner". Test | 43 There are two major categories of configuration field: "test" and "runner". Test |
43 configuration controls how individual tests run, while | 44 configuration controls how individual tests run, while |
44 [runner configuration](#runner-configuration) controls the test runner as a | 45 [runner configuration](#runner-configuration) controls the test runner as a |
45 whole. Both types of fields may be used at the top level of a configuration | 46 whole. Both types of fields may be used at the top level of a configuration |
46 file. However, because different tests can have different test configuration, | 47 file. However, because different tests can have different test configuration, |
47 only test configuration fields may be used to | 48 only test configuration fields may be used to |
48 [configure tags](#configuring-tags). | 49 [configure tags](#configuring-tags). |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 212 |
212 Tag configuration is applied at whatever level the tag appears—so if a group is | 213 Tag configuration is applied at whatever level the tag appears—so if a group is |
213 tagged as `integration`, its timeout will take precedence over the suite's | 214 tagged as `integration`, its timeout will take precedence over the suite's |
214 timeout but not any tests'. If the group itself had a timeout declared, the | 215 timeout but not any tests'. If the group itself had a timeout declared, the |
215 group's explicit timeout would take precedence over the tag. | 216 group's explicit timeout would take precedence over the tag. |
216 | 217 |
217 If multiple tags appear at the same level, and they have conflicting | 218 If multiple tags appear at the same level, and they have conflicting |
218 configurations, the test runner *does not guarantee* what order they'll be | 219 configurations, the test runner *does not guarantee* what order they'll be |
219 resolved in. In practice, conflicting configuration is pretty unlikely and it's | 220 resolved in. In practice, conflicting configuration is pretty unlikely and it's |
220 easy to just explicitly specify what you want on the test itself. | 221 easy to just explicitly specify what you want on the test itself. |
| 222 |
| 223 ### `add_tags` |
| 224 |
| 225 This field adds additional tags. It's technically |
| 226 [test configuration](#test-configuration), but it's usually used in more |
| 227 specific contexts. For example, when included in a tag's configuration, it can |
| 228 be used to enable tag inheritance, where adding one tag implicitly adds other as |
| 229 well. It takes a list of tag name strings. |
| 230 |
| 231 ```yaml |
| 232 tags: |
| 233 # Any test that spawns a browser. |
| 234 browser: |
| 235 timeout: 2x |
| 236 |
| 237 # Tests that spawn specific browsers. These automatically get the browser tag |
| 238 # as well. |
| 239 chrome: {add_tags: [browser]} |
| 240 firefox: {add_tags: [browser]} |
| 241 safari: {add_tags: [browser]} |
| 242 ie: {add_tags: [browser]} |
| 243 ``` |
OLD | NEW |