@applitools/eyes-cypress 3.24.0-beta.5 → 3.25.0
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.
- package/CHANGELOG.md +2191 -2195
- package/LICENSE +25 -25
- package/README.md +803 -782
- package/bin/eyes-setup.js +21 -21
- package/commands.js +2 -2
- package/dist/browser/spec-driver.js +110 -106
- package/dist/plugin/handler.js +55 -55
- package/eyes-index.d.ts +34 -34
- package/index.js +2 -2
- package/package.json +98 -97
- package/src/browser/commands.js +188 -188
- package/src/browser/eyesCheckMapping.js +104 -103
- package/src/browser/eyesOpenMapping.js +60 -60
- package/src/browser/makeSend.js +18 -18
- package/src/browser/refer.js +57 -57
- package/src/browser/sendRequest.js +16 -16
- package/src/browser/socket.js +144 -143
- package/src/browser/socketCommands.js +81 -81
- package/src/browser/spec-driver.ts +117 -111
- package/src/pem/server.cert +22 -22
- package/src/pem/server.key +27 -27
- package/src/plugin/concurrencyMsg.js +8 -8
- package/src/plugin/config.js +54 -54
- package/src/plugin/defaultPort.js +1 -1
- package/src/plugin/errorDigest.js +96 -96
- package/src/plugin/getErrorsAndDiffs.js +34 -34
- package/src/plugin/handleTestResults.js +35 -39
- package/src/plugin/handler.ts +58 -58
- package/src/plugin/hooks.js +51 -50
- package/src/plugin/isGlobalHooksSupported.js +13 -13
- package/src/plugin/pluginExport.js +60 -60
- package/src/plugin/server.js +98 -98
- package/src/plugin/startPlugin.js +15 -13
- package/src/plugin/webSocket.js +130 -130
- package/src/setup/addEyesCommands.js +24 -24
- package/src/setup/addEyesCypressPlugin.js +15 -15
- package/src/setup/getCypressConfig.js +16 -16
- package/src/setup/getFilePath.js +22 -22
- package/src/setup/handleCommands.js +23 -23
- package/src/setup/handlePlugin.js +23 -23
- package/src/setup/handleTypeScript.js +21 -21
- package/src/setup/isCommandsDefined.js +7 -7
- package/src/setup/isPluginDefined.js +7 -7
- package/test/fixtures/testAppCopies/.gitignore +1 -1
|
@@ -1,112 +1,118 @@
|
|
|
1
|
-
type EyesSelector = {selector: string; type?: string}
|
|
2
|
-
export type Selector = (string | EyesSelector) & {__applitoolsBrand?: never};
|
|
3
|
-
export type Context = Document & {__applitoolsBrand?: never};
|
|
4
|
-
export type Element = HTMLElement & {__applitoolsBrand?: never};
|
|
5
|
-
|
|
6
|
-
export function executeScript(context: Context, script: string, arg: any): any {
|
|
7
|
-
context = refreshContext(context)
|
|
8
|
-
|
|
9
|
-
let scriptToExecute;
|
|
10
|
-
if (
|
|
11
|
-
script.includes('dom-snapshot') ||
|
|
12
|
-
script.includes('dom-capture') ||
|
|
13
|
-
script.includes('dom-shared')
|
|
14
|
-
) {
|
|
15
|
-
scriptToExecute = script
|
|
16
|
-
} else {
|
|
17
|
-
const prepScirpt = script.replace('function(arg)', 'function func(arg)')
|
|
18
|
-
scriptToExecute = prepScirpt.concat(' return func(arg)')
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const executor = new context.defaultView.Function('arg', scriptToExecute);
|
|
22
|
-
return executor(arg)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function mainContext(): Context {
|
|
26
|
-
//@ts-ignore
|
|
27
|
-
return cy.state('window').document
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function parentContext(context: Context): Context {
|
|
31
|
-
if (!context) return; // because Cypress doesn't support cross origin iframe, then childContext might return null, and then the input to parentContext might be null
|
|
32
|
-
|
|
33
|
-
return context === mainContext() ? context : context.defaultView.frameElement.ownerDocument
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function childContext(_context: Context, element: HTMLIFrameElement): Context {
|
|
37
|
-
return element.contentDocument // null in case of cross origin iframe
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function getViewportSize(): Object {
|
|
41
|
-
//@ts-ignore
|
|
42
|
-
const currWindow = cy.state('window')
|
|
43
|
-
const viewportSize = {
|
|
44
|
-
width: Math.max(currWindow.document.documentElement.clientWidth || 0, currWindow.innerWidth || 0),
|
|
45
|
-
height: Math.max(currWindow.document.documentElement.clientHeight || 0, currWindow.innerHeight || 0)
|
|
46
|
-
};
|
|
47
|
-
return viewportSize;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function setViewportSize(vs: any): void {
|
|
51
|
-
//@ts-ignore
|
|
52
|
-
Cypress.action('cy:viewport:changed', { viewportWidth: vs.size.width, viewportHeight: vs.size.height });
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function transformSelector(selector: Selector): Selector {
|
|
56
|
-
if (selector.hasOwnProperty('selector') && (!selector.hasOwnProperty('type') || (selector as EyesSelector).type === 'css')) {
|
|
57
|
-
return (selector as EyesSelector).selector
|
|
58
|
-
}
|
|
59
|
-
return selector
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function findElement(context: Context, selector: Selector, parent?: Element) {
|
|
63
|
-
context = refreshContext(context)
|
|
64
|
-
const eyesSelector = (selector as EyesSelector)
|
|
65
|
-
const root = parent ?? context
|
|
66
|
-
const sel = typeof selector === 'string' ? selector : eyesSelector.selector
|
|
67
|
-
if (typeof selector !== 'string' && eyesSelector.type === 'xpath') {
|
|
68
|
-
return context.evaluate(sel, context, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
69
|
-
} else {
|
|
70
|
-
return root.querySelector(sel)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function findElements(context: Context, selector: Selector, parent: Element){
|
|
75
|
-
context = refreshContext(context)
|
|
76
|
-
const eyesSelector = (selector as EyesSelector)
|
|
77
|
-
const root = parent ?? context
|
|
78
|
-
const sel = typeof selector === 'string' ? selector : eyesSelector.selector
|
|
79
|
-
if (typeof selector !== 'string' && eyesSelector.type === 'xpath') {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
function
|
|
104
|
-
//@ts-ignore
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
type EyesSelector = {selector: string; type?: string}
|
|
2
|
+
export type Selector = (string | EyesSelector) & {__applitoolsBrand?: never};
|
|
3
|
+
export type Context = Document & {__applitoolsBrand?: never};
|
|
4
|
+
export type Element = HTMLElement & {__applitoolsBrand?: never};
|
|
5
|
+
|
|
6
|
+
export function executeScript(context: Context, script: string, arg: any): any {
|
|
7
|
+
context = refreshContext(context)
|
|
8
|
+
|
|
9
|
+
let scriptToExecute;
|
|
10
|
+
if (
|
|
11
|
+
script.includes('dom-snapshot') ||
|
|
12
|
+
script.includes('dom-capture') ||
|
|
13
|
+
script.includes('dom-shared')
|
|
14
|
+
) {
|
|
15
|
+
scriptToExecute = script
|
|
16
|
+
} else {
|
|
17
|
+
const prepScirpt = script.replace('function(arg)', 'function func(arg)')
|
|
18
|
+
scriptToExecute = prepScirpt.concat(' return func(arg)')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const executor = new context.defaultView.Function('arg', scriptToExecute);
|
|
22
|
+
return executor(arg)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function mainContext(): Context {
|
|
26
|
+
//@ts-ignore
|
|
27
|
+
return cy.state('window').document
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function parentContext(context: Context): Context {
|
|
31
|
+
if (!context) return; // because Cypress doesn't support cross origin iframe, then childContext might return null, and then the input to parentContext might be null
|
|
32
|
+
|
|
33
|
+
return context === mainContext() ? context : context.defaultView.frameElement.ownerDocument
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function childContext(_context: Context, element: HTMLIFrameElement): Context {
|
|
37
|
+
return element.contentDocument // null in case of cross origin iframe
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getViewportSize(): Object {
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
const currWindow = cy.state('window')
|
|
43
|
+
const viewportSize = {
|
|
44
|
+
width: Math.max(currWindow.document.documentElement.clientWidth || 0, currWindow.innerWidth || 0),
|
|
45
|
+
height: Math.max(currWindow.document.documentElement.clientHeight || 0, currWindow.innerHeight || 0)
|
|
46
|
+
};
|
|
47
|
+
return viewportSize;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function setViewportSize(vs: any): void {
|
|
51
|
+
//@ts-ignore
|
|
52
|
+
Cypress.action('cy:viewport:changed', { viewportWidth: vs.size.width, viewportHeight: vs.size.height });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function transformSelector(selector: Selector): Selector {
|
|
56
|
+
if (selector.hasOwnProperty('selector') && (!selector.hasOwnProperty('type') || (selector as EyesSelector).type === 'css')) {
|
|
57
|
+
return (selector as EyesSelector).selector
|
|
58
|
+
}
|
|
59
|
+
return selector
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function findElement(context: Context, selector: Selector, parent?: Element) {
|
|
63
|
+
context = refreshContext(context)
|
|
64
|
+
const eyesSelector = (selector as EyesSelector)
|
|
65
|
+
const root = parent ?? context
|
|
66
|
+
const sel = typeof selector === 'string' ? selector : eyesSelector.selector
|
|
67
|
+
if (typeof selector !== 'string' && eyesSelector.type === 'xpath') {
|
|
68
|
+
return context.evaluate(sel, context, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
69
|
+
} else {
|
|
70
|
+
return root.querySelector(sel)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function findElements(context: Context, selector: Selector, parent: Element){
|
|
75
|
+
context = refreshContext(context)
|
|
76
|
+
const eyesSelector = (selector as EyesSelector)
|
|
77
|
+
const root = parent ?? context
|
|
78
|
+
const sel = typeof selector === 'string' ? selector : eyesSelector.selector
|
|
79
|
+
if (typeof selector !== 'string' && eyesSelector.type === 'xpath') {
|
|
80
|
+
const results = [];
|
|
81
|
+
const queryResult = document.evaluate(sel, context,
|
|
82
|
+
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
|
|
83
|
+
|
|
84
|
+
for (let i = 0; i < queryResult.snapshotLength; i++) {
|
|
85
|
+
results.push(queryResult.snapshotItem(i));
|
|
86
|
+
}
|
|
87
|
+
return results;
|
|
88
|
+
} else {
|
|
89
|
+
return root.querySelectorAll(sel)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function getTitle(context: Context): string {
|
|
94
|
+
context = refreshContext(context)
|
|
95
|
+
return context.title
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function getUrl(context: Context): string {
|
|
99
|
+
context = refreshContext(context)
|
|
100
|
+
return context.location.href
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function getCookies(): Array<any> {
|
|
104
|
+
//@ts-ignore
|
|
105
|
+
return Cypress.automation('get:cookies', {})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// we need to method to reset the context in case the user called open before visit
|
|
109
|
+
function refreshContext(context: Context) {
|
|
110
|
+
//@ts-ignore
|
|
111
|
+
return (context && context.defaultView) ? context : cy.state('window').document
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// export function takeScreenshot(page: Driver): Promise<Buffer>;
|
|
115
|
+
|
|
116
|
+
// export function visit(page: Driver, url: string): Promise<void>; (??)
|
|
117
|
+
|
|
112
118
|
// export function isStaleElementError(err: any): boolean;
|
package/src/pem/server.cert
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
|
2
|
-
MIIDsDCCApigAwIBAgIJANJbHwoHZzbBMA0GCSqGSIb3DQEBCwUAMG0xCzAJBgNV
|
|
3
|
-
BAYTAk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HQZCaDhHwwKBgCPgUQiMIPltmGuKSqvnNQIZViw22631+eADto4J
|
|
22
|
+
C8B+5LSkW+67A2Yhd9+aVYqg05AwWkebKxoYfi8wht7keOrQO3jIMYINu43U7fVA
|
|
23
|
+
jzZGSDf63xoe+SnQ9PvHNjRnHjoPnk+b2V1EXnJRMqGwWGpty0tM0qLEbN8ltLW7
|
|
24
|
+
bFS9AoGARqPSEW0PpLxW5m8fnfPRVWwpTuhhWm0fkw13O8cUVIVf3E6g+MF2I9wf
|
|
25
|
+
v8yPDFyh5myoCzy8aFy4eSFeWzYTahsLDq03EyYuqIGoTJrcls9dmpxhRdPjwywJ
|
|
26
|
+
Yll894/fpK2lWI54kCEh+jRE3+S+4D3zi2txta/tu7Z891eQ5sI=
|
|
27
|
+
-----END RSA PRIVATE KEY-----
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const MSG = `
|
|
4
|
-
Important notice: Your Applitools visual tests are currently running with a testConcurrency value of 5.
|
|
5
|
-
This means that only up to 5 visual tests can run in parallel, and therefore the execution might be slower.
|
|
6
|
-
If your Applitools license supports a higher concurrency level, learn how to configure it here: https://www.npmjs.com/package/@applitools/eyes-cypress#concurrency.
|
|
7
|
-
Need a higher concurrency in your account? Email us @ sdr@applitools.com with your required concurrency level.`;
|
|
8
|
-
module.exports = {concurrencyMsg: chalk.yellow(MSG), msgText: MSG};
|
|
1
|
+
'use strict';
|
|
2
|
+
const chalk = require('chalk');
|
|
3
|
+
const MSG = `
|
|
4
|
+
Important notice: Your Applitools visual tests are currently running with a testConcurrency value of 5.
|
|
5
|
+
This means that only up to 5 visual tests can run in parallel, and therefore the execution might be slower.
|
|
6
|
+
If your Applitools license supports a higher concurrency level, learn how to configure it here: https://www.npmjs.com/package/@applitools/eyes-cypress#concurrency.
|
|
7
|
+
Need a higher concurrency in your account? Email us @ sdr@applitools.com with your required concurrency level.`;
|
|
8
|
+
module.exports = {concurrencyMsg: chalk.yellow(MSG), msgText: MSG};
|
package/src/plugin/config.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const {configParams, ConfigUtils, TypeUtils} = require('@applitools/visual-grid-client');
|
|
3
|
-
const DEFAULT_TEST_CONCURRENCY = 5;
|
|
4
|
-
const uuid = require('uuid');
|
|
5
|
-
|
|
6
|
-
function makeConfig() {
|
|
7
|
-
const config = ConfigUtils.getConfig({
|
|
8
|
-
configParams: [
|
|
9
|
-
...configParams,
|
|
10
|
-
'failCypressOnDiff',
|
|
11
|
-
'tapDirPath',
|
|
12
|
-
'tapFileName',
|
|
13
|
-
'disableBrowserFetching',
|
|
14
|
-
'testConcurrency',
|
|
15
|
-
],
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
if (!config.batch || !config.batch.id) {
|
|
19
|
-
config.batch = {id: uuid.v4(), ...config.batch};
|
|
20
|
-
}
|
|
21
|
-
if (config.failCypressOnDiff === '0') {
|
|
22
|
-
config.failCypressOnDiff = false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (TypeUtils.isString(config.showLogs)) {
|
|
26
|
-
config.showLogs = config.showLogs === 'true' || config.showLogs === '1';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (TypeUtils.isString(config.testConcurrency)) {
|
|
30
|
-
config.testConcurrency = Number(config.testConcurrency);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (config.accessibilityValidation) {
|
|
34
|
-
config.accessibilitySettings = config.accessibilityValidation;
|
|
35
|
-
delete config.accessiblityValidation;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const eyesConfig = {
|
|
39
|
-
tapDirPath: config.tapDirPath,
|
|
40
|
-
tapFileName: config.tapFileName,
|
|
41
|
-
eyesIsDisabled: !!config.isDisabled,
|
|
42
|
-
eyesBrowser: JSON.stringify(config.browser),
|
|
43
|
-
eyesLayoutBreakpoints: JSON.stringify(config.layoutBreakpoints),
|
|
44
|
-
eyesFailCypressOnDiff:
|
|
45
|
-
config.failCypressOnDiff === undefined ? true : !!config.failCypressOnDiff,
|
|
46
|
-
eyesDisableBrowserFetching: !!config.disableBrowserFetching,
|
|
47
|
-
eyesTestConcurrency: config.testConcurrency || DEFAULT_TEST_CONCURRENCY,
|
|
48
|
-
eyesWaitBeforeCapture: config.waitBeforeCapture,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return {config, eyesConfig};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = makeConfig;
|
|
1
|
+
'use strict';
|
|
2
|
+
const {configParams, ConfigUtils, TypeUtils} = require('@applitools/visual-grid-client');
|
|
3
|
+
const DEFAULT_TEST_CONCURRENCY = 5;
|
|
4
|
+
const uuid = require('uuid');
|
|
5
|
+
|
|
6
|
+
function makeConfig() {
|
|
7
|
+
const config = ConfigUtils.getConfig({
|
|
8
|
+
configParams: [
|
|
9
|
+
...configParams,
|
|
10
|
+
'failCypressOnDiff',
|
|
11
|
+
'tapDirPath',
|
|
12
|
+
'tapFileName',
|
|
13
|
+
'disableBrowserFetching',
|
|
14
|
+
'testConcurrency',
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (!config.batch || !config.batch.id) {
|
|
19
|
+
config.batch = {id: uuid.v4(), ...config.batch};
|
|
20
|
+
}
|
|
21
|
+
if (config.failCypressOnDiff === '0') {
|
|
22
|
+
config.failCypressOnDiff = false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (TypeUtils.isString(config.showLogs)) {
|
|
26
|
+
config.showLogs = config.showLogs === 'true' || config.showLogs === '1';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (TypeUtils.isString(config.testConcurrency)) {
|
|
30
|
+
config.testConcurrency = Number(config.testConcurrency);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (config.accessibilityValidation) {
|
|
34
|
+
config.accessibilitySettings = config.accessibilityValidation;
|
|
35
|
+
delete config.accessiblityValidation;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const eyesConfig = {
|
|
39
|
+
tapDirPath: config.tapDirPath,
|
|
40
|
+
tapFileName: config.tapFileName,
|
|
41
|
+
eyesIsDisabled: !!config.isDisabled,
|
|
42
|
+
eyesBrowser: JSON.stringify(config.browser),
|
|
43
|
+
eyesLayoutBreakpoints: JSON.stringify(config.layoutBreakpoints),
|
|
44
|
+
eyesFailCypressOnDiff:
|
|
45
|
+
config.failCypressOnDiff === undefined ? true : !!config.failCypressOnDiff,
|
|
46
|
+
eyesDisableBrowserFetching: !!config.disableBrowserFetching,
|
|
47
|
+
eyesTestConcurrency: config.testConcurrency || DEFAULT_TEST_CONCURRENCY,
|
|
48
|
+
eyesWaitBeforeCapture: config.waitBeforeCapture,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {config, eyesConfig};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = makeConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = 7373;
|
|
1
|
+
module.exports = 7373;
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const colors = {
|
|
4
|
-
green: '\x1b[32m',
|
|
5
|
-
red: '\x1b[31m',
|
|
6
|
-
teal: '\x1b[38;5;86m',
|
|
7
|
-
orange: '\x1b[38;5;214m',
|
|
8
|
-
reset: '\x1b[0m',
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const formatByStatus = {
|
|
12
|
-
Passed: {
|
|
13
|
-
color: 'green',
|
|
14
|
-
symbol: '\u2713',
|
|
15
|
-
title: tests => `Passed - ${tests} tests`,
|
|
16
|
-
},
|
|
17
|
-
Failed: {
|
|
18
|
-
color: 'red',
|
|
19
|
-
symbol: '\u2716',
|
|
20
|
-
title: tests => `Errors - ${tests} tests`,
|
|
21
|
-
},
|
|
22
|
-
Unresolved: {
|
|
23
|
-
color: 'orange',
|
|
24
|
-
symbol: '\u26A0',
|
|
25
|
-
title: tests => `Diffs detected - ${tests} tests`,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function errorDigest({passed, failed, diffs, logger, isInteractive}) {
|
|
30
|
-
logger.log('errorDigest: diff errors', diffs);
|
|
31
|
-
logger.log('errorDigest: test errors', failed);
|
|
32
|
-
|
|
33
|
-
const testResultsUrl = diffs.length ? colorify(diffs[0].getUrl(), 'teal') : '';
|
|
34
|
-
const testResultsPrefix = testResultsUrl ? 'See details at:' : '';
|
|
35
|
-
const footer = testResultsUrl
|
|
36
|
-
? `\n${indent()}${colorify(testResultsPrefix)} ${testResultsUrl}`
|
|
37
|
-
: '';
|
|
38
|
-
return (
|
|
39
|
-
colorify('Eyes-Cypress detected diffs or errors during execution of visual tests.') +
|
|
40
|
-
colorify(` ${testResultsPrefix} ${testResultsUrl}`) +
|
|
41
|
-
testResultsToString(passed, 'Passed') +
|
|
42
|
-
testResultsToString(diffs, 'Unresolved') +
|
|
43
|
-
testResultsToString(failed, 'Failed') +
|
|
44
|
-
footer +
|
|
45
|
-
'\n\n'
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
function testResultsToString(testResultsArr, category) {
|
|
49
|
-
const {color, title, symbol, chalkFunction} = formatByStatus[category];
|
|
50
|
-
const results = testResultsArr.reduce((acc, testResults) => {
|
|
51
|
-
if (!testResults.isEmpty) {
|
|
52
|
-
const error = hasError(testResults) ? stringifyError(testResults) : undefined;
|
|
53
|
-
acc.push(
|
|
54
|
-
`${colorify(symbol, color)} ${colorify(error || stringifyTestResults(testResults))}`,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
return acc;
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
const coloredTitle = results.length
|
|
61
|
-
? colorify(title(results.length), color, chalkFunction)
|
|
62
|
-
: '';
|
|
63
|
-
return testResultsSection(coloredTitle, results);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function colorify(msg, color = 'reset') {
|
|
67
|
-
return isInteractive ? msg : `${colors[color]}${msg}${colors.reset}`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function stringifyTestResults(testResults) {
|
|
72
|
-
const hostDisplaySize = testResults.getHostDisplaySize();
|
|
73
|
-
const viewport = hostDisplaySize ? `[${hostDisplaySize}]` : '';
|
|
74
|
-
const testName = `${testResults.getName()} ${viewport}`;
|
|
75
|
-
return testName + (testResults.error ? ` : ${testResults.error}` : '');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function testResultsSection(title, results) {
|
|
79
|
-
return results.length ? `${indent()}${title}${indent(3)}${results.join(indent(3))}` : '';
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function stringifyError(testResults) {
|
|
83
|
-
return testResults.error
|
|
84
|
-
? stringifyTestResults(testResults)
|
|
85
|
-
: `[Eyes test not started] : ${testResults}`;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function indent(spaces = 2) {
|
|
89
|
-
return `\n ${' '.repeat(spaces)}`;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function hasError(testResult) {
|
|
93
|
-
return testResult.error || testResult instanceof Error;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
module.exports = errorDigest;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const colors = {
|
|
4
|
+
green: '\x1b[32m',
|
|
5
|
+
red: '\x1b[31m',
|
|
6
|
+
teal: '\x1b[38;5;86m',
|
|
7
|
+
orange: '\x1b[38;5;214m',
|
|
8
|
+
reset: '\x1b[0m',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const formatByStatus = {
|
|
12
|
+
Passed: {
|
|
13
|
+
color: 'green',
|
|
14
|
+
symbol: '\u2713',
|
|
15
|
+
title: tests => `Passed - ${tests} tests`,
|
|
16
|
+
},
|
|
17
|
+
Failed: {
|
|
18
|
+
color: 'red',
|
|
19
|
+
symbol: '\u2716',
|
|
20
|
+
title: tests => `Errors - ${tests} tests`,
|
|
21
|
+
},
|
|
22
|
+
Unresolved: {
|
|
23
|
+
color: 'orange',
|
|
24
|
+
symbol: '\u26A0',
|
|
25
|
+
title: tests => `Diffs detected - ${tests} tests`,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function errorDigest({passed, failed, diffs, logger, isInteractive}) {
|
|
30
|
+
logger.log('errorDigest: diff errors', diffs);
|
|
31
|
+
logger.log('errorDigest: test errors', failed);
|
|
32
|
+
|
|
33
|
+
const testResultsUrl = diffs.length ? colorify(diffs[0].getUrl(), 'teal') : '';
|
|
34
|
+
const testResultsPrefix = testResultsUrl ? 'See details at:' : '';
|
|
35
|
+
const footer = testResultsUrl
|
|
36
|
+
? `\n${indent()}${colorify(testResultsPrefix)} ${testResultsUrl}`
|
|
37
|
+
: '';
|
|
38
|
+
return (
|
|
39
|
+
colorify('Eyes-Cypress detected diffs or errors during execution of visual tests.') +
|
|
40
|
+
colorify(` ${testResultsPrefix} ${testResultsUrl}`) +
|
|
41
|
+
testResultsToString(passed, 'Passed') +
|
|
42
|
+
testResultsToString(diffs, 'Unresolved') +
|
|
43
|
+
testResultsToString(failed, 'Failed') +
|
|
44
|
+
footer +
|
|
45
|
+
'\n\n'
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
function testResultsToString(testResultsArr, category) {
|
|
49
|
+
const {color, title, symbol, chalkFunction} = formatByStatus[category];
|
|
50
|
+
const results = testResultsArr.reduce((acc, testResults) => {
|
|
51
|
+
if (!testResults.isEmpty) {
|
|
52
|
+
const error = hasError(testResults) ? stringifyError(testResults) : undefined;
|
|
53
|
+
acc.push(
|
|
54
|
+
`${colorify(symbol, color)} ${colorify(error || stringifyTestResults(testResults))}`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return acc;
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
const coloredTitle = results.length
|
|
61
|
+
? colorify(title(results.length), color, chalkFunction)
|
|
62
|
+
: '';
|
|
63
|
+
return testResultsSection(coloredTitle, results);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function colorify(msg, color = 'reset') {
|
|
67
|
+
return isInteractive ? msg : `${colors[color]}${msg}${colors.reset}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function stringifyTestResults(testResults) {
|
|
72
|
+
const hostDisplaySize = testResults.getHostDisplaySize();
|
|
73
|
+
const viewport = hostDisplaySize ? `[${hostDisplaySize}]` : '';
|
|
74
|
+
const testName = `${testResults.getName()} ${viewport}`;
|
|
75
|
+
return testName + (testResults.error ? ` : ${testResults.error}` : '');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function testResultsSection(title, results) {
|
|
79
|
+
return results.length ? `${indent()}${title}${indent(3)}${results.join(indent(3))}` : '';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function stringifyError(testResults) {
|
|
83
|
+
return testResults.error
|
|
84
|
+
? stringifyTestResults(testResults)
|
|
85
|
+
: `[Eyes test not started] : ${testResults}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function indent(spaces = 2) {
|
|
89
|
+
return `\n ${' '.repeat(spaces)}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function hasError(testResult) {
|
|
93
|
+
return testResult.error || testResult instanceof Error;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
module.exports = errorDigest;
|