@commercetools-frontend/cypress 22.14.2 → 22.15.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.
@@ -10,6 +10,8 @@ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/ob
10
10
  var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
11
11
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
12
12
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
13
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
14
+ var constants$1 = require('@commercetools-frontend/constants');
13
15
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
14
16
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
15
17
  var semver = require('semver');
@@ -17,7 +19,6 @@ var uuid = require('uuid');
17
19
  var ssr = require('@commercetools-frontend/application-shell/ssr');
18
20
  var constants = require('../../dist/constants-c657705e.cjs.dev.js');
19
21
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
20
- var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
21
22
  var _reduceRightInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce-right');
22
23
 
23
24
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -31,14 +32,14 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
31
32
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
32
33
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
33
34
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
35
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
34
36
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
35
37
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
36
38
  var semver__default = /*#__PURE__*/_interopDefault(semver);
37
- var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
38
39
  var _reduceRightInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceRightInstanceProperty);
39
40
 
40
- function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
41
+ function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
42
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$1(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
42
43
 
43
44
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
45
 
@@ -161,7 +162,7 @@ function loginByOidc(commandOptions) {
161
162
  const requestOptions = {
162
163
  method: 'POST',
163
164
  url: "".concat(appConfig.mcApiUrl, "/tokens"),
164
- body: _objectSpread(_objectSpread({}, userCredentials), {}, {
165
+ body: _objectSpread$1(_objectSpread$1({}, userCredentials), {}, {
165
166
  client_id: applicationId,
166
167
  response_type: constants.OIDC_RESPONSE_TYPES.ID_TOKEN,
167
168
  scope: sessionScope,
@@ -436,6 +437,9 @@ subject) {
436
437
  return subject;
437
438
  }
438
439
 
440
+ function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
441
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
442
+
439
443
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
440
444
 
441
445
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -450,6 +454,17 @@ Cypress.Commands.add('loginToMerchantCenter', commandOptions => {
450
454
  loginByForm(commandOptions);
451
455
  }
452
456
  });
457
+ Cypress.Commands.add('loginToMerchantCenterForCustomView', commandOptions => {
458
+ var _context;
459
+ Cypress.log({
460
+ name: 'loginToMerchantCenterForCustomView'
461
+ });
462
+ const projectKey = Cypress.env('PROJECT_KEY');
463
+ loginByOidc(_objectSpread(_objectSpread({}, commandOptions), {}, {
464
+ entryPointUriPath: constants$1.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH,
465
+ initialRoute: _concatInstanceProperty__default["default"](_context = "/".concat(projectKey, "/")).call(_context, constants$1.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH)
466
+ }));
467
+ });
453
468
  Cypress.Commands.add('loginByOidc', commandOptions => {
454
469
  Cypress.log({
455
470
  name: 'loginByOidc'
@@ -465,3 +480,16 @@ Cypress.Commands.add('showNavigationSubmenuItems', menuItemTextMatcher => {
465
480
  // Refers to the custom command "hover"
466
481
  .hover();
467
482
  });
483
+
484
+ // https://github.com/cypress-io/cypress/issues/136#issuecomment-342391119
485
+ Cypress.Commands.add('getIframeBody', {
486
+ prevSubject: 'element'
487
+ },
488
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
489
+ $iframe => {
490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
491
+ return new Cypress.Promise(resolve => {
492
+ var _context2;
493
+ resolve(_findInstanceProperty__default["default"](_context2 = $iframe.contents()).call(_context2, 'body'));
494
+ });
495
+ });
@@ -10,6 +10,8 @@ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/ob
10
10
  var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
11
11
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
12
12
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
13
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
14
+ var constants$1 = require('@commercetools-frontend/constants');
13
15
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
14
16
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
15
17
  var semver = require('semver');
@@ -17,7 +19,6 @@ var uuid = require('uuid');
17
19
  var ssr = require('@commercetools-frontend/application-shell/ssr');
18
20
  var constants = require('../../dist/constants-8ad2a50e.cjs.prod.js');
19
21
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
20
- var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
21
22
  var _reduceRightInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce-right');
22
23
 
23
24
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -31,14 +32,14 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
31
32
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
32
33
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
33
34
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
35
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
34
36
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
35
37
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
36
38
  var semver__default = /*#__PURE__*/_interopDefault(semver);
37
- var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
38
39
  var _reduceRightInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceRightInstanceProperty);
39
40
 
40
- function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
41
+ function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
42
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$1(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
42
43
 
43
44
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
45
 
@@ -161,7 +162,7 @@ function loginByOidc(commandOptions) {
161
162
  const requestOptions = {
162
163
  method: 'POST',
163
164
  url: "".concat(appConfig.mcApiUrl, "/tokens"),
164
- body: _objectSpread(_objectSpread({}, userCredentials), {}, {
165
+ body: _objectSpread$1(_objectSpread$1({}, userCredentials), {}, {
165
166
  client_id: applicationId,
166
167
  response_type: constants.OIDC_RESPONSE_TYPES.ID_TOKEN,
167
168
  scope: sessionScope,
@@ -436,6 +437,9 @@ subject) {
436
437
  return subject;
437
438
  }
438
439
 
440
+ function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
441
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
442
+
439
443
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
440
444
 
441
445
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -450,6 +454,17 @@ Cypress.Commands.add('loginToMerchantCenter', commandOptions => {
450
454
  loginByForm(commandOptions);
451
455
  }
452
456
  });
457
+ Cypress.Commands.add('loginToMerchantCenterForCustomView', commandOptions => {
458
+ var _context;
459
+ Cypress.log({
460
+ name: 'loginToMerchantCenterForCustomView'
461
+ });
462
+ const projectKey = Cypress.env('PROJECT_KEY');
463
+ loginByOidc(_objectSpread(_objectSpread({}, commandOptions), {}, {
464
+ entryPointUriPath: constants$1.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH,
465
+ initialRoute: _concatInstanceProperty__default["default"](_context = "/".concat(projectKey, "/")).call(_context, constants$1.CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH)
466
+ }));
467
+ });
453
468
  Cypress.Commands.add('loginByOidc', commandOptions => {
454
469
  Cypress.log({
455
470
  name: 'loginByOidc'
@@ -465,3 +480,16 @@ Cypress.Commands.add('showNavigationSubmenuItems', menuItemTextMatcher => {
465
480
  // Refers to the custom command "hover"
466
481
  .hover();
467
482
  });
483
+
484
+ // https://github.com/cypress-io/cypress/issues/136#issuecomment-342391119
485
+ Cypress.Commands.add('getIframeBody', {
486
+ prevSubject: 'element'
487
+ },
488
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
489
+ $iframe => {
490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
491
+ return new Cypress.Promise(resolve => {
492
+ var _context2;
493
+ resolve(_findInstanceProperty__default["default"](_context2 = $iframe.contents()).call(_context2, 'body'));
494
+ });
495
+ });
@@ -8,6 +8,8 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
8
8
  import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
9
  import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
10
  import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
11
+ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
12
+ import { CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH } from '@commercetools-frontend/constants';
11
13
  import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
12
14
  import _URL from '@babel/runtime-corejs3/core-js-stable/url';
13
15
  import semver from 'semver';
@@ -15,11 +17,10 @@ import { v4 } from 'uuid';
15
17
  import { buildOidcScope } from '@commercetools-frontend/application-shell/ssr';
16
18
  import { O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from '../../dist/constants-18b165fc.esm.js';
17
19
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
18
- import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
19
20
  import _reduceRightInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce-right';
20
21
 
21
- function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ function ownKeys$1(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys$1(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys$1(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
23
24
 
24
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
26
 
@@ -142,7 +143,7 @@ function loginByOidc(commandOptions) {
142
143
  const requestOptions = {
143
144
  method: 'POST',
144
145
  url: "".concat(appConfig.mcApiUrl, "/tokens"),
145
- body: _objectSpread(_objectSpread({}, userCredentials), {}, {
146
+ body: _objectSpread$1(_objectSpread$1({}, userCredentials), {}, {
146
147
  client_id: applicationId,
147
148
  response_type: OIDC_RESPONSE_TYPES.ID_TOKEN,
148
149
  scope: sessionScope,
@@ -417,6 +418,9 @@ subject) {
417
418
  return subject;
418
419
  }
419
420
 
421
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
422
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
423
+
420
424
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
421
425
 
422
426
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -431,6 +435,17 @@ Cypress.Commands.add('loginToMerchantCenter', commandOptions => {
431
435
  loginByForm(commandOptions);
432
436
  }
433
437
  });
438
+ Cypress.Commands.add('loginToMerchantCenterForCustomView', commandOptions => {
439
+ var _context;
440
+ Cypress.log({
441
+ name: 'loginToMerchantCenterForCustomView'
442
+ });
443
+ const projectKey = Cypress.env('PROJECT_KEY');
444
+ loginByOidc(_objectSpread(_objectSpread({}, commandOptions), {}, {
445
+ entryPointUriPath: CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH,
446
+ initialRoute: _concatInstanceProperty(_context = "/".concat(projectKey, "/")).call(_context, CUSTOM_VIEW_HOST_ENTRY_POINT_URI_PATH)
447
+ }));
448
+ });
434
449
  Cypress.Commands.add('loginByOidc', commandOptions => {
435
450
  Cypress.log({
436
451
  name: 'loginByOidc'
@@ -446,3 +461,16 @@ Cypress.Commands.add('showNavigationSubmenuItems', menuItemTextMatcher => {
446
461
  // Refers to the custom command "hover"
447
462
  .hover();
448
463
  });
464
+
465
+ // https://github.com/cypress-io/cypress/issues/136#issuecomment-342391119
466
+ Cypress.Commands.add('getIframeBody', {
467
+ prevSubject: 'element'
468
+ },
469
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
470
+ $iframe => {
471
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
472
+ return new Cypress.Promise(resolve => {
473
+ var _context2;
474
+ resolve(_findInstanceProperty(_context2 = $iframe.contents()).call(_context2, 'body'));
475
+ });
476
+ });
@@ -12,6 +12,20 @@ declare namespace Cypress {
12
12
  // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types
13
13
  options?: import('./dist/commercetools-frontend-cypress-add-commands.cjs').CommandLoginOptions
14
14
  ): Chainable<Subject>;
15
+ /**
16
+ * Log into the Custom View.
17
+ * Custom Views are assumed to be tested on localhost and `loginByOidc` mechanism is used
18
+ *
19
+ * @example
20
+ * cy.loginToMerchantCenterForCustomView()
21
+ */
22
+ loginToMerchantCenterForCustomView(
23
+ // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types
24
+ options?: Omit<
25
+ import('./dist/commercetools-frontend-cypress-add-commands.cjs').CommandLoginOptions,
26
+ 'entryPointUriPath' | 'initialRoute'
27
+ >
28
+ ): Chainable<Subject>;
15
29
  /**
16
30
  * Log into the Custom Application using the OIDC workflow.
17
31
  * The command only works for testing an application running on localhost.
@@ -45,5 +59,13 @@ declare namespace Cypress {
45
59
  // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#import-types
46
60
  menuItemTextMatcher: import('./dist/commercetools-frontend-cypress-add-commands.cjs').Matcher
47
61
  ): Chainable<Subject>;
62
+
63
+ /**
64
+ * Returns the body of the chained iframe element
65
+ *
66
+ * @example
67
+ * cy.get('#iframe-id').getIframeBody()
68
+ */
69
+ getIframeBody(): Chainable<Subject>;
48
70
  }
49
71
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var constants = require('./constants-c657705e.cjs.dev.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "22.14.2";
8
+ var version = "22.15.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-8ad2a50e.cjs.prod.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "22.14.2";
8
+ var version = "22.15.0";
9
9
 
10
10
  exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
11
11
  exports.STORAGE_KEYS = constants.STORAGE_KEYS;
@@ -1,6 +1,6 @@
1
1
  export { O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from './constants-18b165fc.esm.js';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "22.14.2";
4
+ var version = "22.15.0";
5
5
 
6
6
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/cypress",
3
- "version": "22.14.2",
3
+ "version": "22.15.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": {
@@ -41,8 +41,9 @@
41
41
  "dependencies": {
42
42
  "@babel/runtime": "^7.22.15",
43
43
  "@babel/runtime-corejs3": "^7.22.15",
44
- "@commercetools-frontend/application-config": "22.14.2",
45
- "@commercetools-frontend/application-shell": "22.14.2",
44
+ "@commercetools-frontend/application-config": "22.15.0",
45
+ "@commercetools-frontend/application-shell": "22.15.0",
46
+ "@commercetools-frontend/constants": "22.15.0",
46
47
  "@manypkg/get-packages": "1.1.3",
47
48
  "@types/semver": "^7.5.1",
48
49
  "semver": "7.5.2",