cypress 7.5.0 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Cypress
2
2
 
3
+ Fast, easy and reliable testing for anything that runs in a browser.
4
+
3
5
  ## What is this?
4
6
 
5
- Cypress comes packaged as an `npm` module, which is all you need to get started.
7
+ [Cypress](https://www.cypress.io/) comes packaged as an `npm` module, which is all you need to get started testing.
6
8
 
7
9
  After installing you'll be able to:
8
10
 
@@ -12,7 +14,7 @@ After installing you'll be able to:
12
14
 
13
15
  ## Install
14
16
 
15
- Requires Node version >= 10.0.0
17
+ Please check our [system requirements](https://on.cypress.io/installing-cypress).
16
18
 
17
19
  ```sh
18
20
  npm install --save-dev cypress
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ // Vendored from @cypress/listr-verbose-renderer
4
+ const figures = require('figures');
5
+
6
+ const cliCursor = require('cli-cursor');
7
+
8
+ const chalk = require('chalk');
9
+
10
+ const dayjs = require('dayjs');
11
+
12
+ const formattedLog = (options, output) => {
13
+ const timestamp = dayjs().format(options.dateFormat); // eslint-disable-next-line no-console
14
+
15
+ console.log(`${chalk.dim(`[${timestamp}]`)} ${output}`);
16
+ };
17
+
18
+ const renderHelper = (task, event, options) => {
19
+ const log = formattedLog.bind(undefined, options);
20
+
21
+ if (event.type === 'STATE') {
22
+ const message = task.isPending() ? 'started' : task.state;
23
+ log(`${task.title} [${message}]`);
24
+
25
+ if (task.isSkipped() && task.output) {
26
+ log(`${figures.arrowRight} ${task.output}`);
27
+ }
28
+ } else if (event.type === 'TITLE') {
29
+ log(`${task.title} [title changed]`);
30
+ }
31
+ };
32
+
33
+ const render = (tasks, options) => {
34
+ for (const task of tasks) {
35
+ task.subscribe(event => {
36
+ if (event.type === 'SUBTASKS') {
37
+ render(task.subtasks, options);
38
+ return;
39
+ }
40
+
41
+ renderHelper(task, event, options);
42
+ }, err => {
43
+ // eslint-disable-next-line no-console
44
+ console.log(err);
45
+ });
46
+ }
47
+ };
48
+
49
+ class VerboseRenderer {
50
+ constructor(tasks, options) {
51
+ this._tasks = tasks;
52
+ this._options = Object.assign({
53
+ dateFormat: 'HH:mm:ss'
54
+ }, options);
55
+ }
56
+
57
+ static get nonTTY() {
58
+ return true;
59
+ }
60
+
61
+ render() {
62
+ cliCursor.hide();
63
+ render(this._tasks, this._options);
64
+ }
65
+
66
+ end() {
67
+ cliCursor.show();
68
+ }
69
+
70
+ }
71
+
72
+ module.exports = VerboseRenderer;
package/lib/cli.js CHANGED
@@ -129,8 +129,8 @@ const descriptions = {
129
129
  forceInstall: 'force install the Cypress binary',
130
130
  global: 'force Cypress into global mode as if its globally installed',
131
131
  group: 'a named group for recorded runs in the Cypress Dashboard',
132
- headed: 'displays the browser instead of running headlessly (defaults to true for Firefox and Chromium-family browsers)',
133
- headless: 'hide the browser instead of running headed (defaults to true for Electron)',
132
+ headed: 'displays the browser instead of running headlessly',
133
+ headless: 'hide the browser instead of running headed (default for cypress run)',
134
134
  key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
135
135
  parallel: 'enables concurrent runs and automatic load balancing of specs across multiple machines or processes',
136
136
  port: 'runs Cypress on a specific port. overrides any value in cypress.json.',
package/lib/errors.js CHANGED
@@ -151,13 +151,9 @@ const invalidSmokeTestDisplayError = {
151
151
 
152
152
  ${hr}
153
153
 
154
- This is usually caused by a missing library or dependency.
154
+ This may be due to a missing library or dependency. ${chalk.blue(requiredDependenciesUrl)}
155
155
 
156
- The error above should indicate which dependency is missing.
157
-
158
- ${chalk.blue(requiredDependenciesUrl)}
159
-
160
- If you are using Docker, we provide containers with all required dependencies installed.
156
+ Please refer to the error above for more detail.
161
157
  `;
162
158
  }
163
159
 
@@ -166,13 +162,9 @@ const missingDependency = {
166
162
  description: 'Cypress failed to start.',
167
163
  // this message is too Linux specific
168
164
  solution: stripIndent`
169
- This is usually caused by a missing library or dependency.
170
-
171
- The error below should indicate which dependency is missing.
165
+ This may be due to a missing library or dependency. ${chalk.blue(requiredDependenciesUrl)}
172
166
 
173
- ${chalk.blue(requiredDependenciesUrl)}
174
-
175
- If you are using Docker, we provide containers with all required dependencies installed.
167
+ Please refer to the error below for more details.
176
168
  `
177
169
  };
178
170
  const invalidCacheDirectory = {
package/lib/exec/spawn.js CHANGED
@@ -76,15 +76,17 @@ module.exports = {
76
76
  executable = path.resolve(util.getEnv('CYPRESS_RUN_BINARY'));
77
77
  }
78
78
 
79
- debug('needs to start own Xvfb?', needsXvfb); // 1. Start arguments with "--" so Electron knows these are OUR
80
- // arguments and does not try to sanitize them. Otherwise on Windows
81
- // an url in one of the arguments crashes it :(
82
- // https://github.com/cypress-io/cypress/issues/5466
83
- // 2. Always push cwd into the args
79
+ debug('needs to start own Xvfb?', needsXvfb); // Always push cwd into the args
84
80
  // which additionally acts as a signal to the
85
81
  // binary that it was invoked through the NPM module
86
82
 
87
- args = ['--'].concat(args, '--cwd', process.cwd());
83
+ args = args || [];
84
+
85
+ if (typeof args === 'string') {
86
+ args = [args];
87
+ }
88
+
89
+ args = [...args, '--cwd', process.cwd()];
88
90
 
89
91
  _.defaults(options, {
90
92
  dev: false,
@@ -100,28 +102,24 @@ module.exports = {
100
102
  electronLogging: false
101
103
  });
102
104
 
103
- if (options.dev) {
104
- // if we're in dev then reset
105
- // the launch cmd to be 'npm run dev'
106
- executable = 'node';
107
- args.unshift(path.resolve(__dirname, '..', '..', '..', 'scripts', 'start.js'));
108
- debug('in dev mode the args became %o', args);
109
- }
110
-
111
105
  const {
112
106
  onStderrData,
113
107
  electronLogging
114
108
  } = overrides;
115
109
  const envOverrides = util.getEnvOverrides(options);
116
-
117
- const electronArgs = _.clone(args);
118
-
110
+ const electronArgs = [];
119
111
  const node11WindowsFix = isPlatform('win32');
120
112
 
113
+ if (options.dev) {
114
+ // if we're in dev then reset
115
+ // the launch cmd to be 'npm run dev'
116
+ executable = 'node';
117
+ electronArgs.unshift(path.resolve(__dirname, '..', '..', '..', 'scripts', 'start.js'));
118
+ debug('in dev mode the args became %o', args);
119
+ }
120
+
121
121
  if (!options.dev && verify.needsSandbox()) {
122
- // this is one of the Electron's command line switches
123
- // thus it needs to be before "--" separator
124
- electronArgs.unshift('--no-sandbox');
122
+ electronArgs.push('--no-sandbox');
125
123
  } // strip dev out of child process options
126
124
 
127
125
 
@@ -148,9 +146,21 @@ module.exports = {
148
146
  stdioOptions.env.DISPLAY = process.env.DISPLAY;
149
147
  }
150
148
 
149
+ if (stdioOptions.env.ELECTRON_RUN_AS_NODE) {
150
+ // Since we are running electron as node, we need to add an entry point file.
151
+ const serverEntryPoint = path.join(state.getBinaryPkgPath(path.dirname(executable)), '..', 'index.js');
152
+ args = [serverEntryPoint, ...args];
153
+ } else {
154
+ // Start arguments with "--" so Electron knows these are OUR
155
+ // arguments and does not try to sanitize them. Otherwise on Windows
156
+ // an url in one of the arguments crashes it :(
157
+ // https://github.com/cypress-io/cypress/issues/5466
158
+ args = [...electronArgs, '--', ...args];
159
+ }
160
+
151
161
  debug('spawning Cypress with executable: %s', executable);
152
- debug('spawn args %o %o', electronArgs, _.omit(stdioOptions, 'env'));
153
- const child = cp.spawn(executable, electronArgs, stdioOptions);
162
+ debug('spawn args %o %o', args, _.omit(stdioOptions, 'env'));
163
+ const child = cp.spawn(executable, args, stdioOptions);
154
164
 
155
165
  function resolveOn(event) {
156
166
  return function (code, signal) {
package/lib/exec/xvfb.js CHANGED
@@ -65,6 +65,11 @@ module.exports = {
65
65
  },
66
66
 
67
67
  isNeeded() {
68
+ if (process.env.ELECTRON_RUN_AS_NODE) {
69
+ debug('Environment variable ELECTRON_RUN_AS_NODE detected, xvfb is not needed');
70
+ return false; // xvfb required for electron processes only.
71
+ }
72
+
68
73
  if (os.platform() !== 'linux') {
69
74
  return false;
70
75
  }
@@ -16,8 +16,6 @@ const {
16
16
  Listr
17
17
  } = require('listr2');
18
18
 
19
- const verbose = require('@cypress/listr-verbose-renderer');
20
-
21
19
  const Promise = require('bluebird');
22
20
 
23
21
  const logSymbols = require('log-symbols');
@@ -43,6 +41,8 @@ const {
43
41
  errors
44
42
  } = require('../errors');
45
43
 
44
+ const verbose = require('../VerboseRenderer');
45
+
46
46
  const getNpmArgv = () => {
47
47
  const json = process.env.npm_config_argv;
48
48
 
@@ -10,8 +10,6 @@ const {
10
10
 
11
11
  const debug = require('debug')('cypress:cli');
12
12
 
13
- const verbose = require('@cypress/listr-verbose-renderer');
14
-
15
13
  const {
16
14
  stripIndent
17
15
  } = require('common-tags');
@@ -24,6 +22,8 @@ const path = require('path');
24
22
 
25
23
  const os = require('os');
26
24
 
25
+ const verbose = require('../VerboseRenderer');
26
+
27
27
  const {
28
28
  throwFormErrorText,
29
29
  errors
package/lib/util.js CHANGED
@@ -263,7 +263,17 @@ const util = {
263
263
  .mapValues(value => {
264
264
  // stringify to 1 or 0
265
265
  return value ? '1' : '0';
266
- }).value();
266
+ }).extend(util.getOriginalNodeOptions(options)).value();
267
+ },
268
+
269
+ getOriginalNodeOptions(options) {
270
+ if (process.env.NODE_OPTIONS) {
271
+ return {
272
+ ORIGINAL_NODE_OPTIONS: process.env.NODE_OPTIONS
273
+ };
274
+ }
275
+
276
+ return {};
267
277
  },
268
278
 
269
279
  getForceTty() {
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "cypress",
3
- "version": "7.5.0",
3
+ "version": "8.1.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node index.js --exec install",
7
7
  "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
8
8
  },
9
9
  "dependencies": {
10
- "@cypress/listr-verbose-renderer": "^0.4.1",
11
10
  "@cypress/request": "^2.88.5",
12
11
  "@cypress/xvfb": "^1.2.4",
13
12
  "@types/node": "^14.14.31",
@@ -19,15 +18,18 @@
19
18
  "cachedir": "^2.3.0",
20
19
  "chalk": "^4.1.0",
21
20
  "check-more-types": "^2.24.0",
21
+ "cli-cursor": "^3.1.0",
22
22
  "cli-table3": "~0.6.0",
23
23
  "commander": "^5.1.0",
24
24
  "common-tags": "^1.8.0",
25
25
  "dayjs": "^1.10.4",
26
- "debug": "4.3.2",
26
+ "debug": "^4.3.2",
27
+ "enquirer": "^2.3.6",
27
28
  "eventemitter2": "^6.4.3",
28
29
  "execa": "4.1.0",
29
30
  "executable": "^4.1.1",
30
31
  "extract-zip": "2.0.1",
32
+ "figures": "^3.2.0",
31
33
  "fs-extra": "^9.1.0",
32
34
  "getos": "^3.2.1",
33
35
  "is-ci": "^3.0.0",
@@ -138,7 +138,7 @@ declare namespace CypressCommandLine {
138
138
  /**
139
139
  * Specify configuration
140
140
  */
141
- config: Partial<Cypress.ResolvedConfigOptions>
141
+ config: Cypress.ConfigOptions
142
142
  /**
143
143
  * Path to the config file to be used.
144
144
  *
@@ -60,10 +60,26 @@ declare namespace Cypress {
60
60
  */
61
61
  displayName: string
62
62
  version: string
63
- majorVersion: number
63
+ majorVersion: number | string
64
64
  path: string
65
65
  isHeaded: boolean
66
66
  isHeadless: boolean
67
+ /**
68
+ * Informational text to accompany this browser. Shown in desktop-gui.
69
+ */
70
+ info?: string
71
+ /**
72
+ * Warning text to accompany this browser. Shown in desktop-gui.
73
+ */
74
+ warning?: string
75
+ /**
76
+ * The minimum majorVersion of this browser supported by Cypress.
77
+ */
78
+ minSupportedVersion?: number
79
+ /**
80
+ * If `true`, this browser is too old to be supported by Cypress.
81
+ */
82
+ unsupportedVersion?: boolean
67
83
  }
68
84
 
69
85
  interface LocalStorage {
@@ -341,15 +357,6 @@ declare namespace Cypress {
341
357
  */
342
358
  env(object: ObjectLike): void
343
359
 
344
- /**
345
- * Firefox only: Get the current number of tests that will run between forced garbage collections.
346
- *
347
- * Returns undefined if not in Firefox, returns a null or 0 if forced GC is disabled.
348
- *
349
- * @see https://on.cypress.io/firefox-gc-issue
350
- */
351
- getFirefoxGcInterval(): number | null | undefined
352
-
353
360
  /**
354
361
  * @returns the number of test retries currently enabled for the run
355
362
  */
@@ -490,6 +497,13 @@ declare namespace Cypress {
490
497
  getElementCoordinatesByPositionRelativeToXY(element: JQuery | HTMLElement, x: number, y: number): ElementPositioning
491
498
  }
492
499
 
500
+ /**
501
+ * @see https://on.cypress.io/keyboard-api
502
+ */
503
+ Keyboard: {
504
+ defaults(options: Partial<KeyboardDefaultsOptions>): void
505
+ }
506
+
493
507
  /**
494
508
  * @see https://on.cypress.io/api/api-server
495
509
  */
@@ -841,7 +855,7 @@ declare namespace Cypress {
841
855
  * // tries to find the given text for up to 1 second
842
856
  * cy.contains('my text to find', {timeout: 1000})
843
857
  */
844
- contains(content: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable>): Chainable<Subject>
858
+ contains(content: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<Subject>
845
859
  /**
846
860
  * Get the child DOM element that contains given text.
847
861
  *
@@ -859,7 +873,7 @@ declare namespace Cypress {
859
873
  * // yields <ul>...</ul>
860
874
  * cy.contains('ul', 'apples')
861
875
  */
862
- contains<K extends keyof HTMLElementTagNameMap>(selector: K, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
876
+ contains<K extends keyof HTMLElementTagNameMap>(selector: K, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<JQuery<HTMLElementTagNameMap[K]>>
863
877
  /**
864
878
  * Get the DOM element using CSS "selector" containing the text or regular expression.
865
879
  *
@@ -868,7 +882,7 @@ declare namespace Cypress {
868
882
  * // yields <... class="foo">... apples ...</...>
869
883
  * cy.contains('.foo', 'apples')
870
884
  */
871
- contains<E extends Node = HTMLElement>(selector: string, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable>): Chainable<JQuery<E>>
885
+ contains<E extends Node = HTMLElement>(selector: string, text: string | number | RegExp, options?: Partial<Loggable & Timeoutable & CaseMatchable & Shadow>): Chainable<JQuery<E>>
872
886
 
873
887
  /**
874
888
  * Double-click a DOM element.
@@ -1647,7 +1661,7 @@ declare namespace Cypress {
1647
1661
  * .shadow()
1648
1662
  * .find('.my-button')
1649
1663
  * .click()
1650
- * @see https://on.cypress.io/experimental
1664
+ * @see https://on.cypress.io/shadow
1651
1665
  */
1652
1666
  shadow(): Chainable<Subject>
1653
1667
 
@@ -1826,6 +1840,12 @@ declare namespace Cypress {
1826
1840
  * @see https://on.cypress.io/then
1827
1841
  */
1828
1842
  then<S>(options: Partial<Timeoutable>, fn: (this: ObjectLike, currentSubject: Subject) => PromiseLike<S>): Chainable<S>
1843
+ /**
1844
+ * Enables you to work with the subject yielded from the previous command / promise.
1845
+ *
1846
+ * @see https://on.cypress.io/then
1847
+ */
1848
+ then<S extends string | number | boolean>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
1829
1849
  /**
1830
1850
  * Enables you to work with the subject yielded from the previous command / promise.
1831
1851
  *
@@ -1843,7 +1863,7 @@ declare namespace Cypress {
1843
1863
  *
1844
1864
  * @see https://on.cypress.io/then
1845
1865
  */
1846
- then<S extends object | any[] | string | number | boolean>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
1866
+ then<S extends any[] | object>(fn: (this: ObjectLike, currentSubject: Subject) => S): Chainable<S>
1847
1867
  /**
1848
1868
  * Enables you to work with the subject yielded from the previous command / promise.
1849
1869
  *
@@ -2633,13 +2653,6 @@ declare namespace Cypress {
2633
2653
  * @default 'top'
2634
2654
  */
2635
2655
  scrollBehavior: scrollBehaviorOptions
2636
- /**
2637
- * Firefox version 79 and below only: The number of tests that will run between forced garbage collections.
2638
- * If a number is supplied, it will apply to `run` mode and `open` mode.
2639
- * Set the interval to `null` or 0 to disable forced garbage collections.
2640
- * @default { runMode: 1, openMode: null }
2641
- */
2642
- firefoxGcInterval: Nullable<number | { runMode: Nullable<number>, openMode: Nullable<number> }>
2643
2656
  /**
2644
2657
  * Allows listening to the `before:run`, `after:run`, `before:spec`, and `after:spec` events in the plugins file during interactive mode.
2645
2658
  * @default false
@@ -2671,17 +2684,46 @@ declare namespace Cypress {
2671
2684
  */
2672
2685
  includeShadowDom: boolean
2673
2686
 
2687
+ /**
2688
+ * The list of hosts to be blocked
2689
+ */
2690
+ blockHosts: null | string | string[]
2691
+ /**
2692
+ * Path to folder containing component test files.
2693
+ */
2694
+ componentFolder: false | string
2695
+ /**
2696
+ * A unique ID for the project used for recording
2697
+ */
2698
+ projectId: null | string
2699
+ /**
2700
+ * Path to the support folder.
2701
+ */
2702
+ supportFolder: string
2703
+ /**
2704
+ * Glob pattern to determine what test files to load.
2705
+ */
2706
+ testFiles: string | string[]
2707
+ /**
2708
+ * The user agent the browser sends in all request headers.
2709
+ */
2710
+ userAgent: null | string
2711
+ /**
2712
+ * Polyfills `window.fetch` to enable Network spying and stubbing
2713
+ */
2714
+ experimentalFetchPolyfill: boolean
2715
+
2674
2716
  /**
2675
2717
  * Override default config options for Component Testing runner.
2676
2718
  * @default {}
2677
2719
  */
2678
- component: ResolvedConfigOptions
2720
+ component: Omit<ResolvedConfigOptions, TestingType>
2679
2721
 
2680
2722
  /**
2681
2723
  * Override default config options for E2E Testing runner.
2682
2724
  * @default {}
2683
2725
  */
2684
- e2e: ResolvedConfigOptions
2726
+ e2e: Omit<ResolvedConfigOptions, TestingType>
2685
2727
  }
2686
2728
 
2687
2729
  /**
@@ -2694,10 +2736,6 @@ declare namespace Cypress {
2694
2736
  * @see https://nodejs.org/api/os.html#os_os_arch
2695
2737
  */
2696
2738
  arch: string
2697
- /**
2698
- * The list of hosts to be blocked
2699
- */
2700
- blockHosts: null | string | string[]
2701
2739
  /**
2702
2740
  * The browser Cypress is running on.
2703
2741
  */
@@ -2706,10 +2744,6 @@ declare namespace Cypress {
2706
2744
  * Available browsers found on your system.
2707
2745
  */
2708
2746
  browsers: Browser[]
2709
- /**
2710
- * Path to folder containing component test files.
2711
- */
2712
- componentFolder: string
2713
2747
  /**
2714
2748
  * Hosts mappings to IP addresses.
2715
2749
  */
@@ -2729,22 +2763,6 @@ declare namespace Cypress {
2729
2763
  * The platform Cypress is running on.
2730
2764
  */
2731
2765
  platform: 'linux' | 'darwin' | 'win32'
2732
- /**
2733
- * A unique ID for the project used for recording
2734
- */
2735
- projectId: null | string
2736
- /**
2737
- * Path to the support folder.
2738
- */
2739
- supportFolder: string
2740
- /**
2741
- * Glob pattern to determine what test files to load.
2742
- */
2743
- testFiles: string
2744
- /**
2745
- * The user agent the browser sends in all request headers.
2746
- */
2747
- userAgent: null | string
2748
2766
  /**
2749
2767
  * The Cypress version being used.
2750
2768
  */
@@ -2756,8 +2774,7 @@ declare namespace Cypress {
2756
2774
  clientRoute: string
2757
2775
  configFile: string
2758
2776
  cypressEnv: string
2759
- integrationExampleName: string
2760
- integrationExamplePath: string
2777
+ devServerPublicPathRoute: string
2761
2778
  isNewProject: boolean
2762
2779
  isTextTerminal: boolean
2763
2780
  morgan: boolean
@@ -2786,12 +2803,14 @@ declare namespace Cypress {
2786
2803
 
2787
2804
  interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'baseUrl' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>> {
2788
2805
  browser?: IsBrowserMatcher | IsBrowserMatcher[]
2806
+ keystrokeDelay?: number
2789
2807
  }
2790
2808
 
2791
2809
  /**
2792
2810
  * All configuration items are optional.
2793
2811
  */
2794
- type ConfigOptions = Partial<ResolvedConfigOptions>
2812
+ type CoreConfigOptions = Partial<Omit<ResolvedConfigOptions, TestingType>>
2813
+ type ConfigOptions = CoreConfigOptions & {e2e?: CoreConfigOptions, component?: CoreConfigOptions }
2795
2814
 
2796
2815
  interface PluginConfigOptions extends ResolvedConfigOptions {
2797
2816
  /**
@@ -2836,6 +2855,18 @@ declare namespace Cypress {
2836
2855
  env: object
2837
2856
  }
2838
2857
 
2858
+ /**
2859
+ * Options for Cypress.Keyboard.defaults()
2860
+ */
2861
+ interface KeyboardDefaultsOptions {
2862
+ /**
2863
+ * Time, in milliseconds, between each keystroke when typing. (Pass 0 to disable)
2864
+ *
2865
+ * @default 10
2866
+ */
2867
+ keystrokeDelay: number
2868
+ }
2869
+
2839
2870
  /**
2840
2871
  * Full set of possible options for cy.request call
2841
2872
  */
@@ -79,7 +79,7 @@ export namespace CyHttpMessages {
79
79
  /**
80
80
  * The headers of the HTTP message.
81
81
  */
82
- headers: { [key: string]: string }
82
+ headers: { [key: string]: string | string[] }
83
83
  }
84
84
 
85
85
  export type IncomingResponse = BaseMessage & {
@@ -131,6 +131,10 @@ export namespace CyHttpMessages {
131
131
  * Request URL.
132
132
  */
133
133
  url: string
134
+ /**
135
+ * URL query string as object.
136
+ */
137
+ query: Record<string, string|number>
134
138
  /**
135
139
  * The HTTP version used in the request. Read only.
136
140
  */
@@ -383,7 +387,7 @@ export type RouteHandler = string | StaticResponse | RouteHandlerController | ob
383
387
  /**
384
388
  * Describes a response that will be sent back to the browser to fulfill the request.
385
389
  */
386
- export type StaticResponse = GenericStaticResponse<string, string | object | boolean | null> & {
390
+ export type StaticResponse = GenericStaticResponse<string, string | object | boolean | ArrayBuffer | null> & {
387
391
  /**
388
392
  * Milliseconds to delay before the response is sent.
389
393
  * @deprecated Use `delay` instead of `delayMs`.