Skip to content

Commit bb49d02

Browse files
committed
chore(assertView): reuse options info
1 parent 630cd98 commit bb49d02

File tree

4 files changed

+7
-307
lines changed

4 files changed

+7
-307
lines changed

docs/commands/browser/assertView.mdx

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Admonition from "@theme/Admonition";
2+
import AssertViewOptions from "../../_partials/specs/assert-view-options.mdx";
23

34
# assertView
45

@@ -55,108 +56,7 @@ So, assertView without `selector` parameter will take a screenshot of the curren
5556

5657
Specifies the settings for the `assertView` command:
5758

58-
<table>
59-
<thead>
60-
<tr>
61-
<td>**Option**</td>
62-
<td>**Type**</td>
63-
<td>**Description**</td>
64-
</tr>
65-
</thead>
66-
<tbody>
67-
<tr>
68-
<td>ignoreElements</td>
69-
<td>Array or String</td>
70-
<td>
71-
Elements (specified as selectors) that will be ignored when comparing screenshots.
72-
Ignoring is implemented by painting the listed elements black. For a single element,
73-
the parameter can be set as a string.
74-
</td>
75-
</tr>
76-
<tr>
77-
<td>tolerance</td>
78-
<td>Number</td>
79-
<td>
80-
Sensitivity to color differences. The value overrides
81-
[browsers.tolerance][browsers-tolerance].
82-
</td>
83-
</tr>
84-
<tr>
85-
<td>antialiasingTolerance</td>
86-
<td>Number</td>
87-
<td>
88-
Sensitivity to anti-aliasing. The value overrides
89-
[browsers.antialiasingTolerance][browsers-antialiasing-tolerance].
90-
</td>
91-
</tr>
92-
<tr>
93-
<td>allowViewportOverflow</td>
94-
<td>Boolean</td>
95-
<td>
96-
By default, Testplane throws an error if the element is outside the viewport
97-
boundaries. This parameter disables boundary checks, allowing screenshots of
98-
elements that don't fully fit in the viewport. On the screenshot, only the parts of
99-
the element that fit into the viewport will be visible. However, if _compositeImage_
100-
is set to _true_, the parts of the element that are below the viewport boundary will
101-
also be visible in the screenshot. Similarly, if _captureElementFromTop_ is set to
102-
_true_, the parts of the element that are above the viewport boundary will also be
103-
captured in the screenshot.
104-
</td>
105-
</tr>
106-
<tr>
107-
<td>captureElementFromTop</td>
108-
<td>Boolean</td>
109-
<td>
110-
Capture the screenshot of the element from the very top. If the element is outside
111-
the viewport, it will be scrolled into view.
112-
</td>
113-
</tr>
114-
<tr>
115-
<td>compositeImage</td>
116-
<td>Boolean</td>
117-
<td>
118-
If the element does not fit into the viewport, multiple screenshots of different
119-
parts of the element will be taken sequentially, and then stitched together into one
120-
to display the entire element.
121-
</td>
122-
</tr>
123-
<tr>
124-
<td>screenshotDelay</td>
125-
<td>Number</td>
126-
<td>
127-
Delay in milliseconds before taking a screenshot. Useful when there are elements
128-
with animations on the page, or a scrollbar that does not disappear immediately and
129-
appears in the resulting screenshot.
130-
</td>
131-
</tr>
132-
<tr>
133-
<td>selectorToScroll</td>
134-
<td>String</td>
135-
<td>
136-
Selector to scroll. Useful when you need to take a screenshot of a modal window that
137-
doesn’t fit on the screen. Otherwise, without specifying a selector, the scroll will
138-
be applied to the _window_ object, scrolling the background while keeping the popup
139-
window in place.
140-
</td>
141-
</tr>
142-
<tr>
143-
<td>disableAnimation</td>
144-
<td>Boolean</td>
145-
<td>
146-
Disable animations and transitions when taking a screenshot. Default is `true`
147-
starting from version `8.0.0`.
148-
</td>
149-
</tr>
150-
<tr>
151-
<td>ignoreDiffPixelCount</td>
152-
<td>`` `${number}%` `` or Number</td>
153-
<td>
154-
The percentage of pixels to ignore during the diff. Useful to ignore very small
155-
differences. Default is `0`. Available starting from version `8.2.0`.
156-
</td>
157-
</tr>
158-
</tbody>
159-
</table>
59+
<AssertViewOptions />
16060

16161
## Usage Examples {#examples}
16262

docs/commands/element/assertView.mdx

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Admonition from "@theme/Admonition";
2+
import AssertViewOptions from "../../_partials/specs/assert-view-options.mdx";
23

34
# assertView
45

@@ -43,108 +44,7 @@ Required parameter. Specifies the name of the test state. The name must be uniqu
4344

4445
Specifies the settings for the `assertView` command:
4546

46-
<table>
47-
<thead>
48-
<tr>
49-
<td>**Option**</td>
50-
<td>**Type**</td>
51-
<td>**Description**</td>
52-
</tr>
53-
</thead>
54-
<tbody>
55-
<tr>
56-
<td>ignoreElements</td>
57-
<td>Array or String</td>
58-
<td>
59-
Elements (specified as selectors) to be ignored when comparing screenshots. Ignoring
60-
is implemented by painting the listed elements black. For a single element, the
61-
parameter can be set as a string.
62-
</td>
63-
</tr>
64-
<tr>
65-
<td>tolerance</td>
66-
<td>Number</td>
67-
<td>
68-
Sensitivity to color differences. The value overrides
69-
[browsers.tolerance][browsers-tolerance].
70-
</td>
71-
</tr>
72-
<tr>
73-
<td>antialiasingTolerance</td>
74-
<td>Number</td>
75-
<td>
76-
Sensitivity to antialiasing. The value overrides
77-
[browsers.antialiasingTolerance][browsers-antialiasing-tolerance].
78-
</td>
79-
</tr>
80-
<tr>
81-
<td>allowViewportOverflow</td>
82-
<td>Boolean</td>
83-
<td>
84-
By default, Testplane throws an error if the element is outside the viewport
85-
boundaries. This parameter disables boundary checks, allowing screenshots of
86-
elements that don't fully fit in the viewport. Only the portions of the element
87-
visible in the viewport will be shown in the screenshot. However, if
88-
_compositeImage_ is set to _true_, the parts of the element below the viewport
89-
boundary will also be visible in the screenshot. Similarly, if
90-
_captureElementFromTop_ is set to _true_, the parts of the element above the
91-
viewport boundary will also be captured in the screenshot.
92-
</td>
93-
</tr>
94-
<tr>
95-
<td>captureElementFromTop</td>
96-
<td>Boolean</td>
97-
<td>
98-
Capture the screenshot of the element from the very top. If the element is outside
99-
the viewport, it will be scrolled into view.
100-
</td>
101-
</tr>
102-
<tr>
103-
<td>compositeImage</td>
104-
<td>Boolean</td>
105-
<td>
106-
If the element does not fit into the viewport, multiple screenshots of different
107-
parts of the element will be taken sequentially and then stitched together into one
108-
to display the entire element.
109-
</td>
110-
</tr>
111-
<tr>
112-
<td>screenshotDelay</td>
113-
<td>Number</td>
114-
<td>
115-
Delay in milliseconds before taking a screenshot. Useful when there are elements
116-
with animations on the page or a scrollbar that does not disappear immediately and
117-
appears in the resulting screenshot.
118-
</td>
119-
</tr>
120-
<tr>
121-
<td>selectorToScroll</td>
122-
<td>String</td>
123-
<td>
124-
Selector to scroll. Useful when you need to take a screenshot of a modal window that
125-
doesn’t fit on the screen. Without specifying a selector, the scroll will be applied
126-
to the _window_ object, scrolling the background and leaving the popup window in
127-
place.
128-
</td>
129-
</tr>
130-
<tr>
131-
<td>disableAnimation</td>
132-
<td>Boolean</td>
133-
<td>
134-
Disable animations and transitions when taking a screenshot. Default is `true`
135-
starting from version `8.0.0`.
136-
</td>
137-
</tr>
138-
<tr>
139-
<td>ignoreDiffPixelCount</td>
140-
<td>`` `${number}%` `` or Number</td>
141-
<td>
142-
The percentage of pixels to ignore during the diff. Useful to ignore very small
143-
diffs. Default is `0`. Available starting from version `8.2.0`.
144-
</td>
145-
</tr>
146-
</tbody>
147-
</table>
47+
<AssertViewOptions />
14848

14949
## Usage Examples {#examples}
15050

i18n/ru/docusaurus-plugin-content-docs/current/commands/browser/assertView.mdx

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Admonition from "@theme/Admonition";
2+
import AssertViewOptions from "../../_partials/specs/assert-view-options.mdx";
23

34
# assertView
45

@@ -53,108 +54,7 @@ await browser.assertView(state, selector, options);
5354

5455
Задает настройки команды `assertView`:
5556

56-
<table>
57-
<thead>
58-
<tr>
59-
<td>**Опция**</td>
60-
<td>**Тип**</td>
61-
<td>**Описание**</td>
62-
</tr>
63-
</thead>
64-
<tbody>
65-
<tr>
66-
<td>ignoreElements</td>
67-
<td>Array или String</td>
68-
<td>
69-
Элементы (задаются как селекторы), которые будут проигнорированы при сравнении
70-
скриншотов. Игнор реализуется с помощью закраски перечисленных элементов черным
71-
цветом. В случае одного элемента параметр можно задавать как строку.
72-
</td>
73-
</tr>
74-
<tr>
75-
<td>tolerance</td>
76-
<td>Number</td>
77-
<td>
78-
Чувствительность к разнице в цветам. Значение перетирает
79-
[browsers.tolerance][browsers-tolerance].
80-
</td>
81-
</tr>
82-
<tr>
83-
<td>antialiasingTolerance</td>
84-
<td>Number</td>
85-
<td>
86-
Чувствительность в антиалиасинге. Значение перетирает
87-
[browsers.antialiasingTolerance][browsers-antialiasing-tolerance].
88-
</td>
89-
</tr>
90-
<tr>
91-
<td>allowViewportOverflow</td>
92-
<td>Boolean</td>
93-
<td>
94-
По умолчанию Testplane выдает ошибку, если элемент находится за пределами границ
95-
вьюпорта. Этот параметр отключает проверку на границы, позволяя снимать скриншоты
96-
элементов, не влезающих во вьюпорт. При этом на скриншоте будут видны только те
97-
части элемента, которые влезли во вьюпорт. Однако если _compositeImage_ равен
98-
_true_, то части элемента, которые оказались за _нижней_ границей вьюпорта, тоже
99-
будут видны на скриншоте. Аналогично если _captureElementFromTop_ равен _true_, то
100-
на скриншот попадут и те части элемента, которые оказались за пределами _верхней_
101-
границы вьюпорта.
102-
</td>
103-
</tr>
104-
<tr>
105-
<td>captureElementFromTop</td>
106-
<td>Boolean</td>
107-
<td>
108-
Снимать скриншот элемента с самого верха. Если элемент находится за пределами
109-
вьюпорта, то к нему будет выполнен подскролл.
110-
</td>
111-
</tr>
112-
<tr>
113-
<td>compositeImage</td>
114-
<td>Boolean</td>
115-
<td>
116-
Если элемент не влазит во вьюпорт, то при включении этой опции поочередно будет
117-
сделано несколько скриншотов разных частей элемента, после чего скриншоты будут
118-
склеены в один, чтобы отобразить элемент полностью.
119-
</td>
120-
</tr>
121-
<tr>
122-
<td>screenshotDelay</td>
123-
<td>Number</td>
124-
<td>
125-
Задержка в миллисекундах перед снятием скриншота. Может пригодиться, когда на
126-
странице есть элементы, использующие анимацию, или скроллбар, который исчезает не
127-
сразу и попадает на результирующий скриншот.
128-
</td>
129-
</tr>
130-
<tr>
131-
<td>selectorToScroll</td>
132-
<td>String</td>
133-
<td>
134-
Селектор, который нужно скроллировать. Может пригодиться, когда надо сделать
135-
скриншот модального окна, которое не помещается на экране. Иначе без указания
136-
селектора скролл будет применяться к объекту _window_, и скроллироваться будет
137-
задний фон, оставляя попап-окно на месте.
138-
</td>
139-
</tr>
140-
<tr>
141-
<td>disableAnimation</td>
142-
<td>Boolean</td>
143-
<td>
144-
Отключение анимаций и переходов при снятии скриншота. По умолчанию `true` начиная с
145-
версии `8.0.0`.
146-
</td>
147-
</tr>
148-
<tr>
149-
<td>ignoreDiffPixelCount</td>
150-
<td>`` `${number}%` `` или Number</td>
151-
<td>
152-
Процент пикселей, которые нужно игнорировать при диффе. Удобно для игнорирования
153-
очень маленьких диффов. По умолчанию `0`. Доступен начиная с версии `8.2.0`.
154-
</td>
155-
</tr>
156-
</tbody>
157-
</table>
57+
<AssertViewOptions />
15858

15959
## Примеры использования {#examples}
16060

i18n/ru/docusaurus-plugin-content-docs/current/commands/element/assertView.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Admonition from "@theme/Admonition";
2-
import AssertViewOptions from "@site/docs/_partials/specs/assert-view-options.mdx";
2+
import AssertViewOptions from "../../_partials/specs/assert-view-options.mdx";
33

44
# assertView
55

0 commit comments

Comments
 (0)