@commercetools-frontend/cypress 24.7.1 → 24.8.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.
@@ -13,9 +13,7 @@ import _URL from '@babel/runtime-corejs3/core-js-stable/url';
13
13
  import semver from 'semver';
14
14
  import { H as HTTP_STATUS_CODES } from '../../dist/constants-13c76918.esm.js';
15
15
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
16
- import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
17
16
  import _Array$from from '@babel/runtime-corejs3/core-js-stable/array/from';
18
- import _entriesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/entries';
19
17
  import _reduceRightInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce-right';
20
18
 
21
19
  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; }
@@ -28,12 +26,7 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _
28
26
  // Alias for backwards compatibility
29
27
 
30
28
  const defaultTimeouts = {
31
- waitForEmailInput: 4000,
32
- waitForPasswordInput: 8000,
33
- waitForElement: 15000,
34
- waitForUrl: 15000,
35
- waitForRedirect: 3000,
36
- waitForIdentityRedirect: 8000
29
+ waitForRedirectToLogin: 1000
37
30
  };
38
31
  function isFeatureSupported(expectedVersion) {
39
32
  return semver.gte(Cypress.version, expectedVersion);
@@ -63,9 +56,9 @@ function loginByForm(commandOptions) {
63
56
  {
64
57
  log: false
65
58
  }).then(appConfig => {
66
- let url = `/${projectKey}/${commandOptions.entryPointUriPath}`;
59
+ let initialUriPath = `/${projectKey}/${commandOptions.entryPointUriPath}`;
67
60
  if (commandOptions.entryPointUriPath === 'account') {
68
- url = `/${commandOptions.entryPointUriPath}`;
61
+ initialUriPath = `/${commandOptions.entryPointUriPath}`;
69
62
  }
70
63
 
71
64
  // Log loaded application config for debugging purposes.
@@ -84,7 +77,7 @@ function loginByForm(commandOptions) {
84
77
  * The function is used by Cypress `session` command to store the
85
78
  * browser state after executing the authentication flow.
86
79
  */
87
- function authCallback() {
80
+ function sessionAuthCallback() {
88
81
  // Get the feature flags from the Merchant Center API so we can
89
82
  // check whether Identity is enabled
90
83
  cy.request({
@@ -92,7 +85,7 @@ function loginByForm(commandOptions) {
92
85
  url: `${appConfig.mcApiUrl}/graphql`,
93
86
  body: {
94
87
  operationName: 'AllFeatures',
95
- query: `query AllFeatures { allFeatures { name value reason } }`
88
+ query: `query AllFeatures { allFeatures { name value } }`
96
89
  },
97
90
  headers: {
98
91
  'content-type': 'application/json',
@@ -110,11 +103,6 @@ function loginByForm(commandOptions) {
110
103
  });
111
104
  const identityUrl = Cypress.env('IDENTITY_URL') || 'https://identity.commercetools.com';
112
105
 
113
- // Visit the application URL, which triggers then the login flow.
114
- cy.visit(url, {
115
- onBeforeLoad: commandOptions.onBeforeLoad
116
- });
117
-
118
106
  /**
119
107
  * There are different scenarios and variations on the flow depending
120
108
  * on the environment (localhost, production) and if Identity is enabled.
@@ -152,79 +140,60 @@ function loginByForm(commandOptions) {
152
140
  */
153
141
 
154
142
  if (isLocalhost) {
143
+ // Visit the special endpoint /api/health to ensure that the primary origin is set to localhost.
144
+ cy.visit('/api/health');
145
+ // Visit the application URL, which triggers then the login flow.
146
+ cy.visit(initialUriPath, {
147
+ onBeforeLoad: commandOptions.onBeforeLoad
148
+ });
149
+ // Cypress gets confused when switching between origins, likely because
150
+ // the redirect to Identity/MC doesn't happen immediately.
151
+ // If we don't wait, Cypress fails as it tries to interact with `cy.origin`
152
+ // but the test is still in the initial origin URL.
153
+ // This is a bit unexpected and to be considered a workaround.
154
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
155
+ cy.wait(commandOptions.timeouts?.waitForRedirectToLogin ?? defaultTimeouts.waitForRedirectToLogin);
155
156
  if (isGlobalIdentityEnabled) {
156
- // Cypress gets confused when switching between origins, likely because
157
- // the redirect to Identity doesn't happen immediately.
158
- // If we don't wait, Cypress fails as it tries to interact with `cy.origin`
159
- // but the test is still in the initial origin URL.
160
- // This is a bit unexpected and to be considered a workaround.
161
- // eslint-disable-next-line cypress/no-unnecessary-waiting
162
- cy.wait(1000);
163
-
164
157
  // Use cy.origin to handle the identity domain
165
158
  cy.origin(identityUrl, {
166
159
  args: {
167
160
  userCredentials,
168
- identityUrl,
169
- timeouts: commandOptions.timeouts,
170
- defaultTimeouts
161
+ identityUrl
171
162
  }
172
163
  }, _ref => {
173
164
  let userCredentials = _ref.userCredentials,
174
- identityUrl = _ref.identityUrl,
175
- timeouts = _ref.timeouts,
176
- defaultTimeouts = _ref.defaultTimeouts;
165
+ identityUrl = _ref.identityUrl;
177
166
  cy.url().should('include', `${identityUrl}/login`);
178
167
  // Fill in the email and click Next
179
- cy.get('input[name="identifier"]', {
180
- timeout: timeouts?.waitForEmailInput ?? defaultTimeouts.waitForEmailInput
181
- }).type(userCredentials.email);
168
+ cy.get('input[name="identifier"]').type(userCredentials.email);
182
169
  cy.get('button').contains('Next').click();
183
170
 
184
171
  // Wait for the password form to appear
185
- cy.get('input[name="password"]', {
186
- timeout: timeouts?.waitForPasswordInput ?? defaultTimeouts.waitForPasswordInput
187
- }).should('be.visible');
172
+ cy.get('input[name="password"]').should('be.visible');
188
173
  // Fill in the password and submit
189
174
  cy.get('input[name="password"]').type(userCredentials.password, {
190
- log: false
175
+ log: false,
176
+ force: true
177
+ });
178
+ cy.get('button').contains('Submit').click({
179
+ force: true
191
180
  });
192
- cy.get('button').contains('Submit').click();
193
181
  });
194
-
195
- // Wait for the flow to redirect back to the application.
196
- // eslint-disable-next-line cypress/no-unnecessary-waiting
197
- cy.wait(commandOptions.timeouts?.waitForRedirect ?? defaultTimeouts.waitForRedirect);
198
- cy.get('[role="main"]', {
199
- timeout: commandOptions.timeouts?.waitForElement ?? defaultTimeouts.waitForElement
200
- }).should('exist');
201
- cy.url({
202
- timeout: commandOptions.timeouts?.waitForUrl ?? defaultTimeouts.waitForUrl
203
- }).should('include', url);
204
182
  } else {
205
183
  const mcUrl = appConfig.mcApiUrl.replace('mc-api', 'mc');
206
- // See similar comment above regarding the usage of `cy.wait`.
207
- // eslint-disable-next-line cypress/no-unnecessary-waiting
208
- cy.wait(1000);
209
184
  cy.origin(mcUrl, {
210
185
  args: {
211
186
  userCredentials,
212
- mcUrl,
213
- timeouts: commandOptions.timeouts,
214
- defaultTimeouts
187
+ mcUrl
215
188
  }
216
189
  }, _ref2 => {
217
190
  let userCredentials = _ref2.userCredentials,
218
- mcUrl = _ref2.mcUrl,
219
- timeouts = _ref2.timeouts,
220
- defaultTimeouts = _ref2.defaultTimeouts;
191
+ mcUrl = _ref2.mcUrl;
221
192
  cy.url().should('include', `${mcUrl}/login`);
222
193
 
223
194
  // Same as `fillLegacyLoginFormWithRetry`.
224
195
  // eslint-disable-next-line cypress/unsafe-to-chain-command
225
- cy.get('input[name=email]', {
226
- timeout: timeouts?.waitForEmailInput ?? defaultTimeouts.waitForEmailInput
227
- })
196
+ cy.get('input[name=email]')
228
197
  // We use `force` as the MC login UI (production) in tests renders the
229
198
  // cookie banner overlapping the input fields.
230
199
  // To allow Cypress to interact with the input fields, we use `force`.
@@ -234,9 +203,7 @@ function loginByForm(commandOptions) {
234
203
  force: true
235
204
  });
236
205
  // eslint-disable-next-line cypress/unsafe-to-chain-command
237
- cy.get('input[name=password]', {
238
- timeout: timeouts?.waitForPasswordInput ?? defaultTimeouts.waitForPasswordInput
239
- })
206
+ cy.get('input[name=password]')
240
207
  // We use `force` as the MC login UI (production) in tests renders the
241
208
  // cookie banner overlapping the input fields.
242
209
  // To allow Cypress to interact with the input fields, we use `force`.
@@ -250,70 +217,56 @@ function loginByForm(commandOptions) {
250
217
  force: true
251
218
  });
252
219
  });
253
- // eslint-disable-next-line cypress/no-unnecessary-waiting
254
- cy.wait(1000);
255
-
256
- // Wait for the flow to redirect back to the application.
257
- cy.get('[role="main"]').should('exist');
258
- cy.url().should('include', url);
259
220
  }
221
+ // Wait for the flow to redirect back to the application.
222
+ cy.get('[role="main"]').should('exist');
223
+ cy.url().should('include', initialUriPath);
260
224
  } else {
225
+ // Ensure the primary origin is set to MC.
226
+ cy.visit(new _URL('/health', Cypress.config('baseUrl')).toString());
261
227
  if (isGlobalIdentityEnabled) {
262
- // Wait for redirect to Identity to complete
263
- // eslint-disable-next-line cypress/no-unnecessary-waiting
264
- cy.wait(commandOptions.timeouts?.waitForIdentityRedirect ?? defaultTimeouts.waitForIdentityRedirect);
265
- cy.url({
266
- timeout: commandOptions.timeouts?.waitForUrl ?? defaultTimeouts.waitForUrl
267
- }).should('include', `${identityUrl}/login`);
268
- // Fill in the email and click Next
269
- cy.get('input[name="identifier"]', {
270
- timeout: commandOptions.timeouts?.waitForEmailInput ?? defaultTimeouts.waitForEmailInput
271
- }).type(userCredentials.email);
272
- cy.get('button').contains('Next').click();
273
-
274
- // Wait for the password form to appear
275
- cy.get('input[name="password"]', {
276
- timeout: commandOptions.timeouts?.waitForPasswordInput ?? defaultTimeouts.waitForPasswordInput
277
- }).should('be.visible');
278
- // Fill in the password and submit
279
- cy.get('input[name="password"]').type(userCredentials.password, {
280
- log: false
281
- });
282
- cy.get('button').contains('Submit').click({
283
- force: true
284
- });
285
-
286
- // Wait for redirect to start
287
- // eslint-disable-next-line cypress/no-unnecessary-waiting
288
- cy.wait(commandOptions.timeouts?.waitForRedirect ?? defaultTimeouts.waitForRedirect);
228
+ const identityArgs = {
229
+ email: userCredentials.email,
230
+ password: userCredentials.password,
231
+ returnTo: new _URL(initialUriPath, Cypress.config('baseUrl')).toString()
232
+ };
233
+
234
+ // Perform the login flow through Identity.
235
+ cy.origin('https://identity.commercetools.com', {
236
+ args: identityArgs
237
+ }, args => {
238
+ cy.visit({
239
+ url: `/login`,
240
+ qs: {
241
+ returnTo: args.returnTo
242
+ }
243
+ });
244
+ // Fill in the email and click Next
245
+ cy.get('input[name="identifier"]').type(args.email);
246
+ cy.get('button').contains('Next').click();
289
247
 
290
- // Wait for the flow to redirect back to the application.
291
- cy.origin(Cypress.config('baseUrl'), {
292
- args: {
293
- url,
294
- timeouts: commandOptions.timeouts,
295
- defaultTimeouts
296
- }
297
- }, _ref3 => {
298
- let url = _ref3.url,
299
- timeouts = _ref3.timeouts,
300
- defaultTimeouts = _ref3.defaultTimeouts;
301
- // Wait for application to fully load
302
- cy.get('[role="main"]', {
303
- timeout: timeouts?.waitForElement ?? defaultTimeouts.waitForElement
304
- }).should('exist');
305
- cy.url({
306
- timeout: timeouts?.waitForUrl ?? defaultTimeouts.waitForUrl
307
- }).should('include', url);
248
+ // Wait for the password form to appear
249
+ cy.get('input[name="password"]').should('be.visible');
250
+ // Fill in the password and submit
251
+ cy.get('input[name="password"]').type(args.password, {
252
+ log: false,
253
+ force: true
254
+ });
255
+ cy.get('button').contains('Submit').click({
256
+ force: true
257
+ });
308
258
  });
309
259
  } else {
310
260
  // Legacy login flow.
311
- fillLegacyLoginFormWithRetry(userCredentials, commandOptions.timeouts);
312
-
313
- // Wait for the flow to redirect back to the application.
314
- cy.get('[role="main"]').should('exist');
315
- cy.url().should('include', url);
261
+ // Visit the application URL, which triggers then the login flow.
262
+ cy.visit(initialUriPath, {
263
+ onBeforeLoad: commandOptions.onBeforeLoad
264
+ });
265
+ fillLegacyLoginFormWithRetry(userCredentials);
316
266
  }
267
+ // Wait for the flow to redirect back to the application.
268
+ cy.get('[role="main"]').should('exist');
269
+ cy.url().should('include', initialUriPath);
317
270
  }
318
271
  });
319
272
  }
@@ -321,18 +274,26 @@ function loginByForm(commandOptions) {
321
274
  // For backwards compatibility.
322
275
  if (isFeatureSupported('12.0.0') || Cypress.config('experimentalSessionAndOrigin')) {
323
276
  // https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
324
- cy.session(sessionKey, authCallback, isFeatureSupported('10.9.0') ? {
277
+ cy.session(sessionKey, sessionAuthCallback, isFeatureSupported('10.9.0') ? {
325
278
  cacheAcrossSpecs: typeof commandOptions.disableCacheAcrossSpecs === 'boolean' ? !commandOptions.disableCacheAcrossSpecs : true
279
+ // TODO: enable it once Identity is enabled by default.
280
+ // validate() {
281
+ // if (isLocalhost) {
282
+ // return;
283
+ // }
284
+ // // Verify that the session is valid (session cookie is included in the request).
285
+ // cy.request(new URL('/whoami', appConfig.mcApiUrl).toString())
286
+ // .its('status')
287
+ // .should('eq', 200);
288
+ // },
326
289
  } : undefined);
327
290
  } else {
328
291
  cy.log(`We recommend to use "cy.session" to reduce the time to log in between tests. Make sure to have at least Cypress v12 or enable it via "experimentalSessionAndOrigin" for older Cypress versions.`);
329
- authCallback();
292
+ sessionAuthCallback();
330
293
  }
331
294
  if (commandOptions.initialRoute) {
332
295
  cy.visit(`${Cypress.config('baseUrl')}${commandOptions.initialRoute}`);
333
- cy.url({
334
- timeout: commandOptions.timeouts?.waitForUrl ?? defaultTimeouts.waitForUrl
335
- }).should('include', commandOptions.initialRoute);
296
+ cy.url().should('include', commandOptions.initialRoute);
336
297
  }
337
298
  });
338
299
  }
@@ -340,7 +301,7 @@ function loginByForm(commandOptions) {
340
301
  /* Utilities */
341
302
 
342
303
  const legacyMaxLoginAttempts = Cypress.config('maxLoginAttempts') ?? 3;
343
- function fillLegacyLoginFormWithRetry(userCredentials, timeouts) {
304
+ function fillLegacyLoginFormWithRetry(userCredentials) {
344
305
  // Intercept the login request so we can retry it if we receive a TOO_MANY_REQUESTS status code
345
306
  cy.intercept('POST', '**/tokens').as('loginRequest');
346
307
  function getRandomDelayInSeconds() {
@@ -355,17 +316,13 @@ function fillLegacyLoginFormWithRetry(userCredentials, timeouts) {
355
316
  cy.log(`Attempts left: ${attemptsLeft}`);
356
317
 
357
318
  // eslint-disable-next-line cypress/unsafe-to-chain-command
358
- cy.get('input[name=email]', {
359
- timeout: timeouts?.waitForEmailInput ?? defaultTimeouts.waitForEmailInput
360
- }).clear({
319
+ cy.get('input[name=email]').clear({
361
320
  force: true
362
321
  }).type(userCredentials.email, {
363
322
  force: true
364
323
  });
365
324
  // eslint-disable-next-line cypress/unsafe-to-chain-command
366
- cy.get('input[name=password]', {
367
- timeout: timeouts?.waitForPasswordInput ?? defaultTimeouts.waitForPasswordInput
368
- }).clear({
325
+ cy.get('input[name=password]').clear({
369
326
  force: true
370
327
  }).type(userCredentials.password, {
371
328
  log: false,
@@ -465,7 +422,7 @@ function scrollIntoView(htmlElement) {
465
422
  // for cross origin domains .frameElement returns null so query using parentWindow
466
423
  // but when running using --disable-web-security it will return the frame element
467
424
  function getFrameElement(currentWindow) {
468
- var _context, _context2;
425
+ var _context;
469
426
  if (currentWindow.frameElement) {
470
427
  // accessible for same-origin iframes
471
428
  // or when running with --disable-web-security
@@ -474,11 +431,7 @@ function getFrameElement(currentWindow) {
474
431
 
475
432
  // fallback to querying using the parent window, mainly to grab the AUT iframe
476
433
  const iframeElements = currentWindow.parent.document.querySelectorAll('iframe');
477
- return _findInstanceProperty(_context = _mapInstanceProperty(_context2 = _Array$from(_entriesInstanceProperty(iframeElements).call(iframeElements))).call(_context2, _ref => {
478
- let _ref2 = _slicedToArray(_ref, 2),
479
- element = _ref2[1];
480
- return element;
481
- })).call(_context, element => element.contentWindow === currentWindow);
434
+ return _findInstanceProperty(_context = _Array$from(iframeElements)).call(_context, element => element.contentWindow === currentWindow);
482
435
  }
483
436
  function getIframesPositionShift(element) {
484
437
  let currentWindow = element.ownerDocument.defaultView;
@@ -500,10 +453,10 @@ function getIframesPositionShift(element) {
500
453
  }
501
454
  currentWindow = currentWindow.parent;
502
455
  }
503
- return _reduceRightInstanceProperty(iframes).call(iframes, (_ref3, frame) => {
504
- let frameX = _ref3.frameX,
505
- frameY = _ref3.frameY,
506
- frameScale = _ref3.frameScale;
456
+ return _reduceRightInstanceProperty(iframes).call(iframes, (_ref, frame) => {
457
+ let frameX = _ref.frameX,
458
+ frameY = _ref.frameY,
459
+ frameScale = _ref.frameScale;
507
460
  const _frame$getBoundingCli = frame.getBoundingClientRect(),
508
461
  x = _frame$getBoundingCli.x,
509
462
  y = _frame$getBoundingCli.y,
@@ -1,2 +1,2 @@
1
- export * from "./declarations/src/index";
2
- //# sourceMappingURL=commercetools-frontend-cypress.cjs.d.ts.map
1
+ export * from "./declarations/src/index.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1mcm9udGVuZC1jeXByZXNzLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var constants = require('./constants-009cb682.cjs.dev.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "24.7.1";
8
+ var version = "24.8.0";
9
9
 
10
10
  exports.HTTP_STATUS_CODES = constants.HTTP_STATUS_CODES;
11
11
  exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var constants = require('./constants-2f1475a6.cjs.prod.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "24.7.1";
8
+ var version = "24.8.0";
9
9
 
10
10
  exports.HTTP_STATUS_CODES = constants.HTTP_STATUS_CODES;
11
11
  exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
@@ -1,6 +1,6 @@
1
1
  export { H as HTTP_STATUS_CODES, O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from './constants-13c76918.esm.js';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "24.7.1";
4
+ var version = "24.8.0";
5
5
 
6
6
  export { version };
@@ -1,5 +1,5 @@
1
1
  import { Matcher as TMatcher } from '@testing-library/dom';
2
- import { type CommandLoginOptions as TCommandLoginOptions, type LoginToMerchantCenterForCustomViewCommandLoginOptions as TLoginToMerchantCenterForCustomViewCommandLoginOptions } from './login';
2
+ import { type CommandLoginOptions as TCommandLoginOptions, type LoginToMerchantCenterForCustomViewCommandLoginOptions as TLoginToMerchantCenterForCustomViewCommandLoginOptions } from "./login.js";
3
3
  export type CommandLoginOptions = TCommandLoginOptions;
4
4
  export type LoginToMerchantCenterForCustomViewCommandLoginOptions = TLoginToMerchantCenterForCustomViewCommandLoginOptions;
5
5
  export type Matcher = TMatcher;
@@ -11,36 +11,11 @@ export type LoginCredentials = {
11
11
  password: string;
12
12
  };
13
13
  export type LoginCommandTimeouts = {
14
- /**
15
- * The number of milliseconds to wait for the email input to appear.
16
- * Defaults to `4000` (4 seconds).
17
- */
18
- waitForEmailInput?: number;
19
- /**
20
- * The number of milliseconds to wait for the password input to appear.
21
- * Defaults to `8000` (8 seconds).
22
- */
23
- waitForPasswordInput?: number;
24
- /**
25
- * The timeout in milliseconds for cy.get() operations on elements.
26
- * Defaults to `15000` (15 seconds).
27
- */
28
- waitForElement?: number;
29
- /**
30
- * The timeout in milliseconds for cy.url() operations.
31
- * Defaults to `15000` (15 seconds).
32
- */
33
- waitForUrl?: number;
34
- /**
35
- * The number of milliseconds to wait for redirects to complete.
36
- * Defaults to `3000` (3 seconds).
37
- */
38
- waitForRedirect?: number;
39
14
  /**
40
15
  * The number of milliseconds to wait for Identity redirect to complete.
41
- * Defaults to `8000` (8 seconds).
16
+ * Defaults to `1000` (1 second).
42
17
  */
43
- waitForIdentityRedirect?: number;
18
+ waitForRedirectToLogin?: number;
44
19
  };
45
20
  export type CommandLoginOptions = {
46
21
  /**
@@ -1,2 +1,2 @@
1
- export { default as version } from './version';
2
- export * from './constants';
1
+ export { default as version } from "./version.js";
2
+ export * from "./constants.js";
@@ -4,10 +4,10 @@ type CustomEntityConfigTaskOptions = {
4
4
  dotfiles?: string[];
5
5
  packageName?: string;
6
6
  };
7
- declare const customApplicationConfig: (options: CustomEntityConfigTaskOptions) => Promise<ApplicationRuntimeConfig['env']>;
8
- declare const customViewConfig: (options: Omit<CustomEntityConfigTaskOptions, 'entryPointUriPath'>) => Promise<ApplicationRuntimeConfig['env']>;
7
+ declare const customApplicationConfig: (options: CustomEntityConfigTaskOptions) => Promise<ApplicationRuntimeConfig["env"]>;
8
+ declare const customViewConfig: (options: Omit<CustomEntityConfigTaskOptions, "entryPointUriPath">) => Promise<ApplicationRuntimeConfig["env"]>;
9
9
  export { customApplicationConfig, customViewConfig };
10
10
  declare const legacyConfig: {
11
- customApplicationConfig: (options: CustomEntityConfigTaskOptions) => Promise<ApplicationRuntimeConfig['env']>;
11
+ customApplicationConfig: (options: CustomEntityConfigTaskOptions) => Promise<ApplicationRuntimeConfig["env"]>;
12
12
  };
13
13
  export default legacyConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/cypress",
3
- "version": "24.7.1",
3
+ "version": "24.8.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,17 +41,17 @@
41
41
  "dependencies": {
42
42
  "@babel/runtime": "^7.22.15",
43
43
  "@babel/runtime-corejs3": "^7.22.15",
44
- "@commercetools-frontend/application-config": "24.7.1",
45
- "@commercetools-frontend/application-shell": "24.7.1",
46
- "@commercetools-frontend/constants": "24.7.1",
44
+ "@commercetools-frontend/application-config": "24.8.0",
45
+ "@commercetools-frontend/application-shell": "24.8.0",
46
+ "@commercetools-frontend/constants": "24.8.0",
47
47
  "@manypkg/get-packages": "1.1.3",
48
48
  "@types/semver": "^7.5.1",
49
- "semver": "7.6.2",
49
+ "semver": "7.7.2",
50
50
  "uuid": "9.0.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@tsconfig/node22": "^22.0.0",
54
- "cypress": "14.5.3"
54
+ "cypress": "14.5.4"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "cypress": ">=8"
@@ -1,3 +1,3 @@
1
- export * from "../../dist/declarations/src/task/index";
2
- export { default } from "../../dist/declarations/src/task/index";
3
- //# sourceMappingURL=commercetools-frontend-cypress-task.cjs.d.ts.map
1
+ export * from "../../dist/declarations/src/task/index.js";
2
+ export { default } from "../../dist/declarations/src/task/index.js";
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1mcm9udGVuZC1jeXByZXNzLXRhc2suY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9kaXN0L2RlY2xhcmF0aW9ucy9zcmMvdGFzay9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -1 +0,0 @@
1
- {"version":3,"file":"commercetools-frontend-cypress-add-commands.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/add-commands/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"commercetools-frontend-cypress.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -1,41 +0,0 @@
1
- /**
2
- * NOTE: the `realHover` command is originally being implemented in `cypress-real-events` package.
3
- * https://github.com/dmtrKovalenko/cypress-real-events/blob/develop/src/commands/realHover.ts
4
- *
5
- * However, due to known issues with conflicting types between Cypress and Jest, importing the `cypress-real-events`
6
- * package here will cause such issues with TypeScript as our `@commercetools-frontend/cypress` package
7
- * is checked and built together with all other packages and not in isolation.
8
- * See https://docs.cypress.io/guides/tooling/typescript-support#Clashing-types-with-Jest.
9
- *
10
- * Therefore, we are porting here the implementation of `realHover` to avoid importing it from the
11
- * original package `cypress-real-events`.
12
- */
13
- export interface RealHoverOptions {
14
- /**
15
- * If set to `pen`, simulates touch based hover (via long press)
16
- */
17
- pointer?: 'mouse' | 'pen';
18
- /**
19
- * Position relative to the element where to hover the element.
20
- * @example cy.realHover({ position: "topLeft" })
21
- */
22
- position?: Position;
23
- /**
24
- * Controls how the page is scrolled to bring the subject into view, if needed.
25
- * @example cy.realHover({ scrollBehavior: "top" });
26
- */
27
- scrollBehavior?: ScrollBehaviorOptions;
28
- /**
29
- * Indicates whether the shift key was pressed or not when an event occurred
30
- * @example cy.realHover({ shiftKey: true });
31
- */
32
- shiftKey?: boolean;
33
- }
34
- type Position = 'topLeft' | 'top' | 'topRight' | 'left' | 'center' | 'right' | 'bottomLeft' | 'bottom' | 'bottomRight' | {
35
- x: number;
36
- y: number;
37
- };
38
- type ScrollBehaviorPosition = 'center' | 'top' | 'bottom' | 'nearest';
39
- type ScrollBehaviorOptions = ScrollBehaviorPosition | false;
40
- export declare function realHover(subject: any, options?: RealHoverOptions): Promise<any>;
41
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"commercetools-frontend-cypress-task.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/task/index.d.ts"],"names":[],"mappings":"AAAA"}