You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<td>Run multiple auto-screenshot tests with different [storybook globals](https://storybook.js.org/docs/7/essentials/toolbars-and-globals#globals)</td>
99
+
</tr>
88
100
<tr>
89
101
<td>localport</td>
90
102
<td>`Number`</td>
@@ -113,6 +125,28 @@ With this minimal config, you will be able to run `npx testplane --storybook` to
113
125
unconditionally.
114
126
</Admonition>
115
127
128
+
#### autoScreenshotStorybookGlobals
129
+
130
+
For example, with `autoScreenshotStorybookGlobals` set to:
131
+
132
+
```json
133
+
{
134
+
"default": {},
135
+
"light theme": {
136
+
"theme": "light"
137
+
},
138
+
"dark theme": {
139
+
"theme": "dark"
140
+
}
141
+
}
142
+
```
143
+
144
+
3 autoscreenshot tests will be generated for each story, each test having its corresponding storybook globals value:
145
+
146
+
-`... Autoscreenshot default`
147
+
-`... Autoscreenshot light theme`
148
+
-`... Autoscreenshot dark theme`
149
+
116
150
## Advanced usage
117
151
118
152
If you have `ts-node` in your project, you can write your Testplane tests right inside of storybook story files:
<td>Комплекты [глобальных параметров storybook](https://storybook.js.org/docs/7/essentials/toolbars-and-globals#globals), для каждого из которых следует генерировать автоматические скриншотные тесты</td>
87
99
</tr>
88
100
<tr>
89
101
<td>localport</td>
@@ -114,6 +126,28 @@ export default {
114
126
будет отключена принудительно для оптимизации скорости прохождения тестов.
115
127
</Admonition>
116
128
129
+
#### autoScreenshotStorybookGlobals
130
+
131
+
К примеру, с `autoScreenshotStorybookGlobals` со значением:
132
+
133
+
```json
134
+
{
135
+
"default": {},
136
+
"light theme": {
137
+
"theme": "light"
138
+
},
139
+
"dark theme": {
140
+
"theme": "dark"
141
+
}
142
+
}
143
+
```
144
+
145
+
Для каждой стори будут сгенерированы 3 автоскриншотных теста, каждый из которых устанавливает соответствующие глобальные параметры сторибука:
146
+
147
+
-`... Autoscreenshot default`
148
+
-`... Autoscreenshot light theme`
149
+
-`... Autoscreenshot dark theme`
150
+
117
151
## Продвинутое использование
118
152
119
153
Если на Вашем проекте используется `ts-node`, то Вы можете писать testplane-тесты прямо внутри истории:
0 commit comments