@commercetools-frontend/cypress 21.16.0 → 21.18.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/add-commands/dist/commercetools-frontend-cypress-add-commands.cjs.dev.js +10 -4
- package/add-commands/dist/commercetools-frontend-cypress-add-commands.cjs.prod.js +10 -4
- package/add-commands/dist/commercetools-frontend-cypress-add-commands.esm.js +9 -4
- package/dist/commercetools-frontend-cypress.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-cypress.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-cypress.esm.js +1 -1
- package/dist/declarations/src/add-commands/login.d.ts +1 -0
- package/package.json +5 -4
|
@@ -13,6 +13,7 @@ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
13
13
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
14
14
|
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
15
15
|
var uuid = require('uuid');
|
|
16
|
+
var semver = require('semver');
|
|
16
17
|
var ssr = require('@commercetools-frontend/application-shell/ssr');
|
|
17
18
|
var constants = require('../../dist/constants-42a0ebf5.cjs.dev.js');
|
|
18
19
|
|
|
@@ -29,11 +30,16 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
29
30
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
30
31
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
31
32
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
33
|
+
var semver__default = /*#__PURE__*/_interopDefault(semver);
|
|
32
34
|
|
|
33
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
36
|
|
|
35
37
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
36
38
|
|
|
39
|
+
function isFeatureSupported(expectedVersion) {
|
|
40
|
+
return semver__default["default"].gte(Cypress.version, expectedVersion);
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
function loginByForm(commandOptions) {
|
|
38
44
|
var _commandOptions$proje;
|
|
39
45
|
|
|
@@ -89,9 +95,9 @@ function loginByForm(commandOptions) {
|
|
|
89
95
|
|
|
90
96
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
91
97
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
92
|
-
cy.session(sessionKey, authCallback, {
|
|
98
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
93
99
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
94
|
-
});
|
|
100
|
+
} : undefined);
|
|
95
101
|
} else {
|
|
96
102
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
97
103
|
authCallback();
|
|
@@ -189,9 +195,9 @@ function loginByOidc(commandOptions) {
|
|
|
189
195
|
|
|
190
196
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
191
197
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
192
|
-
cy.session(sessionKey, authCallback, {
|
|
198
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
193
199
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
194
|
-
});
|
|
200
|
+
} : undefined);
|
|
195
201
|
} else {
|
|
196
202
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
197
203
|
authCallback();
|
|
@@ -13,6 +13,7 @@ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
13
13
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
14
14
|
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
15
15
|
var uuid = require('uuid');
|
|
16
|
+
var semver = require('semver');
|
|
16
17
|
var ssr = require('@commercetools-frontend/application-shell/ssr');
|
|
17
18
|
var constants = require('../../dist/constants-4d9d4b7b.cjs.prod.js');
|
|
18
19
|
|
|
@@ -29,11 +30,16 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
|
|
|
29
30
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
30
31
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
31
32
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
33
|
+
var semver__default = /*#__PURE__*/_interopDefault(semver);
|
|
32
34
|
|
|
33
35
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
36
|
|
|
35
37
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
36
38
|
|
|
39
|
+
function isFeatureSupported(expectedVersion) {
|
|
40
|
+
return semver__default["default"].gte(Cypress.version, expectedVersion);
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
function loginByForm(commandOptions) {
|
|
38
44
|
var _commandOptions$proje;
|
|
39
45
|
|
|
@@ -89,9 +95,9 @@ function loginByForm(commandOptions) {
|
|
|
89
95
|
|
|
90
96
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
91
97
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
92
|
-
cy.session(sessionKey, authCallback, {
|
|
98
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
93
99
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
94
|
-
});
|
|
100
|
+
} : undefined);
|
|
95
101
|
} else {
|
|
96
102
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
97
103
|
authCallback();
|
|
@@ -189,9 +195,9 @@ function loginByOidc(commandOptions) {
|
|
|
189
195
|
|
|
190
196
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
191
197
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
192
|
-
cy.session(sessionKey, authCallback, {
|
|
198
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
193
199
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
194
|
-
});
|
|
200
|
+
} : undefined);
|
|
195
201
|
} else {
|
|
196
202
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
197
203
|
authCallback();
|
|
@@ -11,6 +11,7 @@ import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
11
11
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
12
12
|
import _URL from '@babel/runtime-corejs3/core-js-stable/url';
|
|
13
13
|
import { v4 } from 'uuid';
|
|
14
|
+
import semver from 'semver';
|
|
14
15
|
import { buildOidcScope } from '@commercetools-frontend/application-shell/ssr';
|
|
15
16
|
import { O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from '../../dist/constants-0e882d21.esm.js';
|
|
16
17
|
|
|
@@ -18,6 +19,10 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
|
18
19
|
|
|
19
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20
21
|
|
|
22
|
+
function isFeatureSupported(expectedVersion) {
|
|
23
|
+
return semver.gte(Cypress.version, expectedVersion);
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
function loginByForm(commandOptions) {
|
|
22
27
|
var _commandOptions$proje;
|
|
23
28
|
|
|
@@ -73,9 +78,9 @@ function loginByForm(commandOptions) {
|
|
|
73
78
|
|
|
74
79
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
75
80
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
76
|
-
cy.session(sessionKey, authCallback, {
|
|
81
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
77
82
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
78
|
-
});
|
|
83
|
+
} : undefined);
|
|
79
84
|
} else {
|
|
80
85
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
81
86
|
authCallback();
|
|
@@ -173,9 +178,9 @@ function loginByOidc(commandOptions) {
|
|
|
173
178
|
|
|
174
179
|
if (Cypress.config('experimentalSessionAndOrigin')) {
|
|
175
180
|
// https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
|
|
176
|
-
cy.session(sessionKey, authCallback, {
|
|
181
|
+
cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
|
|
177
182
|
cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
|
|
178
|
-
});
|
|
183
|
+
} : undefined);
|
|
179
184
|
} else {
|
|
180
185
|
cy.log("We recommend turning on the flag \"experimentalSessionAndOrigin\" to be able to use \"cy.session\" and thus reduce the time to log in between tests.");
|
|
181
186
|
authCallback();
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var constants = require('./constants-42a0ebf5.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "21.
|
|
8
|
+
var version = "21.18.0";
|
|
9
9
|
|
|
10
10
|
exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
|
|
11
11
|
exports.STORAGE_KEYS = constants.STORAGE_KEYS;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var constants = require('./constants-4d9d4b7b.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "21.
|
|
8
|
+
var version = "21.18.0";
|
|
9
9
|
|
|
10
10
|
exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
|
|
11
11
|
exports.STORAGE_KEYS = constants.STORAGE_KEYS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/cypress",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.18.0",
|
|
4
4
|
"description": "Cypress commands and utilities for Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -37,13 +37,14 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.19.0",
|
|
39
39
|
"@babel/runtime-corejs3": "^7.19.0",
|
|
40
|
-
"@commercetools-frontend/application-config": "21.
|
|
41
|
-
"@commercetools-frontend/application-shell": "21.
|
|
40
|
+
"@commercetools-frontend/application-config": "21.18.0",
|
|
41
|
+
"@commercetools-frontend/application-shell": "21.18.0",
|
|
42
42
|
"@manypkg/get-packages": "1.1.3",
|
|
43
|
+
"semver": "7.3.8",
|
|
43
44
|
"uuid": "8.3.2"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"cypress": "10.
|
|
47
|
+
"cypress": "10.10.0"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"cypress": "8.x || 9.x || 10.x"
|