cypress 9.7.0 → 10.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/index.mjs +15 -0
- package/lib/cli.js +72 -23
- package/lib/errors.js +16 -1
- package/lib/exec/open.js +45 -10
- package/lib/exec/run.js +17 -10
- package/lib/exec/shared.js +30 -9
- package/lib/exec/spawn.js +4 -0
- package/lib/exec/xvfb.js +1 -0
- package/lib/util.js +10 -3
- package/mount-utils/CHANGELOG.md +20 -0
- package/mount-utils/README.md +14 -0
- package/mount-utils/dist/index.d.ts +54 -0
- package/mount-utils/dist/index.js +134 -0
- package/mount-utils/package.json +31 -0
- package/package.json +39 -4
- package/react/CHANGELOG.md +373 -0
- package/react/README.md +414 -0
- package/react/dist/cypress-react.browser.js +497 -0
- package/react/dist/cypress-react.cjs.js +495 -0
- package/react/dist/cypress-react.esm-bundler.js +467 -0
- package/react/dist/getDisplayName.d.ts +8 -0
- package/react/dist/index.d.ts +2 -0
- package/react/dist/mount.d.ts +143 -0
- package/react/dist/mountHook.d.ts +11 -0
- package/react/package.json +105 -0
- package/types/bluebird/index.d.ts +18 -4
- package/types/cypress-npm-api.d.ts +4 -10
- package/types/cypress.d.ts +172 -120
- package/types/minimatch/index.d.ts +15 -5
- package/vue/CHANGELOG.md +380 -0
- package/vue/README.md +678 -0
- package/vue/dist/cypress-vue.cjs.js +13535 -0
- package/vue/dist/cypress-vue.esm-bundler.js +13511 -0
- package/vue/dist/index.d.ts +56 -0
- package/vue/package.json +86 -0
- package/vue2/CHANGELOG.md +5 -0
- package/vue2/README.md +693 -0
- package/vue2/dist/cypress-vue2.browser.js +20191 -0
- package/vue2/dist/cypress-vue2.cjs.js +20188 -0
- package/vue2/dist/cypress-vue2.esm-bundler.js +20179 -0
- package/vue2/dist/index.d.ts +171 -0
- package/vue2/package.json +59 -0
@@ -0,0 +1,171 @@
|
|
1
|
+
/// <reference types="cypress" />
|
2
|
+
import Vue from 'vue';
|
3
|
+
import { VueTestUtilsConfigOptions, Wrapper } from '@vue/test-utils';
|
4
|
+
import { StyleOptions } from '@cypress/mount-utils';
|
5
|
+
/**
|
6
|
+
* Type for component passed to "mount"
|
7
|
+
*
|
8
|
+
* @interface VueComponent
|
9
|
+
* @example
|
10
|
+
* import Hello from './Hello.vue'
|
11
|
+
* ^^^^^ this type
|
12
|
+
* mount(Hello)
|
13
|
+
*/
|
14
|
+
declare type VueComponent = Vue.ComponentOptions<any> | Vue.VueConstructor;
|
15
|
+
/**
|
16
|
+
* Options to pass to the component when creating it, like
|
17
|
+
* props.
|
18
|
+
*
|
19
|
+
* @interface ComponentOptions
|
20
|
+
*/
|
21
|
+
declare type ComponentOptions = Record<string, unknown>;
|
22
|
+
declare type VueLocalComponents = Record<string, VueComponent>;
|
23
|
+
declare type VueFilters = {
|
24
|
+
[key: string]: (value: string) => string;
|
25
|
+
};
|
26
|
+
declare type VueMixin = unknown;
|
27
|
+
declare type VueMixins = VueMixin | VueMixin[];
|
28
|
+
declare type VuePluginOptions = unknown;
|
29
|
+
declare type VuePlugin = unknown | [unknown, VuePluginOptions];
|
30
|
+
/**
|
31
|
+
* A single Vue plugin or a list of plugins to register
|
32
|
+
*/
|
33
|
+
declare type VuePlugins = VuePlugin[];
|
34
|
+
/**
|
35
|
+
* Additional Vue services to register while mounting the component, like
|
36
|
+
* local components, plugins, etc.
|
37
|
+
*
|
38
|
+
* @interface MountOptionsExtensions
|
39
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
40
|
+
*/
|
41
|
+
interface MountOptionsExtensions {
|
42
|
+
/**
|
43
|
+
* Extra local components
|
44
|
+
*
|
45
|
+
* @memberof MountOptionsExtensions
|
46
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
47
|
+
* @example
|
48
|
+
* import Hello from './Hello.vue'
|
49
|
+
* // imagine Hello needs AppComponent
|
50
|
+
* // that it uses in its template like <app-component ... />
|
51
|
+
* // during testing we can replace it with a mock component
|
52
|
+
* const appComponent = ...
|
53
|
+
* const components = {
|
54
|
+
* 'app-component': appComponent
|
55
|
+
* },
|
56
|
+
* mount(Hello, { extensions: { components }})
|
57
|
+
*/
|
58
|
+
components?: VueLocalComponents;
|
59
|
+
/**
|
60
|
+
* Optional Vue filters to install while mounting the component
|
61
|
+
*
|
62
|
+
* @memberof MountOptionsExtensions
|
63
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
64
|
+
* @example
|
65
|
+
* const filters = {
|
66
|
+
* reverse: (s) => s.split('').reverse().join(''),
|
67
|
+
* }
|
68
|
+
* mount(Hello, { extensions: { filters }})
|
69
|
+
*/
|
70
|
+
filters?: VueFilters;
|
71
|
+
/**
|
72
|
+
* Optional Vue mixin(s) to install when mounting the component
|
73
|
+
*
|
74
|
+
* @memberof MountOptionsExtensions
|
75
|
+
* @alias mixins
|
76
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
77
|
+
*/
|
78
|
+
mixin?: VueMixins;
|
79
|
+
/**
|
80
|
+
* Optional Vue mixin(s) to install when mounting the component
|
81
|
+
*
|
82
|
+
* @memberof MountOptionsExtensions
|
83
|
+
* @alias mixin
|
84
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
85
|
+
*/
|
86
|
+
mixins?: VueMixins;
|
87
|
+
/**
|
88
|
+
* A single plugin or multiple plugins.
|
89
|
+
*
|
90
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
91
|
+
* @alias plugins
|
92
|
+
* @memberof MountOptionsExtensions
|
93
|
+
*/
|
94
|
+
use?: VuePlugins;
|
95
|
+
/**
|
96
|
+
* A single plugin or multiple plugins.
|
97
|
+
*
|
98
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
99
|
+
* @alias use
|
100
|
+
* @memberof MountOptionsExtensions
|
101
|
+
*/
|
102
|
+
plugins?: VuePlugins;
|
103
|
+
}
|
104
|
+
/**
|
105
|
+
* Options controlling how the component is going to be mounted,
|
106
|
+
* including global Vue plugins and extensions.
|
107
|
+
*
|
108
|
+
* @interface MountOptions
|
109
|
+
*/
|
110
|
+
interface MountOptions {
|
111
|
+
/**
|
112
|
+
* Vue instance to use.
|
113
|
+
*
|
114
|
+
* @deprecated
|
115
|
+
* @memberof MountOptions
|
116
|
+
*/
|
117
|
+
vue: unknown;
|
118
|
+
/**
|
119
|
+
* Extra Vue plugins, mixins, local components to register while
|
120
|
+
* mounting this component
|
121
|
+
*
|
122
|
+
* @memberof MountOptions
|
123
|
+
* @see https://github.com/cypress-io/cypress/tree/master/npm/vue#examples
|
124
|
+
*/
|
125
|
+
extensions: MountOptionsExtensions;
|
126
|
+
}
|
127
|
+
/**
|
128
|
+
* Utility type for union of options passed to "mount(..., options)"
|
129
|
+
*/
|
130
|
+
declare type MountOptionsArgument = Partial<ComponentOptions & MountOptions & StyleOptions & VueTestUtilsConfigOptions>;
|
131
|
+
declare global {
|
132
|
+
namespace Cypress {
|
133
|
+
interface Cypress {
|
134
|
+
/**
|
135
|
+
* Mounted Vue instance is available under Cypress.vue
|
136
|
+
* @memberof Cypress
|
137
|
+
* @example
|
138
|
+
* mount(Greeting)
|
139
|
+
* .then(() => {
|
140
|
+
* Cypress.vue.message = 'Hello There'
|
141
|
+
* })
|
142
|
+
* // new message is displayed
|
143
|
+
* cy.contains('Hello There').should('be.visible')
|
144
|
+
*/
|
145
|
+
vue: Vue;
|
146
|
+
vueWrapper: Wrapper<Vue>;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Mounts a Vue component inside Cypress browser.
|
152
|
+
* @param {object} component imported from Vue file
|
153
|
+
* @example
|
154
|
+
* import Greeting from './Greeting.vue'
|
155
|
+
* import { mount } from '@cypress/vue2'
|
156
|
+
* it('works', () => {
|
157
|
+
* // pass props, additional extensions, etc
|
158
|
+
* mount(Greeting, { ... })
|
159
|
+
* // use any Cypress command to test the component
|
160
|
+
* cy.get('#greeting').should('be.visible')
|
161
|
+
* })
|
162
|
+
*/
|
163
|
+
export declare const mount: (component: VueComponent, optionsOrProps?: MountOptionsArgument) => Cypress.Chainable<Cypress.AUTWindow>;
|
164
|
+
/**
|
165
|
+
* Helper function for mounting a component quickly in test hooks.
|
166
|
+
* @example
|
167
|
+
* import {mountCallback} from '@cypress/vue2'
|
168
|
+
* beforeEach(mountVue(component, options))
|
169
|
+
*/
|
170
|
+
export declare const mountCallback: (component: VueComponent, options?: MountOptionsArgument) => () => Cypress.Chainable<Cypress.AUTWindow>;
|
171
|
+
export {};
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{
|
2
|
+
"name": "@cypress/vue2",
|
3
|
+
"version": "0.0.0-development",
|
4
|
+
"description": "Browser-based Component Testing for Vue.js@2 with Cypress.io ✌️🌲",
|
5
|
+
"private": true,
|
6
|
+
"main": "dist/cypress-vue2.cjs.js",
|
7
|
+
"scripts": {
|
8
|
+
"typecheck": "tsc --noEmit",
|
9
|
+
"build": "rimraf dist && yarn rollup -c rollup.config.js",
|
10
|
+
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
11
|
+
"build-prod": "yarn build",
|
12
|
+
"test": "echo \"Tests for @cypress/vue2 are run from system-tests\"",
|
13
|
+
"watch": "yarn build --watch --watch.exclude ./dist/**/*",
|
14
|
+
"test-ci": "node ../../scripts/run-ct-examples.js --examplesList=./examples.env"
|
15
|
+
},
|
16
|
+
"dependencies": {
|
17
|
+
"@vue/test-utils": "^1.1.3"
|
18
|
+
},
|
19
|
+
"devDependencies": {
|
20
|
+
"@cypress/mount-utils": "0.0.0-development",
|
21
|
+
"@rollup/plugin-commonjs": "^17.1.0",
|
22
|
+
"@rollup/plugin-json": "^4.1.0",
|
23
|
+
"@rollup/plugin-node-resolve": "^11.1.1",
|
24
|
+
"@rollup/plugin-replace": "^2.3.1",
|
25
|
+
"rollup-plugin-typescript2": "^0.29.0",
|
26
|
+
"tslib": "^2.1.0",
|
27
|
+
"typescript": "^4.2.3",
|
28
|
+
"vue": "2.6.12"
|
29
|
+
},
|
30
|
+
"peerDependencies": {
|
31
|
+
"cypress": ">=4.5.0",
|
32
|
+
"vue": "^2.0.0"
|
33
|
+
},
|
34
|
+
"files": [
|
35
|
+
"dist/**/*",
|
36
|
+
"src/**/*.js"
|
37
|
+
],
|
38
|
+
"engines": {
|
39
|
+
"node": ">=8"
|
40
|
+
},
|
41
|
+
"types": "dist",
|
42
|
+
"license": "MIT",
|
43
|
+
"repository": {
|
44
|
+
"type": "git",
|
45
|
+
"url": "https://github.com/cypress-io/cypress.git"
|
46
|
+
},
|
47
|
+
"homepage": "https://github.com/cypress-io/cypress/blob/master/npm/vue/#readme",
|
48
|
+
"bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fvue&template=1-bug-report.md&title=",
|
49
|
+
"keywords": [
|
50
|
+
"cypress",
|
51
|
+
"vue"
|
52
|
+
],
|
53
|
+
"unpkg": "dist/cypress-vue2.browser.js",
|
54
|
+
"module": "dist/cypress-vue2.esm-bundler.js",
|
55
|
+
"publishConfig": {
|
56
|
+
"access": "public",
|
57
|
+
"registry": "http://registry.npmjs.org/"
|
58
|
+
}
|
59
|
+
}
|