cypress 16.2.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/dist/index.js +10 -12
- package/angular/package.json +7 -22
- package/dist/bin/cypress +8 -8
- package/dist/{cli-AgTnS5LO.js → cli-y9Bb9Y77.js} +215 -40
- package/dist/cli.js +6 -6
- package/dist/{cypress-CdDm9AVa.js → cypress-CvEs5adm.js} +2 -2
- package/dist/cypress.js +8 -8
- package/dist/exec/spawn.js +4 -4
- package/dist/exec/xvfb.js +7 -4
- package/dist/index.js +8 -8
- package/dist/{spawn-DElwyZHC.js → spawn-Bx99tBTm.js} +529 -69
- package/dist/{tap-WHD3nHJC.js → tap-BMFGLoCT.js} +108 -26
- package/dist/{xvfb-CbW2_YXR.js → xvfb-DxbcANVl.js} +238 -25
- package/mount-utils/dist/index.js +1 -1
- package/mount-utils/package.json +15 -14
- package/package.json +5 -5
- package/react/dist/cypress-react.cjs.js +9 -7
- package/react/dist/cypress-react.esm-bundler.js +9 -7
- package/react/package.json +26 -46
- package/svelte/dist/cypress-svelte.cjs.js +3 -2
- package/svelte/dist/cypress-svelte.esm-bundler.js +3 -2
- package/svelte/package.json +24 -22
- package/types/cy-bluebird.d.ts +1 -0
- package/types/cy-chai.d.ts +99 -2
- package/types/cypress.d.ts +216 -43
- package/types/net-stubbing.d.ts +1 -1
- package/vue/dist/cypress-vue.cjs.js +4 -2
- package/vue/dist/cypress-vue.esm-bundler.js +4 -2
- package/vue/dist/index.d.ts +3 -3
- package/vue/package.json +35 -42
- package/angular/angular/README.md +0 -18
- package/angular/angular/dist/index.d.ts +0 -120
- package/angular/angular/dist/index.js +0 -479
- package/angular/angular/package.json +0 -82
- package/mount-utils/mount-utils/README.md +0 -140
- package/mount-utils/mount-utils/dist/index.d.ts +0 -12
- package/mount-utils/mount-utils/dist/index.js +0 -41
- package/mount-utils/mount-utils/package.json +0 -52
- package/react/react/README.md +0 -19
- package/react/react/dist/cypress-react.cjs.js +0 -293
- package/react/react/dist/cypress-react.esm-bundler.js +0 -268
- package/react/react/dist/index.d.ts +0 -95
- package/react/react/package.json +0 -113
- package/svelte/svelte/README.md +0 -19
- package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -122
- package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -120
- package/svelte/svelte/dist/index.d.ts +0 -31
- package/svelte/svelte/package.json +0 -63
- package/vue/vue/README.md +0 -14
- package/vue/vue/dist/cypress-vue.cjs.js +0 -8692
- package/vue/vue/dist/cypress-vue.esm-bundler.js +0 -8671
- package/vue/vue/dist/index.d.ts +0 -1413
- package/vue/vue/package.json +0 -97
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @cypress/svelte v0.0.0-development
|
|
4
|
-
* (c) 2026 Cypress.io
|
|
5
|
-
* Released under the MIT License
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { mount as mount$1, unmount } from 'svelte';
|
|
9
|
-
|
|
10
|
-
const ROOT_SELECTOR = '[data-cy-root]';
|
|
11
|
-
/**
|
|
12
|
-
* Gets the root element used to mount the component.
|
|
13
|
-
* @returns {HTMLElement} The root element
|
|
14
|
-
* @throws {Error} If the root element is not found
|
|
15
|
-
*/
|
|
16
|
-
const getContainerEl = () => {
|
|
17
|
-
const el = document.querySelector(ROOT_SELECTOR);
|
|
18
|
-
if (el) {
|
|
19
|
-
return el;
|
|
20
|
-
}
|
|
21
|
-
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.`);
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
|
|
25
|
-
* @param optionalCallback Callback to be called before the next test runs
|
|
26
|
-
*/
|
|
27
|
-
function setupHooks(optionalCallback) {
|
|
28
|
-
// We don't want CT side effects to run when e2e
|
|
29
|
-
// testing so we early return.
|
|
30
|
-
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
|
31
|
-
if (Cypress.testingType !== 'component') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
// When running component specs, we cannot allow "cy.visit"
|
|
35
|
-
// because it will wipe out our preparation work, and does not make much sense
|
|
36
|
-
// thus we overwrite "cy.visit" to throw an error
|
|
37
|
-
Cypress.Commands.overwrite('visit', () => {
|
|
38
|
-
throw new Error('cy.visit from a component spec is not allowed');
|
|
39
|
-
});
|
|
40
|
-
Cypress.Commands.overwrite('session', () => {
|
|
41
|
-
throw new Error('cy.session from a component spec is not allowed');
|
|
42
|
-
});
|
|
43
|
-
Cypress.Commands.overwrite('origin', () => {
|
|
44
|
-
throw new Error('cy.origin from a component spec is not allowed');
|
|
45
|
-
});
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
Cypress.on('test:before:after:run:async', () => {
|
|
48
|
-
optionalCallback?.();
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const DEFAULT_COMP_NAME = 'unknown';
|
|
53
|
-
let componentInstance;
|
|
54
|
-
const cleanup = () => {
|
|
55
|
-
if (componentInstance) {
|
|
56
|
-
unmount(componentInstance);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
// Extract the component name from the object passed to mount
|
|
60
|
-
const getComponentDisplayName = (Component) => {
|
|
61
|
-
if (Component.name) {
|
|
62
|
-
const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
|
|
63
|
-
return match || Component.name;
|
|
64
|
-
}
|
|
65
|
-
return DEFAULT_COMP_NAME;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Mounts a Svelte component inside the Cypress browser
|
|
69
|
-
*
|
|
70
|
-
* @param {Record<string, any>} Component Svelte component being mounted
|
|
71
|
-
* @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
|
|
72
|
-
* @returns Cypress.Chainable<MountReturn>
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* import Counter from './Counter.svelte'
|
|
76
|
-
* import { mount } from 'cypress/svelte'
|
|
77
|
-
*
|
|
78
|
-
* it('should render', () => {
|
|
79
|
-
* mount(Counter, { props: { count: 42 } })
|
|
80
|
-
* cy.get('button').contains(42)
|
|
81
|
-
* })
|
|
82
|
-
*
|
|
83
|
-
* @see {@link https://on.cypress.io/mounting-svelte} for more details.
|
|
84
|
-
*/
|
|
85
|
-
function mount(Component, options = {}) {
|
|
86
|
-
// In Svelte 5, the component name is no longer easily discoverable and logs as "wrapper"
|
|
87
|
-
// so we default the logging of it to false as it doesn't provide a lot of value
|
|
88
|
-
options.log = options.log || false;
|
|
89
|
-
return cy.then(() => {
|
|
90
|
-
// Remove last mounted component if cy.mount is called more than once in a test
|
|
91
|
-
cleanup();
|
|
92
|
-
const target = getContainerEl();
|
|
93
|
-
const ComponentConstructor = (Component.default || Component);
|
|
94
|
-
// @see https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes
|
|
95
|
-
componentInstance = mount$1(ComponentConstructor, Object.assign({ target }, options));
|
|
96
|
-
// by waiting, we are delaying test execution for the next tick of event loop
|
|
97
|
-
// and letting hooks and component lifecycle methods to execute mount
|
|
98
|
-
return cy.wait(0, { log: false }).then(() => {
|
|
99
|
-
if (options.log !== false) {
|
|
100
|
-
const mountMessage = `<${getComponentDisplayName(Component)} ... />`;
|
|
101
|
-
Cypress.log({
|
|
102
|
-
name: 'mount',
|
|
103
|
-
message: [mountMessage],
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
.wrap({ component: componentInstance }, { log: false });
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
// Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
|
|
111
|
-
// by creating an explicit function/import that the user can register in their 'component.js' support file,
|
|
112
|
-
// such as:
|
|
113
|
-
// import 'cypress/<my-framework>/support'
|
|
114
|
-
// or
|
|
115
|
-
// import { registerCT } from 'cypress/<my-framework>'
|
|
116
|
-
// registerCT()
|
|
117
|
-
// Note: This would be a breaking change
|
|
118
|
-
setupHooks(cleanup);
|
|
119
|
-
|
|
120
|
-
export { mount };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
import { Component, MountOptions } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface MountReturn {
|
|
6
|
-
component: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Mounts a Svelte component inside the Cypress browser
|
|
10
|
-
*
|
|
11
|
-
* @param {Record<string, any>} Component Svelte component being mounted
|
|
12
|
-
* @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
|
|
13
|
-
* @returns Cypress.Chainable<MountReturn>
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* import Counter from './Counter.svelte'
|
|
17
|
-
* import { mount } from 'cypress/svelte'
|
|
18
|
-
*
|
|
19
|
-
* it('should render', () => {
|
|
20
|
-
* mount(Counter, { props: { count: 42 } })
|
|
21
|
-
* cy.get('button').contains(42)
|
|
22
|
-
* })
|
|
23
|
-
*
|
|
24
|
-
* @see {@link https://on.cypress.io/mounting-svelte} for more details.
|
|
25
|
-
*/
|
|
26
|
-
declare function mount(Component: Component<Record<string, any>, Record<string, any>, any>, options?: Omit<MountOptions, 'target'> & {
|
|
27
|
-
log?: boolean;
|
|
28
|
-
}): Cypress.Chainable<MountReturn>;
|
|
29
|
-
|
|
30
|
-
export { mount };
|
|
31
|
-
export type { MountReturn };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@cypress/svelte",
|
|
3
|
-
"version": "0.0.0-development",
|
|
4
|
-
"description": "Browser-based Component Testing for Svelte.js with Cypress.io 🧡",
|
|
5
|
-
"main": "dist/cypress-svelte.cjs.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prebuild": "rimraf dist",
|
|
8
|
-
"build": "rollup -c rollup.config.mjs",
|
|
9
|
-
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
|
10
|
-
"check-ts": "tsc --noEmit",
|
|
11
|
-
"lint": "eslint"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@packages/eslint-config": "0.0.0-development",
|
|
15
|
-
"@cypress/mount-utils": "0.0.0-development",
|
|
16
|
-
"eslint": "^9.31.0",
|
|
17
|
-
"jiti": "^2.4.2",
|
|
18
|
-
"rollup": "^4.60.2",
|
|
19
|
-
"svelte": "^5.4.0",
|
|
20
|
-
"typescript": "~5.4.5"
|
|
21
|
-
},
|
|
22
|
-
"peerDependencies": {
|
|
23
|
-
"cypress": ">=10.6.0",
|
|
24
|
-
"svelte": ">=5.0.0"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"dist/**/*"
|
|
28
|
-
],
|
|
29
|
-
"types": "dist/index.d.ts",
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "https://github.com/cypress-io/cypress.git"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/svelte/#readme",
|
|
36
|
-
"bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fsvelte&template=1-bug-report.md&title=",
|
|
37
|
-
"keywords": [
|
|
38
|
-
"cypress",
|
|
39
|
-
"svelte",
|
|
40
|
-
"testing",
|
|
41
|
-
"component testing"
|
|
42
|
-
],
|
|
43
|
-
"module": "dist/cypress-svelte.esm-bundler.js",
|
|
44
|
-
"publishConfig": {
|
|
45
|
-
"access": "public"
|
|
46
|
-
},
|
|
47
|
-
"nx": {
|
|
48
|
-
"targets": {
|
|
49
|
-
"build": {
|
|
50
|
-
"outputs": [
|
|
51
|
-
"{workspaceRoot}/cli/svelte",
|
|
52
|
-
"{projectRoot}/dist"
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"implicitDependencies": [
|
|
57
|
-
"!cypress"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"lint-staged": {
|
|
61
|
-
"**/*.{js,jsx,ts,tsx}": "eslint --fix"
|
|
62
|
-
}
|
|
63
|
-
}
|
package/vue/vue/README.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# @cypress/vue
|
|
2
|
-
|
|
3
|
-
Mount Vue 3 components in the open source [Cypress.io](https://www.cypress.io/) test runner
|
|
4
|
-
|
|
5
|
-
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Vue Component Testing Docs](https://docs.cypress.io/guides/component-testing/vue/overview) for mounting Vue components. Installing and importing `mount` from `@cypress/vue` should only be done for advanced use-cases.
|
|
6
|
-
## Development
|
|
7
|
-
|
|
8
|
-
Run `yarn build` to compile and sync packages to the `cypress` cli package.
|
|
9
|
-
|
|
10
|
-
Run `yarn cy:open` to open Cypress component testing against real-world examples.
|
|
11
|
-
|
|
12
|
-
Run `yarn test` to execute headless Cypress tests.
|
|
13
|
-
|
|
14
|
-
## [Changelog](./CHANGELOG.md)
|