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
<tr><td>[state](#state)</td><td>String</td><td>Обязательный параметр. Название состояния теста. Должно быть уникальным в пределах одного теста.</td></tr>
27
-
<tr><td>[selector](#selector)</td><td>String или String[]</td><td>Обязательный параметр. Селектор DOM-элемента, который необходимо заснять.</td></tr>
28
+
<tr><td>[selector](#selector)</td><td>String или String[]</td><td>Необязательный параметр. Может быть пропущен. Селектор DOM-элемента, который необходимо заснять. При отсутствии команда скриншотит viewport.</td></tr>
28
29
<tr><td>[options](#options)</td><td>Object</td><td>Настройки команды _assertView_.</td></tr>
Обязательный параметр. Задает селектор DOM-элемента, который необходимо заснять.
40
+
Необязательный параметр. Может быть пропущен. Задает селектор DOM-элемента, который необходимо заснять. По умолчанию `body`. При его отсутствии `assertView` применяет следующие опции, которые имеют приоритет над `assertViewOpts` из конфига, но не над параметром `options`:
41
+
42
+
```
43
+
{
44
+
allowViewportOverflow: true,
45
+
compositeImage: false,
46
+
captureElementFromTop: false
47
+
}
48
+
```
49
+
50
+
Таким образом, по умолчанию без параметра `options``assertView` скриншотит viewport.
<tr><td>[state](#state)</td><td>String</td><td>Required parameter. The name of the test state. It must be unique within a single test.</td></tr>
28
-
<tr><td>[selector](#selector)</td><td>String or String[]</td><td>Required parameter. The DOM element selector to capture.</td></tr>
29
+
<tr><td>[selector](#selector)</td><td>String or String[]</td><td>Optional parameter. Can be skipped. The DOM element selector to capture. If skipped, current viewport is captured.</td></tr>
29
30
<tr><td>[options](#options)</td><td>Object</td><td>Settings for the _assertView_ command.</td></tr>
30
31
31
32
</tbody>
@@ -37,7 +38,18 @@ Required parameter. Specifies the name of the test state. The name must be uniqu
37
38
38
39
### selector
39
40
40
-
Required parameter. Specifies the selector of the DOM element to capture.
41
+
Required parameter. Specifies the selector of the DOM element to capture. If not specified or skipped, will be set to `body` and the following options will be automatically added to `options`:
42
+
43
+
```
44
+
{
45
+
allowViewportOverflow: true,
46
+
compositeImage: false,
47
+
captureElementFromTop: false
48
+
}
49
+
```
50
+
51
+
These additional options will have higher priority than `assertViewOpts` from config, but lower priority than options from `options` parameter passed by user.
52
+
So, assertView without `selector` parameter will take a screenshot of the current viewport.
41
53
42
54
### options
43
55
@@ -148,9 +160,9 @@ Specifies the settings for the `assertView` command:
0 commit comments