@applitools/eyes-cypress 3.28.0 → 3.28.2
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 +13 -0
- package/bin/eyes-setup.js +21 -21
- package/dist/browser/spec-driver.js +2 -5
- package/index.d.ts +7 -6
- package/index.js +2 -2
- package/package.json +13 -11
- package/src/browser/commands.js +79 -84
- package/src/browser/eyesCheckMapping.js +77 -71
- package/src/browser/eyesOpenMapping.js +28 -32
- package/src/browser/makeSend.js +5 -10
- package/src/browser/refer.js +28 -28
- package/src/browser/sendRequest.js +6 -6
- package/src/browser/socket.js +72 -73
- package/src/browser/socketCommands.js +34 -45
- package/src/browser/spec-driver.ts +33 -41
- package/src/plugin/concurrencyMsg.js +4 -4
- package/src/plugin/config.js +16 -17
- package/src/plugin/configParams.js +3 -3
- package/src/plugin/defaultPort.js +1 -1
- package/src/plugin/errorDigest.js +27 -35
- package/src/plugin/getErrorsAndDiffs.js +11 -11
- package/src/plugin/handleTestResults.js +16 -19
- package/src/plugin/hooks.js +12 -12
- package/src/plugin/isGlobalHooksSupported.js +6 -7
- package/src/plugin/pluginExport.js +38 -43
- package/src/plugin/server.js +50 -53
- package/src/plugin/startPlugin.js +9 -9
- package/src/plugin/webSocket.js +63 -64
- package/src/setup/addEyesCommands.js +12 -12
- package/src/setup/addEyesCypressPlugin.js +6 -6
- package/src/setup/getCypressPaths.js +28 -32
- package/src/setup/getCypressVersion.js +7 -9
- package/src/setup/getFilePath.js +8 -8
- package/src/setup/handleCommands.js +11 -11
- package/src/setup/handlePlugin.js +10 -10
- package/src/setup/handleTypeScript.js +8 -8
- package/src/setup/isCommandsDefined.js +3 -3
- package/src/setup/isPluginDefined.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,19 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
## 3.28.2 - 2023/1/17
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
### Bug fixes
|
|
19
|
+
- Fix types to include region options when passing an element
|
|
20
|
+
- Add support for region options for coded floating and accessibility when using elements
|
|
21
|
+
|
|
22
|
+
## 3.28.1 - 2023/1/5
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
### Bug fixes
|
|
26
|
+
- Wrong url when running `cypress run`
|
|
27
|
+
|
|
15
28
|
## 3.28.0 - 2022/12/28
|
|
16
29
|
|
|
17
30
|
### Features
|
package/bin/eyes-setup.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict'
|
|
2
|
+
'use strict'
|
|
3
3
|
|
|
4
|
-
const chalk = require('chalk')
|
|
5
|
-
const handlePlugin = require('../src/setup/handlePlugin')
|
|
6
|
-
const handleCommands = require('../src/setup/handleCommands')
|
|
7
|
-
const {handleTypeScript} = require('../src/setup/handleTypeScript')
|
|
8
|
-
const getCypressVersion = require('../src/setup/getCypressVersion')
|
|
9
|
-
const getCypressPaths = require('../src/setup/getCypressPaths')
|
|
4
|
+
const chalk = require('chalk')
|
|
5
|
+
const handlePlugin = require('../src/setup/handlePlugin')
|
|
6
|
+
const handleCommands = require('../src/setup/handleCommands')
|
|
7
|
+
const {handleTypeScript} = require('../src/setup/handleTypeScript')
|
|
8
|
+
const getCypressVersion = require('../src/setup/getCypressVersion')
|
|
9
|
+
const getCypressPaths = require('../src/setup/getCypressPaths')
|
|
10
10
|
|
|
11
|
-
const cwd = process.cwd()
|
|
12
|
-
const semver = require('semver')
|
|
13
|
-
const {version} = require('../package')
|
|
11
|
+
const cwd = process.cwd()
|
|
12
|
+
const semver = require('semver')
|
|
13
|
+
const {version} = require('../package')
|
|
14
14
|
|
|
15
|
-
console.log(chalk.cyan('Setup Eyes-Cypress', version))
|
|
15
|
+
console.log(chalk.cyan('Setup Eyes-Cypress', version))
|
|
16
16
|
|
|
17
|
-
const cypressVersion = getCypressVersion()
|
|
18
|
-
console.log(chalk.cyan(`Cypress version: ${cypressVersion}`))
|
|
17
|
+
const cypressVersion = getCypressVersion()
|
|
18
|
+
console.log(chalk.cyan(`Cypress version: ${cypressVersion}`))
|
|
19
19
|
|
|
20
|
-
const isCypress10 = semver.satisfies(cypressVersion, '>=10.0.0')
|
|
20
|
+
const isCypress10 = semver.satisfies(cypressVersion, '>=10.0.0')
|
|
21
21
|
try {
|
|
22
|
-
const {plugin, support, typescript} = getCypressPaths({cwd, isCypress10})
|
|
23
|
-
handlePlugin(plugin)
|
|
24
|
-
handleCommands(support)
|
|
25
|
-
handleTypeScript(typescript)
|
|
22
|
+
const {plugin, support, typescript} = getCypressPaths({cwd, isCypress10})
|
|
23
|
+
handlePlugin(plugin)
|
|
24
|
+
handleCommands(support)
|
|
25
|
+
handleTypeScript(typescript)
|
|
26
26
|
} catch (err) {
|
|
27
|
-
console.log(chalk.red(`Setup error:\n${err.message}`))
|
|
28
|
-
process.exit(1)
|
|
27
|
+
console.log(chalk.red(`Setup error:\n${err.message}`))
|
|
28
|
+
process.exit(1)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
console.log(chalk.cyan('Setup done!'))
|
|
31
|
+
console.log(chalk.cyan('Setup done!'))
|
|
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCookies = exports.getUrl = exports.getTitle = exports.findElements = exports.findElement = exports.transformSelector = exports.setViewportSize = exports.getViewportSize = exports.childContext = exports.parentContext = exports.mainContext = exports.executeScript = void 0;
|
|
4
4
|
function executeScript(context, script, arg) {
|
|
5
5
|
let scriptToExecute;
|
|
6
|
-
if (script.includes('dom-snapshot') ||
|
|
7
|
-
script.includes('dom-capture') ||
|
|
8
|
-
script.includes('dom-shared')) {
|
|
6
|
+
if (script.includes('dom-snapshot') || script.includes('dom-capture') || script.includes('dom-shared')) {
|
|
9
7
|
scriptToExecute = script;
|
|
10
8
|
}
|
|
11
9
|
else {
|
|
@@ -26,7 +24,6 @@ function parentContext(context) {
|
|
|
26
24
|
if (!context) {
|
|
27
25
|
throw new Error('Context is not accessible');
|
|
28
26
|
}
|
|
29
|
-
;
|
|
30
27
|
return context === mainContext() ? context : context.defaultView.frameElement.ownerDocument;
|
|
31
28
|
}
|
|
32
29
|
exports.parentContext = parentContext;
|
|
@@ -43,7 +40,7 @@ function getViewportSize() {
|
|
|
43
40
|
const currWindow = cy.state('window');
|
|
44
41
|
const viewportSize = {
|
|
45
42
|
width: currWindow.innerWidth || currWindow.document.documentElement.clientWidth || currWindow.document.body.clientWidth,
|
|
46
|
-
height: currWindow.innerHeight || currWindow.document.documentElement.clientHeight || currWindow.document.body.clientHeight
|
|
43
|
+
height: currWindow.innerHeight || currWindow.document.documentElement.clientHeight || currWindow.document.body.clientHeight,
|
|
47
44
|
};
|
|
48
45
|
return viewportSize;
|
|
49
46
|
}
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ type MaybeArray<T> = T | T[]
|
|
|
6
6
|
type LegacyRegion = {left: number; top: number; width: number; height: number}
|
|
7
7
|
type Selector = {selector: string; type?: 'css' | 'xpath', nodeType?: 'element' | 'shadow-root'} | 'string'
|
|
8
8
|
type Element = HTMLElement | JQuery<HTMLElement>
|
|
9
|
+
type ElementWithOptions = {element: Element, regionId?: string, padding?: any}
|
|
9
10
|
|
|
10
11
|
interface CypressCheckSettings extends api.CheckSettingsAutomationPlain<Element, Selector>{
|
|
11
12
|
tag?: CypressCheckSettings['name']
|
|
@@ -14,12 +15,12 @@ interface CypressCheckSettings extends api.CheckSettingsAutomationPlain<Element,
|
|
|
14
15
|
selector?: Selector
|
|
15
16
|
element?: Element
|
|
16
17
|
|
|
17
|
-
ignore?: MaybeArray<NonNullable<CypressCheckSettings['ignoreRegions']>[number] | LegacyRegion>
|
|
18
|
-
layout?: MaybeArray<NonNullable<CypressCheckSettings['layoutRegions']>[number] | LegacyRegion>
|
|
19
|
-
content?: MaybeArray<NonNullable<CypressCheckSettings['contentRegions']>[number] | LegacyRegion>
|
|
20
|
-
strict?: MaybeArray<NonNullable<CypressCheckSettings['strictRegions']>[number] | LegacyRegion>
|
|
21
|
-
floating?: MaybeArray<NonNullable<CypressCheckSettings['floatingRegions']>[number] | ((
|
|
22
|
-
accessibility?: MaybeArray<NonNullable<CypressCheckSettings['accessibilityRegions']>[number] | ((
|
|
18
|
+
ignore?: MaybeArray<NonNullable<CypressCheckSettings['ignoreRegions']>[number] | LegacyRegion | ElementWithOptions>
|
|
19
|
+
layout?: MaybeArray<NonNullable<CypressCheckSettings['layoutRegions']>[number] | LegacyRegion| ElementWithOptions>
|
|
20
|
+
content?: MaybeArray<NonNullable<CypressCheckSettings['contentRegions']>[number] | LegacyRegion| ElementWithOptions>
|
|
21
|
+
strict?: MaybeArray<NonNullable<CypressCheckSettings['strictRegions']>[number] | LegacyRegion | ElementWithOptions>
|
|
22
|
+
floating?: MaybeArray<NonNullable<CypressCheckSettings['floatingRegions']>[number] | ((ElementWithOptions | Selector | LegacyRegion) & {maxUpOffset?: number; maxDownOffset?: number; maxLeftOffset?: number; maxRightOffset?: number})>
|
|
23
|
+
accessibility?: MaybeArray<NonNullable<CypressCheckSettings['accessibilityRegions']>[number] | ((ElementWithOptions | Selector | LegacyRegion) & {accessibilityType?: api.AccessibilityRegionTypePlain})>
|
|
23
24
|
scriptHooks?: CypressCheckSettings['hooks']
|
|
24
25
|
ignoreCaret?: boolean
|
|
25
26
|
ignoreDisplacements?: boolean
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
module.exports = require('./src/plugin/startPlugin')
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = require('./src/plugin/startPlugin')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-cypress",
|
|
3
|
-
"version": "3.28.
|
|
3
|
+
"version": "3.28.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git://github.com/applitools/eyes.sdk.javascript1.git",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@applitools/core": "1.
|
|
60
|
-
"@applitools/eyes-api": "1.
|
|
59
|
+
"@applitools/core": "1.4.0",
|
|
60
|
+
"@applitools/eyes-api": "1.12.0",
|
|
61
61
|
"@applitools/eyes-universal": "2.18.0",
|
|
62
62
|
"@applitools/functional-commons": "1.6.0",
|
|
63
|
-
"@applitools/logger": "1.1.
|
|
63
|
+
"@applitools/logger": "1.1.40",
|
|
64
64
|
"chalk": "3.0.0",
|
|
65
65
|
"semver": "7.3.8",
|
|
66
66
|
"uuid": "8.3.2",
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"ws": "8.5.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@applitools/bongo": "^2.2.
|
|
71
|
+
"@applitools/bongo": "^2.2.2",
|
|
72
72
|
"@applitools/scripts": "1.2.0",
|
|
73
73
|
"@applitools/sdk-coverage-tests": "^2.7.10",
|
|
74
74
|
"@applitools/snaptdout": "1.0.1",
|
|
75
|
-
"@applitools/test-server": "1.1.
|
|
76
|
-
"@applitools/test-utils": "1.5.
|
|
77
|
-
"@applitools/utils": "1.3.
|
|
75
|
+
"@applitools/test-server": "1.1.20",
|
|
76
|
+
"@applitools/test-utils": "1.5.8",
|
|
77
|
+
"@applitools/utils": "1.3.26",
|
|
78
78
|
"@types/node": "12",
|
|
79
79
|
"@types/which": "^2.0.1",
|
|
80
80
|
"@types/ws": "^8.2.2",
|
|
@@ -85,16 +85,18 @@
|
|
|
85
85
|
"cookie-parser": "1.4.4",
|
|
86
86
|
"cypress": "9.7.0",
|
|
87
87
|
"eslint": "8.10.0",
|
|
88
|
+
"eslint-config-prettier": "^8.5.0",
|
|
88
89
|
"eslint-plugin-mocha-no-only": "1.1.0",
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
90
|
+
"eslint-plugin-no-only-tests": "^3.0.0",
|
|
91
|
+
"eslint-plugin-node": "^11.1.0",
|
|
92
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
91
93
|
"husky": "4.3.8",
|
|
92
94
|
"lodash.omit": "4.5.0",
|
|
93
95
|
"mocha": "8.0.1",
|
|
94
96
|
"morgan": "1.9.1",
|
|
95
97
|
"ncp": "2.0.0",
|
|
96
98
|
"node-fetch": "2.6.0",
|
|
97
|
-
"prettier": "
|
|
99
|
+
"prettier": "^2.6.2",
|
|
98
100
|
"typescript": "4.8.4"
|
|
99
101
|
},
|
|
100
102
|
"engines": {
|
package/src/browser/commands.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
/* global Cypress,cy,after */
|
|
2
|
-
'use strict'
|
|
3
|
-
const spec = require('../../dist/browser/spec-driver')
|
|
4
|
-
const Refer = require('./refer')
|
|
5
|
-
const Socket = require('./socket')
|
|
6
|
-
const {socketCommands} = require('./socketCommands')
|
|
7
|
-
const {eyesOpenMapValues} = require('./eyesOpenMapping')
|
|
8
|
-
const {eyesCheckMapValues} = require('./eyesCheckMapping')
|
|
9
|
-
const {TestResultsSummary} = require('@applitools/eyes-api')
|
|
10
|
-
const refer = new Refer()
|
|
11
|
-
const socket = new Socket()
|
|
12
|
-
const throwErr = Cypress.config('failCypressOnDiff')
|
|
13
|
-
socketCommands(socket, refer)
|
|
14
|
-
let connectedToUniversal = false
|
|
2
|
+
'use strict'
|
|
3
|
+
const spec = require('../../dist/browser/spec-driver')
|
|
4
|
+
const Refer = require('./refer')
|
|
5
|
+
const Socket = require('./socket')
|
|
6
|
+
const {socketCommands} = require('./socketCommands')
|
|
7
|
+
const {eyesOpenMapValues} = require('./eyesOpenMapping')
|
|
8
|
+
const {eyesCheckMapValues} = require('./eyesCheckMapping')
|
|
9
|
+
const {TestResultsSummary} = require('@applitools/eyes-api')
|
|
10
|
+
const refer = new Refer()
|
|
11
|
+
const socket = new Socket()
|
|
12
|
+
const throwErr = Cypress.config('failCypressOnDiff')
|
|
13
|
+
socketCommands(socket, refer)
|
|
14
|
+
let connectedToUniversal = false
|
|
15
15
|
|
|
16
16
|
let manager,
|
|
17
17
|
eyes,
|
|
18
|
-
closePromiseArr = []
|
|
18
|
+
closePromiseArr = []
|
|
19
19
|
|
|
20
20
|
function getGlobalConfigProperty(prop) {
|
|
21
|
-
const property = Cypress.config(prop)
|
|
22
|
-
const shouldParse = ['eyesBrowser', 'eyesLayoutBreakpoints']
|
|
23
|
-
return property ? (shouldParse.includes(prop) ? JSON.parse(property) : property) : undefined
|
|
21
|
+
const property = Cypress.config(prop)
|
|
22
|
+
const shouldParse = ['eyesBrowser', 'eyesLayoutBreakpoints']
|
|
23
|
+
return property ? (shouldParse.includes(prop) ? JSON.parse(property) : property) : undefined
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const shouldUseBrowserHooks =
|
|
27
27
|
!getGlobalConfigProperty('eyesIsDisabled') &&
|
|
28
|
-
(getGlobalConfigProperty('isInteractive') ||
|
|
29
|
-
!getGlobalConfigProperty('eyesIsGlobalHooksSupported'));
|
|
28
|
+
(getGlobalConfigProperty('isInteractive') || !getGlobalConfigProperty('eyesIsGlobalHooksSupported'))
|
|
30
29
|
|
|
31
30
|
Cypress.Commands.add('eyesGetAllTestResults', () => {
|
|
32
|
-
Cypress.log({name: 'Eyes: getAllTestResults'})
|
|
31
|
+
Cypress.log({name: 'Eyes: getAllTestResults'})
|
|
33
32
|
return cy.then({timeout: 86400000}, async () => {
|
|
34
33
|
if (isCurrentTestDisabled) {
|
|
35
|
-
isCurrentTestDisabled = false
|
|
36
|
-
return
|
|
34
|
+
isCurrentTestDisabled = false
|
|
35
|
+
return
|
|
37
36
|
}
|
|
38
|
-
await Promise.all(closePromiseArr)
|
|
39
|
-
const summary = await socket.request('EyesManager.closeManager', {manager, throwErr})
|
|
37
|
+
await Promise.all(closePromiseArr)
|
|
38
|
+
const summary = await socket.request('EyesManager.closeManager', {manager, throwErr})
|
|
40
39
|
|
|
41
40
|
const deleteTest = ({settings: {testId, batchId, secretToken}}) => {
|
|
42
|
-
const {serverUrl, proxy, apiKey} = Cypress.config('appliConfFile')
|
|
41
|
+
const {serverUrl, proxy, apiKey} = Cypress.config('appliConfFile')
|
|
43
42
|
return socket.request('Core.deleteTest', {
|
|
44
43
|
settings: {
|
|
45
44
|
testId,
|
|
@@ -49,22 +48,22 @@ Cypress.Commands.add('eyesGetAllTestResults', () => {
|
|
|
49
48
|
proxy,
|
|
50
49
|
apiKey,
|
|
51
50
|
},
|
|
52
|
-
})
|
|
53
|
-
}
|
|
51
|
+
})
|
|
52
|
+
}
|
|
54
53
|
summary.results = summary.results.map(res => {
|
|
55
|
-
return {...res, result: res.testResults, error: res.exception, renderer: res.browserInfo}
|
|
56
|
-
})
|
|
57
|
-
return new TestResultsSummary({summary, deleteTest})
|
|
58
|
-
})
|
|
59
|
-
})
|
|
54
|
+
return {...res, result: res.testResults, error: res.exception, renderer: res.browserInfo}
|
|
55
|
+
})
|
|
56
|
+
return new TestResultsSummary({summary, deleteTest})
|
|
57
|
+
})
|
|
58
|
+
})
|
|
60
59
|
|
|
61
60
|
if (shouldUseBrowserHooks || Cypress.config('eyesFailCypressOnDiff')) {
|
|
62
61
|
after(() => {
|
|
63
|
-
if (!manager) return
|
|
62
|
+
if (!manager) return
|
|
64
63
|
return cy.then({timeout: 86400000}, async () => {
|
|
65
64
|
if (isCurrentTestDisabled) {
|
|
66
|
-
isCurrentTestDisabled = false
|
|
67
|
-
return
|
|
65
|
+
isCurrentTestDisabled = false
|
|
66
|
+
return
|
|
68
67
|
}
|
|
69
68
|
const resultConfig = {
|
|
70
69
|
showLogs: Cypress.config('appliConfFile').showLogs,
|
|
@@ -73,63 +72,59 @@ if (shouldUseBrowserHooks || Cypress.config('eyesFailCypressOnDiff')) {
|
|
|
73
72
|
tapDirPath: Cypress.config('appliConfFile').tapDirPath,
|
|
74
73
|
tapFileName: Cypress.config('appliConfFile').tapFileName,
|
|
75
74
|
shouldCreateTapFile: shouldUseBrowserHooks,
|
|
76
|
-
}
|
|
77
|
-
await Promise.all(closePromiseArr)
|
|
78
|
-
const summary = await socket.request('EyesManager.closeManager', {manager, throwErr})
|
|
79
|
-
const testResults = summary.results.map(({testResults}) => testResults)
|
|
80
|
-
const message = await socket.request('Test.printTestResults', {testResults, resultConfig})
|
|
75
|
+
}
|
|
76
|
+
await Promise.all(closePromiseArr)
|
|
77
|
+
const summary = await socket.request('EyesManager.closeManager', {manager, throwErr})
|
|
78
|
+
const testResults = summary.results.map(({testResults}) => testResults)
|
|
79
|
+
const message = await socket.request('Test.printTestResults', {testResults, resultConfig})
|
|
81
80
|
if (
|
|
82
81
|
!!getGlobalConfigProperty('eyesFailCypressOnDiff') &&
|
|
83
82
|
message &&
|
|
84
83
|
message.includes('Eyes-Cypress detected diffs or errors')
|
|
85
84
|
) {
|
|
86
|
-
throw new Error(message)
|
|
85
|
+
throw new Error(message)
|
|
87
86
|
}
|
|
88
|
-
})
|
|
89
|
-
})
|
|
87
|
+
})
|
|
88
|
+
})
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
let isCurrentTestDisabled
|
|
91
|
+
let isCurrentTestDisabled
|
|
93
92
|
|
|
94
|
-
Cypress.Commands.add('eyesOpen', function(args = {}) {
|
|
95
|
-
Cypress.log({name: 'Eyes: open'})
|
|
96
|
-
Cypress.config('eyesOpenArgs', args)
|
|
97
|
-
const {title: testName} = this.currentTest || this.test || Cypress.currentTest
|
|
93
|
+
Cypress.Commands.add('eyesOpen', function (args = {}) {
|
|
94
|
+
Cypress.log({name: 'Eyes: open'})
|
|
95
|
+
Cypress.config('eyesOpenArgs', args)
|
|
96
|
+
const {title: testName} = this.currentTest || this.test || Cypress.currentTest
|
|
98
97
|
|
|
99
98
|
if (Cypress.config('eyesIsDisabled') && args.isDisabled === false) {
|
|
100
99
|
throw new Error(
|
|
101
100
|
`Eyes-Cypress is disabled by an env variable or in the applitools.config.js file, but the "${testName}" test was passed isDisabled:false. A single test cannot be enabled when Eyes.Cypress is disabled through the global configuration. Please remove "isDisabled:false" from cy.eyesOpen() for this test, or enable Eyes.Cypress in the global configuration, either by unsetting the APPLITOOLS_IS_DISABLED env var, or by deleting 'isDisabled' from the applitools.config.js file.`,
|
|
102
|
-
)
|
|
101
|
+
)
|
|
103
102
|
}
|
|
104
|
-
isCurrentTestDisabled = getGlobalConfigProperty('eyesIsDisabled') || args.isDisabled
|
|
105
|
-
if (isCurrentTestDisabled) return
|
|
103
|
+
isCurrentTestDisabled = getGlobalConfigProperty('eyesIsDisabled') || args.isDisabled
|
|
104
|
+
if (isCurrentTestDisabled) return
|
|
106
105
|
|
|
107
106
|
return cy.then({timeout: 86400000}, async () => {
|
|
108
|
-
setRootContext()
|
|
109
|
-
const driver = refer.ref(cy.state('window').document)
|
|
107
|
+
setRootContext()
|
|
108
|
+
const driver = refer.ref(cy.state('window').document)
|
|
110
109
|
|
|
111
110
|
if (!connectedToUniversal) {
|
|
112
|
-
socket.connect(`wss://localhost:${Cypress.config('eyesPort')}/eyes`)
|
|
113
|
-
connectedToUniversal = true
|
|
111
|
+
socket.connect(`wss://localhost:${Cypress.config('eyesPort')}/eyes`)
|
|
112
|
+
connectedToUniversal = true
|
|
114
113
|
socket.emit('Core.makeSDK', {
|
|
115
114
|
name: 'eyes.cypress',
|
|
116
115
|
version: require('../../package.json').version,
|
|
117
116
|
commands: Object.keys(spec).concat(['isSelector', 'isDriver', 'isElement']), // TODO fix spec.isSelector and spec.isDriver and spec.isElement in driver utils
|
|
118
|
-
})
|
|
117
|
+
})
|
|
119
118
|
|
|
120
119
|
manager =
|
|
121
120
|
manager ||
|
|
122
121
|
(await socket.request(
|
|
123
122
|
'Core.makeManager',
|
|
124
|
-
Object.assign(
|
|
125
|
-
|
|
126
|
-
{concurrency: Cypress.config('eyesTestConcurrency')},
|
|
127
|
-
{legacy: false, type: 'vg'},
|
|
128
|
-
),
|
|
129
|
-
));
|
|
123
|
+
Object.assign({}, {concurrency: Cypress.config('eyesTestConcurrency')}, {legacy: false, type: 'vg'}),
|
|
124
|
+
))
|
|
130
125
|
}
|
|
131
126
|
|
|
132
|
-
const appliConfFile = Cypress.config('appliConfFile')
|
|
127
|
+
const appliConfFile = Cypress.config('appliConfFile')
|
|
133
128
|
const config = eyesOpenMapValues({
|
|
134
129
|
args,
|
|
135
130
|
appliConfFile,
|
|
@@ -140,48 +135,48 @@ Cypress.Commands.add('eyesOpen', function(args = {}) {
|
|
|
140
135
|
height: Cypress.config('viewportHeight'),
|
|
141
136
|
name: 'chrome',
|
|
142
137
|
},
|
|
143
|
-
})
|
|
144
|
-
eyes = await socket.request('EyesManager.openEyes', {manager, driver, config})
|
|
145
|
-
})
|
|
146
|
-
})
|
|
138
|
+
})
|
|
139
|
+
eyes = await socket.request('EyesManager.openEyes', {manager, driver, config})
|
|
140
|
+
})
|
|
141
|
+
})
|
|
147
142
|
|
|
148
143
|
Cypress.Commands.add('eyesCheckWindow', (args = {}) =>
|
|
149
144
|
cy.then({timeout: 86400000}, () => {
|
|
150
|
-
if (isCurrentTestDisabled) return
|
|
145
|
+
if (isCurrentTestDisabled) return
|
|
151
146
|
|
|
152
|
-
setRootContext()
|
|
153
|
-
const driver = refer.ref(cy.state('window').document)
|
|
147
|
+
setRootContext()
|
|
148
|
+
const driver = refer.ref(cy.state('window').document)
|
|
154
149
|
|
|
155
|
-
Cypress.log({name: 'Eyes: check window'})
|
|
150
|
+
Cypress.log({name: 'Eyes: check window'})
|
|
156
151
|
|
|
157
|
-
const checkSettings = eyesCheckMapValues({args, refer})
|
|
152
|
+
const checkSettings = eyesCheckMapValues({args, refer})
|
|
158
153
|
|
|
159
154
|
return socket.request('Eyes.check', {
|
|
160
155
|
eyes,
|
|
161
156
|
settings: checkSettings,
|
|
162
157
|
driver,
|
|
163
|
-
})
|
|
158
|
+
})
|
|
164
159
|
}),
|
|
165
|
-
)
|
|
160
|
+
)
|
|
166
161
|
|
|
167
162
|
Cypress.Commands.add('eyesClose', () => {
|
|
168
163
|
return cy.then({timeout: 86400000}, () => {
|
|
169
|
-
if (isCurrentTestDisabled) return
|
|
164
|
+
if (isCurrentTestDisabled) return
|
|
170
165
|
|
|
171
|
-
Cypress.log({name: 'Eyes: close'})
|
|
166
|
+
Cypress.log({name: 'Eyes: close'})
|
|
172
167
|
if (isCurrentTestDisabled) {
|
|
173
|
-
isCurrentTestDisabled = false
|
|
174
|
-
return
|
|
168
|
+
isCurrentTestDisabled = false
|
|
169
|
+
return
|
|
175
170
|
}
|
|
176
171
|
|
|
177
172
|
// intentionally not returning the result in order to not wait on the close promise
|
|
178
173
|
const p = socket.request('Eyes.close', {eyes, throwErr: false}).catch(err => {
|
|
179
|
-
console.log('Error in cy.eyesClose', err)
|
|
180
|
-
})
|
|
181
|
-
closePromiseArr.push(p)
|
|
182
|
-
})
|
|
183
|
-
})
|
|
174
|
+
console.log('Error in cy.eyesClose', err)
|
|
175
|
+
})
|
|
176
|
+
closePromiseArr.push(p)
|
|
177
|
+
})
|
|
178
|
+
})
|
|
184
179
|
|
|
185
180
|
function setRootContext() {
|
|
186
|
-
cy.state('window').document['applitools-marker'] = 'root-context'
|
|
181
|
+
cy.state('window').document['applitools-marker'] = 'root-context'
|
|
187
182
|
}
|