testplane 8.20.4 → 8.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testplane",
3
- "version": "8.20.4",
3
+ "version": "8.20.5",
4
4
  "description": "Tests framework based on mocha and wdio",
5
5
  "main": "build/src/index.js",
6
6
  "files": [
@@ -1,85 +1,5 @@
1
- import { AssertViewOptsConfig } from "../../config/types";
1
+ import { AssertViewOpts } from "../../config/types";
2
2
  import { ChainablePromiseElement } from "webdriverio";
3
- export interface AssertViewOpts extends Partial<AssertViewOptsConfig> {
4
- /**
5
- * Maximum allowed difference between colors.
6
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#tolerance tolerance} value.
7
- *
8
- * @remarks
9
- * Indicates maximum allowed CIEDE2000 difference between colors. Used only in non-strict mode.
10
- * Increasing global default is not recommended, prefer changing tolerance for particular suites or states instead.
11
- * By default it's 2.3 which should be enough for the most cases.
12
- *
13
- * @defaultValue `2.3`
14
- */
15
- tolerance?: number;
16
- /**
17
- * Minimum difference in brightness (zero by default) between the darkest/lightest pixel (which is adjacent to the antialiasing pixel) and theirs adjacent pixels.
18
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#antialiasingTolerance antialiasingTolerance} value.
19
- *
20
- * @remarks
21
- * Read more about this option in {@link https://github.com/gemini-testing/looks-same#comparing-images-with-ignoring-antialiasing looks-same}
22
- *
23
- * @defaultValue `4`
24
- */
25
- antialiasingTolerance?: number;
26
- /**
27
- * Allows testing of regions which bottom bounds are outside of a viewport height.
28
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#compositeImage compositeImage} value.
29
- *
30
- * @remarks
31
- * In the resulting screenshot the area which fits the viewport bounds will be joined with the area which is outside of the viewport height.
32
- *
33
- * @defaultValue `true`
34
- */
35
- compositeImage?: boolean;
36
- /**
37
- * Allows to specify a delay (in milliseconds) before making any screenshot.
38
- * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#screenshotDelay screenshotDelay} value.
39
- *
40
- * @remarks
41
- * This is useful when the page has elements which are animated or if you do not want to screen a scrollbar.
42
- *
43
- * @defaultValue `0`
44
- */
45
- screenshotDelay?: number;
46
- /**
47
- * Ability to set DOM-node selector which should be scroll when the captured element does not completely fit on the screen.
48
- *
49
- * @remarks
50
- * Useful when you capture the modal (popup). In this case a duplicate of the modal appears on the screenshot.
51
- * That happens because we scroll the page using `window` selector, which scroll only the background of the modal, and the modal itself remains in place.
52
- * Default value is `undefined` (it means scroll relative to `window`). Works only when `compositeImage` is `true` (default).
53
- *
54
- * @defaultValue `undefined`
55
- */
56
- selectorToScroll?: string;
57
- /**
58
- * Ability to disable animations and transitions while making a screenshot
59
- *
60
- * @remarks
61
- * Usefull when you capture screenshot of a page, having animations and transitions.
62
- * Iframe animations are only disabled when using webdriver protocol.
63
- *
64
- * @defaultValue `true`
65
- */
66
- disableAnimation?: boolean;
67
- /**
68
- * Ability to ignore a small amount of different pixels to classify screenshots as being "identical"
69
- *
70
- * @example 5
71
- * @example '1.5%'
72
- *
73
- * @remarks
74
- * Useful when you encounter a few pixels difference that cannot be eliminated using the tolerance and antialiasingTolerance settings.
75
- *
76
- * @note
77
- * This should be considered a last resort and only used in small number of cases where necessary.
78
- *
79
- * @defaultValue `0`
80
- */
81
- ignoreDiffPixelCount?: `${number}%` | number;
82
- }
83
3
  export type AssertViewCommandWithSelector = (this: WebdriverIO.Browser, state: string, selectors: string | string[], opts?: AssertViewOpts) => Promise<void>;
84
4
  export type AssertViewCommandWithoutSelector = (this: WebdriverIO.Browser, state: string, opts?: AssertViewOpts) => Promise<void>;
85
5
  export type AssertViewCommand = AssertViewCommandWithSelector & AssertViewCommandWithoutSelector;
@@ -14,13 +14,13 @@ export interface BuildDiffOptsConfig {
14
14
  ignoreAntialiasing: boolean;
15
15
  ignoreCaret: boolean;
16
16
  }
17
- export interface AssertViewOptsConfig {
17
+ export interface AssertViewOpts {
18
18
  /**
19
19
  * DOM-node selectors which will be ignored (painted with a black rectangle) when comparing images.
20
20
  *
21
21
  * @defaultValue `[]`
22
22
  */
23
- ignoreElements: string | Array<string>;
23
+ ignoreElements?: string | Array<string>;
24
24
  /**
25
25
  * Ability to set capture element from the top area or from current position.
26
26
  *
@@ -29,7 +29,7 @@ export interface AssertViewOptsConfig {
29
29
  *
30
30
  * @defaultValue `true`
31
31
  */
32
- captureElementFromTop: boolean;
32
+ captureElementFromTop?: boolean;
33
33
  /**
34
34
  * Disables check that element is outside of the viewport left, top, right or bottom bounds.
35
35
  *
@@ -41,7 +41,85 @@ export interface AssertViewOptsConfig {
41
41
  *
42
42
  * @defaultValue `false`
43
43
  */
44
- allowViewportOverflow: boolean;
44
+ allowViewportOverflow?: boolean;
45
+ /**
46
+ * Maximum allowed difference between colors.
47
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#tolerance tolerance} value.
48
+ *
49
+ * @remarks
50
+ * Indicates maximum allowed CIEDE2000 difference between colors. Used only in non-strict mode.
51
+ * Increasing global default is not recommended, prefer changing tolerance for particular suites or states instead.
52
+ * By default it's 2.3 which should be enough for the most cases.
53
+ *
54
+ * @defaultValue `2.3`
55
+ */
56
+ tolerance?: number;
57
+ /**
58
+ * Minimum difference in brightness (zero by default) between the darkest/lightest pixel (which is adjacent to the antialiasing pixel) and theirs adjacent pixels.
59
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#antialiasingTolerance antialiasingTolerance} value.
60
+ *
61
+ * @remarks
62
+ * Read more about this option in {@link https://github.com/gemini-testing/looks-same#comparing-images-with-ignoring-antialiasing looks-same}
63
+ *
64
+ * @defaultValue `4`
65
+ */
66
+ antialiasingTolerance?: number;
67
+ /**
68
+ * Allows testing of regions which bottom bounds are outside of a viewport height.
69
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#compositeImage compositeImage} value.
70
+ *
71
+ * @remarks
72
+ * In the resulting screenshot the area which fits the viewport bounds will be joined with the area which is outside of the viewport height.
73
+ *
74
+ * @defaultValue `true`
75
+ */
76
+ compositeImage?: boolean;
77
+ /**
78
+ * Allows to specify a delay (in milliseconds) before making any screenshot.
79
+ * Overrides config {@link https://github.com/gemini-testing/testplane#browsers browsers}.{@link https://github.com/gemini-testing/testplane#screenshotDelay screenshotDelay} value.
80
+ *
81
+ * @remarks
82
+ * This is useful when the page has elements which are animated or if you do not want to screen a scrollbar.
83
+ *
84
+ * @defaultValue `0`
85
+ */
86
+ screenshotDelay?: number;
87
+ /**
88
+ * Ability to set DOM-node selector which should be scroll when the captured element does not completely fit on the screen.
89
+ *
90
+ * @remarks
91
+ * Useful when you capture the modal (popup). In this case a duplicate of the modal appears on the screenshot.
92
+ * That happens because we scroll the page using `window` selector, which scroll only the background of the modal, and the modal itself remains in place.
93
+ * Default value is `undefined` (it means scroll relative to `window`). Works only when `compositeImage` is `true` (default).
94
+ *
95
+ * @defaultValue `undefined`
96
+ */
97
+ selectorToScroll?: string;
98
+ /**
99
+ * Ability to disable animations and transitions while making a screenshot
100
+ *
101
+ * @remarks
102
+ * Usefull when you capture screenshot of a page, having animations and transitions.
103
+ * Iframe animations are only disabled when using webdriver protocol.
104
+ *
105
+ * @defaultValue `true`
106
+ */
107
+ disableAnimation?: boolean;
108
+ /**
109
+ * Ability to ignore a small amount of different pixels to classify screenshots as being "identical"
110
+ *
111
+ * @example 5
112
+ * @example '1.5%'
113
+ *
114
+ * @remarks
115
+ * Useful when you encounter a few pixels difference that cannot be eliminated using the tolerance and antialiasingTolerance settings.
116
+ *
117
+ * @note
118
+ * This should be considered a last resort and only used in small number of cases where necessary.
119
+ *
120
+ * @defaultValue `0`
121
+ */
122
+ ignoreDiffPixelCount?: `${number}%` | number;
45
123
  }
46
124
  export interface ExpectOptsConfig {
47
125
  wait: number;
@@ -124,7 +202,7 @@ export interface CommonConfig {
124
202
  antialiasingTolerance: number;
125
203
  compareOpts: CompareOptsConfig;
126
204
  buildDiffOpts: BuildDiffOptsConfig;
127
- assertViewOpts: AssertViewOptsConfig;
205
+ assertViewOpts: AssertViewOpts;
128
206
  expectOpts: ExpectOptsConfig;
129
207
  meta: {
130
208
  [name: string]: unknown;
@@ -5,9 +5,9 @@ import "expect-webdriverio";
5
5
  import { GlobalHelper } from "./types";
6
6
  export { Testplane as default } from "./testplane";
7
7
  export { Key } from "webdriverio";
8
- export type { WdioBrowser, TestResult, Test, Suite, TestError, AssertViewOpts, HermioneCtx, GlobalHelper, TestplaneCtx, TestFunctionCtx, } from "./types";
8
+ export type { WdioBrowser, TestResult, Test, Suite, TestError, HermioneCtx, GlobalHelper, TestplaneCtx, TestFunctionCtx, } from "./types";
9
9
  export type { Config } from "./config";
10
- export type { ConfigInput } from "./config/types";
10
+ export type { ConfigInput, AssertViewOpts } from "./config/types";
11
11
  export type { TestCollection, FormatterTreeSuite, FormatterTreeTest, FormatterTreeMainRunnable, FormatterListTest, } from "./test-collection";
12
12
  export type { StatsResult } from "./stats";
13
13
  import type { TestDefinition, SuiteDefinition, TestHookDefinition } from "./test-reader/test-object/types";
@@ -19,7 +19,6 @@ export type { Browser as WdioBrowser } from "webdriverio";
19
19
  export type { Test } from "../test-reader/test-object/test";
20
20
  export type { Suite } from "../test-reader/test-object/suite";
21
21
  export type { TestFunctionCtx } from "../test-reader/test-object/types";
22
- export type { AssertViewOpts } from "../browser/commands/types";
23
22
  export interface RootSuite extends Suite {
24
23
  root: true;
25
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AA0GA,IAAY,WAYX;AAZD,WAAY,WAAW;IACnB,yBAAU,CAAA;IACV,yBAAU,CAAA;IACV,0BAAW,CAAA;IACX,6BAAc,CAAA;IACd,+BAAgB,CAAA;IAChB,6BAAc,CAAA;IACd,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,wBAAS,CAAA;AACb,CAAC,EAZW,WAAW,2BAAX,WAAW,QAYtB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAwGA,IAAY,WAYX;AAZD,WAAY,WAAW;IACnB,yBAAU,CAAA;IACV,yBAAU,CAAA;IACV,0BAAW,CAAA;IACX,6BAAc,CAAA;IACd,+BAAgB,CAAA;IAChB,6BAAc,CAAA;IACd,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,wBAAS,CAAA;AACb,CAAC,EAZW,WAAW,2BAAX,WAAW,QAYtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testplane",
3
- "version": "8.20.4",
3
+ "version": "8.20.5",
4
4
  "description": "Tests framework based on mocha and wdio",
5
5
  "main": "build/src/index.js",
6
6
  "files": [