Skip to content

Commit 357bd27

Browse files
authored
docs: add documentation for test subsets (#56)
1 parent cd342c7 commit 357bd27

File tree

3 files changed

+165
-17
lines changed

3 files changed

+165
-17
lines changed

tools/wave/docs/config.md

Lines changed: 165 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ parameters and what they are used for.
2020
10. [Host override](#210-host-override)
2121
11. [Enable test type selection](#211-enable-test-type-selection)
2222
12. [Tests base URL](#212-tests-base-url)
23+
3. [Test Subsets](#3-test-subsets)
24+
1. [Define a subset](#31-define-a-subset)
25+
2. [Make subset selectable](#32-make-subset-selectable)
26+
3. [Default subsets](#33-default-subsets)
27+
4. [Tags and filters](#34-tags-and-filters)
28+
5. [Default filters](#35-default-filters)
29+
6. [Messages](#36-messages)
2330

2431
## 1. Location and structure
2532

@@ -64,7 +71,8 @@ directory:
6471
}
6572
}
6673
```
67-
[🠑 top](#configuration---wave-test-runner)
74+
75+
[▲ top](#configuration---wave-test-runner)
6876

6977
## 2. Parameters
7078

@@ -91,7 +99,7 @@ The results parameter sets where results and session information are stored.
9199
}
92100
```
93101

94-
[🠑 top](#configuration---wave-test-runner)
102+
[ top](#configuration---wave-test-runner)
95103

96104
### 2.2 Test Timeouts
97105

@@ -123,7 +131,7 @@ The test timeouts set the default test timeout for different test types.
123131
}
124132
```
125133

126-
[🠑 top](#configuration---wave-test-runner)
134+
[ top](#configuration---wave-test-runner)
127135

128136
### 2.3 Enable import of results
129137

@@ -148,7 +156,7 @@ WAVE Test Runner instances into the current one.
148156
}
149157
```
150158

151-
[🠑 top](#configuration---wave-test-runner)
159+
[ top](#configuration---wave-test-runner)
152160

153161
### 2.4 Web namespace
154162

@@ -174,7 +182,7 @@ parameter.
174182
}
175183
```
176184

177-
[🠑 top](#configuration---wave-test-runner)
185+
[ top](#configuration---wave-test-runner)
178186

179187
### 2.5 Persisting interval
180188

@@ -205,7 +213,7 @@ state.
205213
}
206214
```
207215

208-
[🠑 top](#configuration---wave-test-runner)
216+
[ top](#configuration---wave-test-runner)
209217

210218
### 2.6 API titles
211219

@@ -256,7 +264,7 @@ a name to an API subdirectory.
256264
}
257265
```
258266

259-
[🠑 top](#configuration---wave-test-runner)
267+
[ top](#configuration---wave-test-runner)
260268

261269
### 2.7 Enable listing all sessions
262270

@@ -280,7 +288,7 @@ This parameter enables the [REST API endpoint to list all available sessions](./
280288
}
281289
```
282290

283-
[🠑 top](#configuration---wave-test-runner)
291+
[ top](#configuration---wave-test-runner)
284292

285293
### 2.8 Event caching duration
286294

@@ -306,12 +314,11 @@ accordingly.
306314
}
307315
```
308316

309-
[🠑 top](#configuration---wave-test-runner)
310-
317+
[▲ top](#configuration---wave-test-runner)
311318

312319
### 2.9 Pre test control page delay
313320

314-
This parameter specifies how long the pre-test control pages is active before
321+
This parameter specifies how long the pre-test control pages is active before
315322
redirecting to the actual test.
316323

317324
**Parameters**:
@@ -332,12 +339,12 @@ redirecting to the actual test.
332339
}
333340
```
334341

335-
[🠑 top](#configuration---wave-test-runner)
342+
[ top](#configuration---wave-test-runner)
336343

337344
### 2.10 Host override
338345

339-
The `host_override` parameter overrides the hostname of the wpt runner. This
340-
can be used to configure the access to the test runner using a static IP
346+
The `host_override` parameter overrides the hostname of the wpt runner. This
347+
can be used to configure the access to the test runner using a static IP
341348
address. As it is just an override, a proper host file setup as described
342349
[here](https://web-platform-tests.org/running-tests/from-local-system.html#hosts-file-setup)
343350
is still required.
@@ -356,7 +363,7 @@ is still required.
356363

357364
None
358365

359-
[🠑 top](#configuration---wave-test-runner)
366+
[ top](#configuration---wave-test-runner)
360367

361368
### 2.11 Enable test type selection
362369

@@ -376,7 +383,7 @@ Sets display of test type configuration UI elements.
376383

377384
False
378385

379-
[🠑 top](#configuration---wave-test-runner)
386+
[ top](#configuration---wave-test-runner)
380387

381388
### 2.12 Tests base URL
382389

@@ -396,4 +403,145 @@ Sets the base URL for links to test implementation URLs in generated reports
396403

397404
Empty String
398405

399-
[🠑 top](#configuration---wave-test-runner)
406+
[▲ top](#configuration---wave-test-runner)
407+
408+
## 3. Test Subsets
409+
410+
The `test-subsets.json`, in the root of the test runner directory, allows to define subsets of tests. These subsets are used in the session configuration page to quickly select these subsets or add tags to the tests to filter them.
411+
412+
[▲ top](#configuration---wave-test-runner)
413+
414+
### 3.1 Define a subset
415+
416+
To define a subset use the json structure as follows:
417+
418+
```json
419+
{
420+
"subsets": [
421+
{
422+
"tests": ["/path/to/test.html"]
423+
}
424+
]
425+
}
426+
```
427+
428+
It is also possible to use wildcards in the path:
429+
430+
```json
431+
{
432+
"subsets": [
433+
{
434+
"tests": ["/path/to/directory/*", "*-manual.html"]
435+
}
436+
]
437+
}
438+
```
439+
440+
[▲ top](#configuration---wave-test-runner)
441+
442+
### 3.2 Make subset selectable
443+
444+
To make a defined subset available for selection in the configuration page, you have to assign it a title:
445+
446+
```json
447+
{
448+
"subsets": [
449+
{
450+
"title": "Selectable subset",
451+
"tests": ["/path/to/test.html"]
452+
}
453+
]
454+
}
455+
```
456+
457+
![Config page subset select](./res/configuration_page_subset_select.png)
458+
459+
[▲ top](#configuration---wave-test-runner)
460+
461+
### 3.3 Default subsets
462+
463+
Defining a subset as default subset will select it automatically when opening the configuration page.
464+
465+
```json
466+
{
467+
"subsets": [
468+
{
469+
"default_subset": true,
470+
"tests": ["/path/to/test.html"]
471+
}
472+
]
473+
}
474+
```
475+
476+
[▲ top](#configuration---wave-test-runner)
477+
478+
### 3.4 Tags and filters
479+
480+
A subset can be used to apply tags to tests, which can be filtered:
481+
482+
```json
483+
{
484+
"subsets": [
485+
{
486+
"tag": {
487+
"title": "my tag",
488+
"color": "warning"
489+
},
490+
"tests": ["/test-group-a/*"]
491+
}
492+
]
493+
}
494+
```
495+
496+
![alt text](./res/configuration_page_tags.png)
497+
498+
[▲ top](#configuration---wave-test-runner)
499+
500+
### 3.5 Default filters
501+
502+
Defining a default filter automatically activates it when opening the configuration page:
503+
504+
```json
505+
{
506+
"subsets": [
507+
{
508+
"tag": {
509+
"title": "my tag",
510+
"color": "warning",
511+
"default_filter": true
512+
},
513+
"tests": ["/test-group-a/*"]
514+
}
515+
]
516+
}
517+
```
518+
519+
For possible colors click [here](https://bulma.io/documentation/elements/tag/#colors)
520+
521+
[▲ top](#configuration---wave-test-runner)
522+
523+
### 3.6 Messages
524+
525+
Defining a messages shows a corresponding message box whenever a test from this subset is selected:
526+
527+
```json
528+
{
529+
"subsets": [
530+
{
531+
"tag": {
532+
"title": "my tag",
533+
"color": "warning"
534+
},
535+
"message": {
536+
"text": "Text to display in the message box. [Link](https://link.somwhere/)",
537+
"color": "info"
538+
},
539+
"tests": ["/test-group-a/*"]
540+
}
541+
]
542+
}
543+
```
544+
545+
For possible colors click [here](https://bulma.io/documentation/components/message/#colors)
546+
547+
[▲ top](#configuration---wave-test-runner)
17.2 KB
Loading
16.7 KB
Loading

0 commit comments

Comments
 (0)