cypress 10.3.0 → 10.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/angular/CHANGELOG.md +55 -0
  2. package/angular/README.md +154 -0
  3. package/angular/dist/index.d.ts +1 -0
  4. package/angular/dist/index.js +263 -0
  5. package/angular/dist/mount.d.ts +111 -0
  6. package/angular/package.json +70 -0
  7. package/lib/exec/open.js +7 -2
  8. package/lib/exec/spawn.js +7 -2
  9. package/mount-utils/CHANGELOG.md +7 -1
  10. package/mount-utils/README.md +7 -0
  11. package/mount-utils/dist/index.js +8 -1
  12. package/mount-utils/package.json +1 -0
  13. package/package.json +26 -10
  14. package/react/CHANGELOG.md +13 -19
  15. package/react/README.md +28 -323
  16. package/react/dist/createMount.d.ts +28 -0
  17. package/react/dist/cypress-react.cjs.js +643 -99
  18. package/react/dist/cypress-react.esm-bundler.js +640 -100
  19. package/react/dist/getDisplayName.d.ts +1 -1
  20. package/react/dist/index.d.ts +2 -0
  21. package/react/dist/mount.d.ts +5 -141
  22. package/react/dist/types.d.ts +44 -0
  23. package/react/package.json +3 -5
  24. package/react18/CHANGELOG.md +6 -0
  25. package/react18/dist/cypress-react.cjs.js +633 -0
  26. package/react18/dist/cypress-react.esm-bundler.js +605 -0
  27. package/react18/dist/index.d.ts +5 -0
  28. package/react18/package.json +59 -0
  29. package/types/cypress.d.ts +24 -3
  30. package/types/index.d.ts +1 -1
  31. package/types/{net-stubbing.ts → net-stubbing.d.ts} +0 -0
  32. package/vue/CHANGELOG.md +16 -17
  33. package/vue/README.md +17 -607
  34. package/vue/dist/@vue/test-utils/baseWrapper.d.ts +63 -0
  35. package/vue/dist/@vue/test-utils/components/RouterLinkStub.d.ts +21 -0
  36. package/vue/dist/@vue/test-utils/config.d.ts +30 -0
  37. package/vue/dist/@vue/test-utils/constants/dom-events.d.ts +900 -0
  38. package/vue/dist/@vue/test-utils/createDomEvent.d.ts +9 -0
  39. package/vue/dist/@vue/test-utils/domWrapper.d.ts +18 -0
  40. package/vue/dist/@vue/test-utils/emit.d.ts +5 -0
  41. package/vue/dist/@vue/test-utils/errorWrapper.d.ts +1 -0
  42. package/vue/dist/@vue/test-utils/index.d.ts +11 -0
  43. package/vue/dist/@vue/test-utils/interfaces/wrapperLike.d.ts +56 -0
  44. package/vue/dist/@vue/test-utils/mount.d.ts +35 -0
  45. package/vue/dist/@vue/test-utils/stubs.d.ts +22 -0
  46. package/vue/dist/@vue/test-utils/types.d.ts +125 -0
  47. package/vue/dist/@vue/test-utils/utils/autoUnmount.d.ts +5 -0
  48. package/vue/dist/@vue/test-utils/utils/compileSlots.d.ts +2 -0
  49. package/vue/dist/@vue/test-utils/utils/componentName.d.ts +4 -0
  50. package/vue/dist/@vue/test-utils/utils/find.d.ts +10 -0
  51. package/vue/dist/@vue/test-utils/utils/flushPromises.d.ts +1 -0
  52. package/vue/dist/@vue/test-utils/utils/getRootNodes.d.ts +2 -0
  53. package/vue/dist/@vue/test-utils/utils/isElement.d.ts +1 -0
  54. package/vue/dist/@vue/test-utils/utils/isElementVisible.d.ts +6 -0
  55. package/vue/dist/@vue/test-utils/utils/matchName.d.ts +1 -0
  56. package/vue/dist/@vue/test-utils/utils/stringifyNode.d.ts +1 -0
  57. package/vue/dist/@vue/test-utils/utils/vueCompatSupport.d.ts +8 -0
  58. package/vue/dist/@vue/test-utils/utils/vueShared.d.ts +3 -0
  59. package/vue/dist/@vue/test-utils/utils.d.ts +13 -0
  60. package/vue/dist/@vue/test-utils/vueWrapper.d.ts +35 -0
  61. package/vue/dist/@vue/test-utils/wrapperFactory.d.ts +14 -0
  62. package/vue/dist/cypress-vue.cjs.js +5585 -5211
  63. package/vue/dist/cypress-vue.esm-bundler.js +5586 -5213
  64. package/vue/dist/index.d.ts +35 -3
  65. package/vue/package.json +11 -8
  66. package/vue2/CHANGELOG.md +7 -0
  67. package/vue2/README.md +11 -627
  68. package/vue2/dist/cypress-vue2.browser.js +267 -261
  69. package/vue2/dist/cypress-vue2.cjs.js +266 -260
  70. package/vue2/dist/cypress-vue2.esm-bundler.js +264 -258
  71. package/vue2/package.json +1 -1
  72. package/react/dist/cypress-react.browser.js +0 -497
package/lib/exec/open.js CHANGED
@@ -28,6 +28,12 @@ const {
28
28
 
29
29
 
30
30
  const processOpenOptions = (options = {}) => {
31
+ // In addition to setting the project directory, setting the project option
32
+ // here ultimately decides whether cypress is run in global mode or not.
33
+ // It's first based off whether it's installed globally by npm/yarn (-g).
34
+ // A global install can be overridden by the --project flag, putting Cypress
35
+ // in project mode. A non-global install can be overridden by the --global
36
+ // flag, putting it in global mode.
31
37
  if (!util.isInstalledGlobally() && !options.global && !options.project) {
32
38
  options.project = process.cwd();
33
39
  }
@@ -86,8 +92,7 @@ module.exports = {
86
92
  const args = processOpenOptions(options);
87
93
  return spawn.start(args, {
88
94
  dev: options.dev,
89
- detached: Boolean(options.detached),
90
- stdio: 'inherit'
95
+ detached: Boolean(options.detached)
91
96
  });
92
97
  } catch (err) {
93
98
  if (err.details) {
package/lib/exec/spawn.js CHANGED
@@ -43,8 +43,13 @@ const isDbusWarning = /Failed to connect to the bus:/; // Electron began logging
43
43
  // ----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=www.googletagmanager.com) -----
44
44
  // ERROR: No matching issuer found
45
45
 
46
- const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- Certificate i=0 \(OU=Cypress Proxy|^ERROR: No matching issuer found$)/;
47
- const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin];
46
+ const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- Certificate i=0 \(OU=Cypress Proxy|^ERROR: No matching issuer found$)/; // Electron logs a benign warning about WebSwapCGLLayer on MacOS v12 and Electron v18 due to a naming collision in shared libraries.
47
+ // Once this is fixed upstream this regex can be removed: https://github.com/electron/electron/issues/33685
48
+ // Sample:
49
+ // objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined.
50
+
51
+ const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./;
52
+ const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning];
48
53
 
49
54
  const isGarbageLineWarning = str => {
50
55
  return _.some(GARBAGE_WARNINGS, re => {
@@ -1,3 +1,10 @@
1
+ # [@cypress/mount-utils-v2.0.1](https://github.com/cypress-io/cypress/compare/@cypress/mount-utils-v2.0.0...@cypress/mount-utils-v2.0.1) (2022-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove CT side effects from mount when e2e testing ([#22633](https://github.com/cypress-io/cypress/issues/22633)) ([a9476ec](https://github.com/cypress-io/cypress/commit/a9476ecb3d43f628b689e060294a1952937cb1a7))
7
+
1
8
  # [@cypress/mount-utils-v2.0.0](https://github.com/cypress-io/cypress/compare/@cypress/mount-utils-v1.0.2...@cypress/mount-utils-v2.0.0) (2022-06-13)
2
9
 
3
10
 
@@ -9,7 +16,6 @@
9
16
  ### Features
10
17
 
11
18
  * embedding mount into the cypress binary (real dependency) ([#20930](https://github.com/cypress-io/cypress/issues/20930)) ([3fe5f50](https://github.com/cypress-io/cypress/commit/3fe5f50e7832a4bfb20df8e71648434eb7f263d5))
12
- * merging / delegating remote queries to cloud schema ([#17875](https://github.com/cypress-io/cypress/issues/17875)) ([94541d4](https://github.com/cypress-io/cypress/commit/94541d4f18591e8fa4b8702c39e92b0a7238aa5d))
13
19
  * swap the #__cy_root id selector to become data-cy-root for component mounting ([#20951](https://github.com/cypress-io/cypress/issues/20951)) ([0e7b555](https://github.com/cypress-io/cypress/commit/0e7b555f93fb403f431c5de4a07ae7ad6ac89ba2))
14
20
 
15
21
 
@@ -9,6 +9,13 @@ It is used in:
9
9
  - [`@cypress/react`](https://github.com/cypress-io/cypress/tree/develop/npm/react)
10
10
  - [`@cypress/vue`](https://github.com/cypress-io/cypress/tree/develop/npm/vue)
11
11
 
12
+ ## Compatibility
13
+
14
+ | @cypress/mount-utils | cypress |
15
+ | -------------------- | ------- |
16
+ | <= v1 | <= v9 |
17
+ | >= v2 | >= v10 |
18
+
12
19
  ## Changelog
13
20
 
14
21
  [Changelog](./CHANGELOG.md)
@@ -4,7 +4,7 @@ export const getContainerEl = () => {
4
4
  if (el) {
5
5
  return el;
6
6
  }
7
- throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please use the mount utils to mount it properly`);
7
+ throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
8
8
  };
9
9
  /**
10
10
  * Remove any style or extra link elements from the iframe placeholder
@@ -120,6 +120,13 @@ export const injectStylesBeforeElement = (options, document, el) => {
120
120
  return insertLocalCssFiles(cssFiles, document, el, options.log);
121
121
  };
122
122
  export function setupHooks(optionalCallback) {
123
+ // Consumed by the framework "mount" libs. A user might register their own mount in the scaffolded 'commands.js'
124
+ // file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
125
+ // testing so we early return.
126
+ // System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
127
+ if (Cypress.testingType !== 'component') {
128
+ return;
129
+ }
123
130
  // When running component specs, we cannot allow "cy.visit"
124
131
  // because it will wipe out our preparation work, and does not make much sense
125
132
  // thus we overwrite "cy.visit" to throw an error
@@ -17,6 +17,7 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
+ "types": "dist/index.d.ts",
20
21
  "license": "MIT",
21
22
  "repository": {
22
23
  "type": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node index.js --exec install",
@@ -56,11 +56,12 @@
56
56
  "index.js",
57
57
  "index.mjs",
58
58
  "types/**/*.d.ts",
59
- "types/net-stubbing.ts",
60
59
  "mount-utils",
61
60
  "vue",
62
61
  "react",
63
- "vue2"
62
+ "vue2",
63
+ "react18",
64
+ "angular"
64
65
  ],
65
66
  "bin": {
66
67
  "cypress": "bin/cypress"
@@ -72,15 +73,18 @@
72
73
  "exports": {
73
74
  ".": {
74
75
  "import": "./index.mjs",
75
- "require": "./index.js"
76
+ "require": "./index.js",
77
+ "types": "./types/index.d.ts"
76
78
  },
77
79
  "./vue": {
78
80
  "import": "./vue/dist/cypress-vue.esm-bundler.js",
79
- "require": "./vue/dist/cypress-vue.cjs.js"
81
+ "require": "./vue/dist/cypress-vue.cjs.js",
82
+ "types": "./vue/dist/index.d.ts"
80
83
  },
81
84
  "./vue2": {
82
85
  "import": "./vue2/dist/cypress-vue2.esm-bundler.js",
83
- "require": "./vue2/dist/cypress-vue2.cjs.js"
86
+ "require": "./vue2/dist/cypress-vue2.cjs.js",
87
+ "types": "./vue2/dist/index.d.ts"
84
88
  },
85
89
  "./package.json": {
86
90
  "import": "./package.json",
@@ -88,16 +92,28 @@
88
92
  },
89
93
  "./react": {
90
94
  "import": "./react/dist/cypress-react.esm-bundler.js",
91
- "require": "./react/dist/cypress-react.cjs.js"
95
+ "require": "./react/dist/cypress-react.cjs.js",
96
+ "types": "./react/dist/index.d.ts"
97
+ },
98
+ "./react18": {
99
+ "import": "./react18/dist/cypress-react.esm-bundler.js",
100
+ "require": "./react18/dist/cypress-react.cjs.js",
101
+ "types": "./react18/dist/index.d.ts"
92
102
  },
93
103
  "./mount-utils": {
94
- "require": "./mount-utils/dist/index.js"
104
+ "require": "./mount-utils/dist/index.js",
105
+ "types": "./mount-utils/dist/index.d.ts"
106
+ },
107
+ "./angular": {
108
+ "import": "./angular/dist/index.js",
109
+ "require": "./angular/dist/index.js",
110
+ "types": "./angular/dist/index.d.ts"
95
111
  }
96
112
  },
97
113
  "buildInfo": {
98
114
  "commitBranch": "develop",
99
- "commitSha": "f902b968970f1b6160f07215b881dab6c39c21f1",
100
- "commitDate": "2022-06-28T16:27:27.000Z",
115
+ "commitSha": "17f430768ba3f3de2f167359d7fec2dde77ca562",
116
+ "commitDate": "2022-08-15T16:29:07.000Z",
101
117
  "stable": true
102
118
  },
103
119
  "description": "Cypress.io end to end testing tool",
@@ -1,17 +1,22 @@
1
+ # [@cypress/react-v6.1.0](https://github.com/cypress-io/cypress/compare/@cypress/react-v6.0.0...@cypress/react-v6.1.0) (2022-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove CT side effects from mount when e2e testing ([#22633](https://github.com/cypress-io/cypress/issues/22633)) ([a9476ec](https://github.com/cypress-io/cypress/commit/a9476ecb3d43f628b689e060294a1952937cb1a7))
7
+
8
+
9
+ ### Features
10
+
11
+ * React 18 support ([#22876](https://github.com/cypress-io/cypress/issues/22876)) ([f0d3a48](https://github.com/cypress-io/cypress/commit/f0d3a4867907bf6e60468510daa883ccc8dcfb63))
12
+ * update to Vite 3 ([#22915](https://github.com/cypress-io/cypress/issues/22915)) ([6adba46](https://github.com/cypress-io/cypress/commit/6adba462ea6b76dbb96f99aa3837492ca1f17ed3))
13
+
1
14
  # [@cypress/react-v6.0.0](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.12.5...@cypress/react-v6.0.0) (2022-06-13)
2
15
 
3
16
 
4
17
  ### Bug Fixes
5
18
 
6
- * open browser at correct time during lifecycle ([#19572](https://github.com/cypress-io/cypress/issues/19572)) ([bfc032a](https://github.com/cypress-io/cypress/commit/bfc032a2d42d0726b8a4a86aab1584bd4e69c3f0))
7
- * scaffold correct config file ([#19776](https://github.com/cypress-io/cypress/issues/19776)) ([8f32960](https://github.com/cypress-io/cypress/commit/8f32960ef803f539f065d41f01fff33bfe33ed5d))
8
- * scope config to current testing type ([#20677](https://github.com/cypress-io/cypress/issues/20677)) ([61f7cfc](https://github.com/cypress-io/cypress/commit/61f7cfc59284a2938e0a1c15d74ee75215ba5f8b))
9
- * terminal error message for non migrated config ([#21467](https://github.com/cypress-io/cypress/issues/21467)) ([3274da7](https://github.com/cypress-io/cypress/commit/3274da7842f5ef1ddad62b1c630d0ff9120e4289))
10
- * update scaffold template to use correct path ([#20047](https://github.com/cypress-io/cypress/issues/20047)) ([6e80359](https://github.com/cypress-io/cypress/commit/6e803597a379222cf936e5977c8314d693ee1912))
11
- * wire up scaffolded indexHtml to dev servers ([#20453](https://github.com/cypress-io/cypress/issues/20453)) ([3a8797e](https://github.com/cypress-io/cypress/commit/3a8797e54db9fd0ef93a14ddc71c138ba8251e53))
12
19
  * **react:** link to rerender example ([#19020](https://github.com/cypress-io/cypress/issues/19020)) ([552d3a1](https://github.com/cypress-io/cypress/commit/552d3a1c0073dae0bd1da0fc9fa8d140ec4f38dc))
13
- * **unified-desktop-gui branch:** initial installation on windows ([#18247](https://github.com/cypress-io/cypress/issues/18247)) ([8614e97](https://github.com/cypress-io/cypress/commit/8614e978029bcbf7155b7ae98ac54feb11f2e7f3))
14
- * **unify:** improve dev server config ergonomics ([#19957](https://github.com/cypress-io/cypress/issues/19957)) ([6a402a7](https://github.com/cypress-io/cypress/commit/6a402a70767f53e4c5ea54490a03a9983b2be10f))
15
20
 
16
21
 
17
22
  ### chore
@@ -21,21 +26,10 @@
21
26
 
22
27
  ### Features
23
28
 
24
- * add devServer to config file ([#18962](https://github.com/cypress-io/cypress/issues/18962)) ([2573375](https://github.com/cypress-io/cypress/commit/2573375b5b6616efd2d213a94cd55fd8e0385864))
25
- * Add typings for new devServer config ([#18797](https://github.com/cypress-io/cypress/issues/18797)) ([e018a14](https://github.com/cypress-io/cypress/commit/e018a14c211bfcbdc4568a9a737f14f5c1686e35))
26
- * Deprecate run-ct / open-ct, and update all examples to use --ct instead ([#18422](https://github.com/cypress-io/cypress/issues/18422)) ([196e8f6](https://github.com/cypress-io/cypress/commit/196e8f62cc6d27974f235945cb5700624b3dae41))
27
29
  * embedding mount into the cypress binary (real dependency) ([#20930](https://github.com/cypress-io/cypress/issues/20930)) ([3fe5f50](https://github.com/cypress-io/cypress/commit/3fe5f50e7832a4bfb20df8e71648434eb7f263d5))
28
- * index.html configurability and storybook support ([#18242](https://github.com/cypress-io/cypress/issues/18242)) ([745b3ac](https://github.com/cypress-io/cypress/commit/745b3ac4518302983522daedf817623334feae5b))
29
- * ProjectLifecycleManager & general launchpad cleanup ([#19347](https://github.com/cypress-io/cypress/issues/19347)) ([4626f74](https://github.com/cypress-io/cypress/commit/4626f7481c9904fec484aa167a02e0197a3095c4))
30
30
  * remove testFiles reference ([#20565](https://github.com/cypress-io/cypress/issues/20565)) ([5670344](https://github.com/cypress-io/cypress/commit/567034459089d9d53dfab5556cb9369fb335c3db))
31
- * support specPattern, deprecate integrationFolder and componentFolder ([#19319](https://github.com/cypress-io/cypress/issues/19319)) ([792980a](https://github.com/cypress-io/cypress/commit/792980ac12746ef47b9c944ebe4c6c353a187ab2))
32
31
  * swap the #__cy_root id selector to become data-cy-root for component mounting ([#20951](https://github.com/cypress-io/cypress/issues/20951)) ([0e7b555](https://github.com/cypress-io/cypress/commit/0e7b555f93fb403f431c5de4a07ae7ad6ac89ba2))
33
32
  * update on-links ([#19235](https://github.com/cypress-io/cypress/issues/19235)) ([cc2d734](https://github.com/cypress-io/cypress/commit/cc2d7348185e2a090c60d92d9319ab460d8c7827))
34
- * Use .config files ([#18578](https://github.com/cypress-io/cypress/issues/18578)) ([081dd19](https://github.com/cypress-io/cypress/commit/081dd19cc6da3da229a7af9c84f62730c85a5cd6))
35
- * use devServer instad of startDevServer ([#20092](https://github.com/cypress-io/cypress/issues/20092)) ([8a6768f](https://github.com/cypress-io/cypress/commit/8a6768fee6f46b908c5a9daf23da8b804a6c627f))
36
- * Use plugins on config files ([#18798](https://github.com/cypress-io/cypress/issues/18798)) ([bb8251b](https://github.com/cypress-io/cypress/commit/bb8251b752ac44f1184f9160194cf12d41fc867f))
37
- * use supportFile by testingType ([#19364](https://github.com/cypress-io/cypress/issues/19364)) ([0366d4f](https://github.com/cypress-io/cypress/commit/0366d4fa8971e5e5189c6fd6450cc3c8d72dcfe1))
38
- * validate specPattern root level ([#19980](https://github.com/cypress-io/cypress/issues/19980)) ([5d52758](https://github.com/cypress-io/cypress/commit/5d52758d82c47033803c69c7858fc786a900faaf))
39
33
 
40
34
 
41
35
  ### BREAKING CHANGES