@applitools/eyes-cypress 3.40.6 → 3.41.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 +132 -0
- package/dist/browser/spec-driver.js +15 -10
- package/package.json +6 -5
- package/src/browser/commands.js +1 -2
- package/src/browser/socketCommands.js +4 -0
- package/src/browser/spec-driver.ts +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,137 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.41.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-cypress-v3.40.8...js/eyes-cypress@3.41.0) (2024-02-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added notification about outdated sdk version ([#2012](https://github.com/applitools/eyes.sdk.javascript1/issues/2012)) ([0f0a646](https://github.com/applitools/eyes.sdk.javascript1/commit/0f0a6462a56e7c97f9a22173c3b63af91e220adb))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* docs for eyes setup and concurrency message output ([#1953](https://github.com/applitools/eyes.sdk.javascript1/issues/1953)) ([13704da](https://github.com/applitools/eyes.sdk.javascript1/commit/13704dac39fa899c5e8bdb268539cd46aee5ccfb))
|
|
14
|
+
* don't throw error for missing configuration file ([#2034](https://github.com/applitools/eyes.sdk.javascript1/issues/2034)) ([d084e7b](https://github.com/applitools/eyes.sdk.javascript1/commit/d084e7bf6e1727e3969622b4e597881f18241eb3))
|
|
15
|
+
* fix mapping for iosVersion ([#1994](https://github.com/applitools/eyes.sdk.javascript1/issues/1994)) ([f499256](https://github.com/applitools/eyes.sdk.javascript1/commit/f499256a191927edc5583a2747cb22c4fa5b1c3b))
|
|
16
|
+
* losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
|
|
21
|
+
* @applitools/dom-snapshot bumped to 4.7.17
|
|
22
|
+
#### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* throw error for encoding none unicode char ([#2171](https://github.com/applitools/eyes.sdk.javascript1/issues/2171)) ([4edb9cf](https://github.com/applitools/eyes.sdk.javascript1/commit/4edb9cfb27d8db2ff4cb09c8ebf1b95ab020633d))
|
|
25
|
+
* @applitools/spec-driver-webdriver bumped to 1.0.57
|
|
26
|
+
#### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* fixed issue with cdp commands on chromium browsers ([#2180](https://github.com/applitools/eyes.sdk.javascript1/issues/2180)) ([550fc77](https://github.com/applitools/eyes.sdk.javascript1/commit/550fc772d3988aae29e6f4a1a11d2a408072dc38))
|
|
29
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.0
|
|
30
|
+
#### Features
|
|
31
|
+
|
|
32
|
+
* added support for puppeteer >= 22 ([#2185](https://github.com/applitools/eyes.sdk.javascript1/issues/2185)) ([59d23a9](https://github.com/applitools/eyes.sdk.javascript1/commit/59d23a9689d77c7db06df53b67fa293a3b3f166e))
|
|
33
|
+
* @applitools/nml-client bumped to 1.7.0
|
|
34
|
+
#### Features
|
|
35
|
+
|
|
36
|
+
* add support for regions and calculated regions ([#2161](https://github.com/applitools/eyes.sdk.javascript1/issues/2161)) ([fea4b1f](https://github.com/applitools/eyes.sdk.javascript1/commit/fea4b1fca3d8f59eada2b5186cd32d47352ccf1a))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
#### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* missing viewport when using system screenshot and multi viewport ([#2173](https://github.com/applitools/eyes.sdk.javascript1/issues/2173)) ([411283c](https://github.com/applitools/eyes.sdk.javascript1/commit/411283c7bebc09f178d73b6b47e81e5ce4244d5e))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
* @applitools/eyes bumped to 1.14.0
|
|
46
|
+
#### Features
|
|
47
|
+
|
|
48
|
+
* add Eyes.getResults method ([#2046](https://github.com/applitools/eyes.sdk.javascript1/issues/2046)) ([#2069](https://github.com/applitools/eyes.sdk.javascript1/issues/2069)) ([4d263e1](https://github.com/applitools/eyes.sdk.javascript1/commit/4d263e19cb5e5708790a1a7ef90ff8f3eee50d91))
|
|
49
|
+
* added `enableEyesLogs` configuration to the eyes service ([639ca8a](https://github.com/applitools/eyes.sdk.javascript1/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
|
|
50
|
+
* added `useExecutionCloud` configuration to the eyes service ([#2033](https://github.com/applitools/eyes.sdk.javascript1/issues/2033)) ([639ca8a](https://github.com/applitools/eyes.sdk.javascript1/commit/639ca8a021008d06fc09d19ca58ac3d00a18e4c3))
|
|
51
|
+
* generate more enums ([#2179](https://github.com/applitools/eyes.sdk.javascript1/issues/2179)) ([5f4f916](https://github.com/applitools/eyes.sdk.javascript1/commit/5f4f91621b791a02464191123f69b12f590b9efe))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* error to unknown type in exception ([#2035](https://github.com/applitools/eyes.sdk.javascript1/issues/2035)) ([16d78c3](https://github.com/applitools/eyes.sdk.javascript1/commit/16d78c3cce90a5cb50cc2aa4e9ab6a58b7b93f89))
|
|
57
|
+
* fixed `serverUrl` configuration propagation ([247b7d8](https://github.com/applitools/eyes.sdk.javascript1/commit/247b7d88853dd1a9068d2d963582ad795752ace4))
|
|
58
|
+
* fixed default value in `useSystemScreenshot` method of check settings ([42a773c](https://github.com/applitools/eyes.sdk.javascript1/commit/42a773cc57e8e5de528a049b376159615892003b))
|
|
59
|
+
* fixed issue when w3c properties were added to legacy capabilities object in `Eyes.setMobileCapabilities` method ([94d785f](https://github.com/applitools/eyes.sdk.javascript1/commit/94d785f0428df101c207d6f09a55c46f2bdbf19e))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
#### Code Refactoring
|
|
63
|
+
|
|
64
|
+
* disallow usage of global Buffer ([#1957](https://github.com/applitools/eyes.sdk.javascript1/issues/1957)) ([adcc082](https://github.com/applitools/eyes.sdk.javascript1/commit/adcc082f20f6b92e819b96424e995d9a69d99758))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
* @applitools/screenshoter bumped to 3.8.23
|
|
69
|
+
|
|
70
|
+
* @applitools/ec-client bumped to 1.7.25
|
|
71
|
+
|
|
72
|
+
* @applitools/core bumped to 4.8.0
|
|
73
|
+
#### Features
|
|
74
|
+
|
|
75
|
+
* add support for regions and calculated regions ([#2161](https://github.com/applitools/eyes.sdk.javascript1/issues/2161)) ([fea4b1f](https://github.com/applitools/eyes.sdk.javascript1/commit/fea4b1fca3d8f59eada2b5186cd32d47352ccf1a))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#### Bug Fixes
|
|
79
|
+
|
|
80
|
+
* missing viewport when using system screenshot and multi viewport ([#2173](https://github.com/applitools/eyes.sdk.javascript1/issues/2173)) ([411283c](https://github.com/applitools/eyes.sdk.javascript1/commit/411283c7bebc09f178d73b6b47e81e5ce4244d5e))
|
|
81
|
+
* nml coded region integration with universal ([6fb0934](https://github.com/applitools/eyes.sdk.javascript1/commit/6fb09348238dfe4698856f88e762a9abf80c686f))
|
|
82
|
+
* throw error for encoding none unicode char ([#2171](https://github.com/applitools/eyes.sdk.javascript1/issues/2171)) ([4edb9cf](https://github.com/applitools/eyes.sdk.javascript1/commit/4edb9cfb27d8db2ff4cb09c8ebf1b95ab020633d))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [3.40.7](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-cypress@3.40.6...js/eyes-cypress@3.40.7) (2024-01-30)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Dependencies
|
|
96
|
+
|
|
97
|
+
* @applitools/snippets bumped to 2.4.25
|
|
98
|
+
#### Bug Fixes
|
|
99
|
+
|
|
100
|
+
* losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
|
|
101
|
+
* @applitools/driver bumped to 1.16.2
|
|
102
|
+
#### Bug Fixes
|
|
103
|
+
|
|
104
|
+
* losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
* @applitools/spec-driver-webdriver bumped to 1.0.55
|
|
109
|
+
|
|
110
|
+
* @applitools/spec-driver-selenium bumped to 1.5.69
|
|
111
|
+
|
|
112
|
+
* @applitools/spec-driver-puppeteer bumped to 1.3.5
|
|
113
|
+
|
|
114
|
+
* @applitools/screenshoter bumped to 3.8.21
|
|
115
|
+
|
|
116
|
+
* @applitools/nml-client bumped to 1.6.5
|
|
117
|
+
|
|
118
|
+
* @applitools/ec-client bumped to 1.7.23
|
|
119
|
+
|
|
120
|
+
* @applitools/core bumped to 4.7.0
|
|
121
|
+
#### Features
|
|
122
|
+
|
|
123
|
+
* added support of proxy server url env var ([#2159](https://github.com/applitools/eyes.sdk.javascript1/issues/2159)) ([2f69c3d](https://github.com/applitools/eyes.sdk.javascript1/commit/2f69c3d37d7af9be1f459fd3d5f41b361161b5bf))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
#### Bug Fixes
|
|
127
|
+
|
|
128
|
+
* losing root context after layout breakpoints reload ([#2113](https://github.com/applitools/eyes.sdk.javascript1/issues/2113)) ([afa1473](https://github.com/applitools/eyes.sdk.javascript1/commit/afa14735e5539ab0f79aa610e6ec1ea8989a5922))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
* @applitools/eyes bumped to 1.13.6
|
|
133
|
+
|
|
134
|
+
|
|
3
135
|
## [3.40.6](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-cypress@3.40.5...js/eyes-cypress@3.40.6) (2024-01-16)
|
|
4
136
|
|
|
5
137
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.reload = 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
6
|
if (script.includes('dom-snapshot') || script.includes('dom-capture') || script.includes('dom-shared')) {
|
|
@@ -12,7 +12,7 @@ function executeScript(context, script, arg) {
|
|
|
12
12
|
}
|
|
13
13
|
if (!context.defaultView) {
|
|
14
14
|
// after reload the window is null
|
|
15
|
-
context =
|
|
15
|
+
context = mainContext();
|
|
16
16
|
}
|
|
17
17
|
const executor = new context.defaultView.Function('arg', scriptToExecute);
|
|
18
18
|
return executor(arg);
|
|
@@ -20,7 +20,10 @@ function executeScript(context, script, arg) {
|
|
|
20
20
|
exports.executeScript = executeScript;
|
|
21
21
|
function mainContext() {
|
|
22
22
|
//@ts-ignore
|
|
23
|
-
|
|
23
|
+
const win = cy.state('window');
|
|
24
|
+
// after reload the marker may be lost
|
|
25
|
+
win.parent.document['applitools-marker'] = 'root-context';
|
|
26
|
+
return win.document;
|
|
24
27
|
}
|
|
25
28
|
exports.mainContext = mainContext;
|
|
26
29
|
function parentContext(context) {
|
|
@@ -30,7 +33,7 @@ function parentContext(context) {
|
|
|
30
33
|
}
|
|
31
34
|
else if (!context.defaultView) {
|
|
32
35
|
// after reload the window is null
|
|
33
|
-
return
|
|
36
|
+
return mainContext();
|
|
34
37
|
}
|
|
35
38
|
return context === mainContext() ? context : context.defaultView.frameElement.ownerDocument;
|
|
36
39
|
}
|
|
@@ -104,7 +107,7 @@ exports.getTitle = getTitle;
|
|
|
104
107
|
function getUrl(context) {
|
|
105
108
|
if (context && !context.location) {
|
|
106
109
|
// after reload, the location is null
|
|
107
|
-
context =
|
|
110
|
+
context = mainContext();
|
|
108
111
|
}
|
|
109
112
|
return context.location.href;
|
|
110
113
|
}
|
|
@@ -114,12 +117,14 @@ function getCookies() {
|
|
|
114
117
|
return Cypress.automation('get:cookies', {});
|
|
115
118
|
}
|
|
116
119
|
exports.getCookies = getCookies;
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
function reload() {
|
|
121
|
+
return new Promise(resolve => {
|
|
122
|
+
cy.once('window:load', resolve);
|
|
123
|
+
//@ts-ignore
|
|
124
|
+
return cy.state('window').location.reload();
|
|
125
|
+
});
|
|
122
126
|
}
|
|
127
|
+
exports.reload = reload;
|
|
123
128
|
// export function takeScreenshot(page: Driver): Promise<Buffer>;
|
|
124
129
|
// export function visit(page: Driver, url: string): Promise<void>; (??)
|
|
125
130
|
// export function isStaleElementError(err: any): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-cypress",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.41.0",
|
|
4
4
|
"homepage": "https://applitools.com/docs/api-ref/sdk-api/cypress/",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"test:ts:run:13": "yarn cypress13 run --project ./test/e2e/ts --config-file ./cypress-13.config.ts",
|
|
43
43
|
"test:ts:run": "yarn cypress$APPLITOOLS_FRAMEWORK_VERSION run --project ./test/e2e/ts --config-file ./cypress-$APPLITOOLS_FRAMEWORK_VERSION.config.ts",
|
|
44
44
|
"test:coverage": "cd test/generic && yarn && MOCHA_GROUP=coverage APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-cypress' APPLITOOLS_BATCH_ID=$(uuidgen) npx cypress run",
|
|
45
|
+
"test:coverage:chrome": "cd test/generic && yarn && MOCHA_GROUP=coverage APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-cypress' APPLITOOLS_BATCH_ID=$(uuidgen) npx cypress run --browser chrome",
|
|
45
46
|
"test:e2e": "MOCHA_GROUP=e2e mkdir -p test/fixtures/testAppCopies && run --top-level mocha --no-timeouts --parallel --jobs ${MOCHA_JOBS:-2} 'test/e2e/**/*.test.js'",
|
|
46
47
|
"test:components": "cd test/components && yarn && npx cypress run --component",
|
|
47
48
|
"cypress": "cypress open --config-file test/fixtures/cypress-play.json",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"setup": "run --top-level xvfb:setup"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@applitools/core": "4.
|
|
57
|
-
"@applitools/eyes": "1.
|
|
57
|
+
"@applitools/core": "4.8.0",
|
|
58
|
+
"@applitools/eyes": "1.14.0",
|
|
58
59
|
"@applitools/functional-commons": "1.6.0",
|
|
59
60
|
"@applitools/logger": "2.0.14",
|
|
60
61
|
"@applitools/utils": "1.7.0",
|
|
@@ -66,8 +67,8 @@
|
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@applitools/api-extractor": "^1.2.22",
|
|
69
|
-
"@applitools/bongo": "^5.
|
|
70
|
-
"@applitools/generic": "^3.
|
|
70
|
+
"@applitools/bongo": "^5.10.0",
|
|
71
|
+
"@applitools/generic": "^3.9.1",
|
|
71
72
|
"@applitools/snaptdout": "^1.0.1",
|
|
72
73
|
"@applitools/test-server": "^1.2.2",
|
|
73
74
|
"@applitools/test-utils": "^1.5.17",
|
package/src/browser/commands.js
CHANGED
|
@@ -159,7 +159,6 @@ Cypress.Commands.add('eyesCheckWindow', (args = {}) =>
|
|
|
159
159
|
cy.then({timeout: 86400000}, () => {
|
|
160
160
|
if (isCurrentTestDisabled) return
|
|
161
161
|
|
|
162
|
-
setRootContext()
|
|
163
162
|
const target = refer.ref(cy.state('window').document)
|
|
164
163
|
|
|
165
164
|
Cypress.log({name: 'Eyes: check window'})
|
|
@@ -203,5 +202,5 @@ Cypress.Commands.add('debugHistory', async function () {
|
|
|
203
202
|
})
|
|
204
203
|
|
|
205
204
|
function setRootContext() {
|
|
206
|
-
cy.state('window').document['applitools-marker'] = 'root-context'
|
|
205
|
+
cy.state('window').parent.document['applitools-marker'] = 'root-context'
|
|
207
206
|
}
|
|
@@ -13,7 +13,7 @@ export function executeScript(context: Context, script: string, arg: any): any {
|
|
|
13
13
|
}
|
|
14
14
|
if (!context.defaultView) {
|
|
15
15
|
// after reload the window is null
|
|
16
|
-
context =
|
|
16
|
+
context = mainContext()
|
|
17
17
|
}
|
|
18
18
|
const executor = new context.defaultView.Function('arg', scriptToExecute)
|
|
19
19
|
return executor(arg)
|
|
@@ -21,7 +21,10 @@ export function executeScript(context: Context, script: string, arg: any): any {
|
|
|
21
21
|
|
|
22
22
|
export function mainContext(): Context {
|
|
23
23
|
//@ts-ignore
|
|
24
|
-
|
|
24
|
+
const win = cy.state('window')
|
|
25
|
+
// after reload the marker may be lost
|
|
26
|
+
win.parent.document['applitools-marker'] = 'root-context'
|
|
27
|
+
return win.document
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export function parentContext(context: Context): Context {
|
|
@@ -30,7 +33,7 @@ export function parentContext(context: Context): Context {
|
|
|
30
33
|
throw new Error('Context is not accessible')
|
|
31
34
|
} else if (!context.defaultView) {
|
|
32
35
|
// after reload the window is null
|
|
33
|
-
return
|
|
36
|
+
return mainContext()
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
return context === mainContext() ? context : context.defaultView.frameElement.ownerDocument
|
|
@@ -107,7 +110,7 @@ export function getTitle(context: Context): string {
|
|
|
107
110
|
export function getUrl(context: Context): string {
|
|
108
111
|
if (context && !context.location) {
|
|
109
112
|
// after reload, the location is null
|
|
110
|
-
context =
|
|
113
|
+
context = mainContext()
|
|
111
114
|
}
|
|
112
115
|
return context.location.href
|
|
113
116
|
}
|
|
@@ -117,11 +120,12 @@ export function getCookies(): Array<any> {
|
|
|
117
120
|
return Cypress.automation('get:cookies', {})
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
export function reload(): Promise<void> {
|
|
124
|
+
return new Promise(resolve => {
|
|
125
|
+
cy.once('window:load', resolve)
|
|
126
|
+
//@ts-ignore
|
|
127
|
+
return cy.state('window').location.reload()
|
|
128
|
+
})
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
// export function takeScreenshot(page: Driver): Promise<Buffer>;
|