cypress 10.10.0 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/angular/CHANGELOG.md +27 -0
- package/angular/dist/index.d.ts +124 -1
- package/angular/dist/index.js +59 -59
- package/lib/cli.js +15 -1
- package/lib/tasks/download.js +3 -7
- package/lib/util.js +2 -2
- package/mount-utils/CHANGELOG.md +7 -63
- package/mount-utils/README.md +5 -23
- package/mount-utils/dist/index.d.ts +25 -39
- package/mount-utils/dist/index.js +33 -112
- package/mount-utils/package.json +1 -0
- package/package.json +5 -4
- package/react/CHANGELOG.md +12 -55
- package/react/README.md +2 -22
- package/react/dist/cypress-react.cjs.js +92 -219
- package/react/dist/cypress-react.esm-bundler.js +92 -220
- package/react/dist/index.d.ts +111 -4
- package/react18/CHANGELOG.md +6 -106
- package/react18/dist/cypress-react.cjs.js +117 -180
- package/react18/dist/cypress-react.esm-bundler.js +103 -167
- package/react18/dist/index.d.ts +78 -6
- package/react18/package.json +1 -0
- package/svelte/CHANGELOG.md +20 -0
- package/svelte/dist/cypress-svelte.cjs.js +19 -114
- package/svelte/dist/cypress-svelte.esm-bundler.js +19 -114
- package/svelte/dist/index.d.ts +201 -1
- package/types/cypress-npm-api.d.ts +1 -1
- package/types/cypress.d.ts +43 -21
- package/vue/CHANGELOG.md +13 -101
- package/vue/README.md +4 -8
- package/vue/dist/cypress-vue.cjs.js +70 -153
- package/vue/dist/cypress-vue.esm-bundler.js +70 -153
- package/vue/dist/index.d.ts +1352 -104
- package/vue/package.json +1 -1
- package/vue2/CHANGELOG.md +15 -50
- package/vue2/README.md +3 -7
- package/vue2/dist/cypress-vue2.cjs.js +87 -211
- package/vue2/dist/cypress-vue2.esm-bundler.js +86 -210
- package/vue2/dist/index.d.ts +341 -172
- package/vue2/package.json +1 -3
- package/angular/dist/mount.d.ts +0 -112
- package/react/dist/createMount.d.ts +0 -31
- package/react/dist/getDisplayName.d.ts +0 -8
- package/react/dist/mount.d.ts +0 -8
- package/react/dist/mountHook.d.ts +0 -12
- package/react/dist/types.d.ts +0 -45
- package/svelte/dist/mount.d.ts +0 -30
- package/vue/dist/@vue/test-utils/baseWrapper.d.ts +0 -63
- package/vue/dist/@vue/test-utils/components/RouterLinkStub.d.ts +0 -21
- package/vue/dist/@vue/test-utils/config.d.ts +0 -30
- package/vue/dist/@vue/test-utils/constants/dom-events.d.ts +0 -900
- package/vue/dist/@vue/test-utils/createDomEvent.d.ts +0 -9
- package/vue/dist/@vue/test-utils/domWrapper.d.ts +0 -18
- package/vue/dist/@vue/test-utils/emit.d.ts +0 -5
- package/vue/dist/@vue/test-utils/errorWrapper.d.ts +0 -1
- package/vue/dist/@vue/test-utils/index.d.ts +0 -11
- package/vue/dist/@vue/test-utils/interfaces/wrapperLike.d.ts +0 -56
- package/vue/dist/@vue/test-utils/mount.d.ts +0 -35
- package/vue/dist/@vue/test-utils/stubs.d.ts +0 -22
- package/vue/dist/@vue/test-utils/types.d.ts +0 -125
- package/vue/dist/@vue/test-utils/utils/autoUnmount.d.ts +0 -5
- package/vue/dist/@vue/test-utils/utils/compileSlots.d.ts +0 -2
- package/vue/dist/@vue/test-utils/utils/componentName.d.ts +0 -4
- package/vue/dist/@vue/test-utils/utils/find.d.ts +0 -10
- package/vue/dist/@vue/test-utils/utils/flushPromises.d.ts +0 -1
- package/vue/dist/@vue/test-utils/utils/getRootNodes.d.ts +0 -2
- package/vue/dist/@vue/test-utils/utils/isElement.d.ts +0 -1
- package/vue/dist/@vue/test-utils/utils/isElementVisible.d.ts +0 -6
- package/vue/dist/@vue/test-utils/utils/matchName.d.ts +0 -1
- package/vue/dist/@vue/test-utils/utils/stringifyNode.d.ts +0 -1
- package/vue/dist/@vue/test-utils/utils/vueCompatSupport.d.ts +0 -8
- package/vue/dist/@vue/test-utils/utils/vueShared.d.ts +0 -3
- package/vue/dist/@vue/test-utils/utils.d.ts +0 -13
- package/vue/dist/@vue/test-utils/vueWrapper.d.ts +0 -35
- package/vue/dist/@vue/test-utils/wrapperFactory.d.ts +0 -14
@@ -6,6 +6,11 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
const ROOT_SELECTOR = '[data-cy-root]';
|
9
|
+
/**
|
10
|
+
* Gets the root element used to mount the component.
|
11
|
+
* @returns {HTMLElement} The root element
|
12
|
+
* @throws {Error} If the root element is not found
|
13
|
+
*/
|
9
14
|
const getContainerEl = () => {
|
10
15
|
const el = document.querySelector(ROOT_SELECTOR);
|
11
16
|
if (el) {
|
@@ -13,122 +18,19 @@ const getContainerEl = () => {
|
|
13
18
|
}
|
14
19
|
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.`);
|
15
20
|
};
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
*/
|
21
|
-
function cleanupStyles() {
|
22
|
-
const styles = document.body.querySelectorAll('[data-cy=injected-style-tag]');
|
23
|
-
styles.forEach((styleElement) => {
|
24
|
-
if (styleElement.parentElement) {
|
25
|
-
styleElement.parentElement.removeChild(styleElement);
|
26
|
-
}
|
27
|
-
});
|
28
|
-
const links = document.body.querySelectorAll('[data-cy=injected-stylesheet]');
|
29
|
-
links.forEach((link) => {
|
30
|
-
if (link.parentElement) {
|
31
|
-
link.parentElement.removeChild(link);
|
21
|
+
function checkForRemovedStyleOptions(mountingOptions) {
|
22
|
+
for (const key of ['cssFile', 'cssFiles', 'style', 'styles', 'stylesheet', 'stylesheets']) {
|
23
|
+
if (mountingOptions[key]) {
|
24
|
+
Cypress.utils.throwErrByPath('mount.removed_style_mounting_options', key);
|
32
25
|
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
/**
|
36
|
-
* Insert links to external style resources.
|
37
|
-
*/
|
38
|
-
function insertStylesheets(stylesheets, document, el) {
|
39
|
-
stylesheets.forEach((href) => {
|
40
|
-
const link = document.createElement('link');
|
41
|
-
link.type = 'text/css';
|
42
|
-
link.rel = 'stylesheet';
|
43
|
-
link.href = href;
|
44
|
-
link.dataset.cy = 'injected-stylesheet';
|
45
|
-
document.body.insertBefore(link, el);
|
46
|
-
});
|
47
|
-
}
|
48
|
-
/**
|
49
|
-
* Inserts a single stylesheet element
|
50
|
-
*/
|
51
|
-
function insertStyles(styles, document, el) {
|
52
|
-
styles.forEach((style) => {
|
53
|
-
const styleElement = document.createElement('style');
|
54
|
-
styleElement.dataset.cy = 'injected-style-tag';
|
55
|
-
styleElement.appendChild(document.createTextNode(style));
|
56
|
-
document.body.insertBefore(styleElement, el);
|
57
|
-
});
|
58
|
-
}
|
59
|
-
function insertSingleCssFile(cssFilename, document, el, log) {
|
60
|
-
return cy.readFile(cssFilename, { log }).then((css) => {
|
61
|
-
const style = document.createElement('style');
|
62
|
-
style.appendChild(document.createTextNode(css));
|
63
|
-
document.body.insertBefore(style, el);
|
64
|
-
});
|
65
|
-
}
|
66
|
-
/**
|
67
|
-
* Reads the given CSS file from local file system
|
68
|
-
* and adds the loaded style text as an element.
|
69
|
-
*/
|
70
|
-
function insertLocalCssFiles(cssFilenames, document, el, log) {
|
71
|
-
return Cypress.Promise.mapSeries(cssFilenames, (cssFilename) => {
|
72
|
-
return insertSingleCssFile(cssFilename, document, el, log);
|
73
|
-
});
|
26
|
+
}
|
74
27
|
}
|
75
28
|
/**
|
76
|
-
*
|
77
|
-
*
|
29
|
+
* Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
|
30
|
+
* @param optionalCallback Callback to be called before the next test runs
|
78
31
|
*/
|
79
|
-
const injectStylesBeforeElement = (options, document, el) => {
|
80
|
-
if (!el)
|
81
|
-
return;
|
82
|
-
// first insert all stylesheets as Link elements
|
83
|
-
let stylesheets = [];
|
84
|
-
if (typeof options.stylesheet === 'string') {
|
85
|
-
stylesheets.push(options.stylesheet);
|
86
|
-
}
|
87
|
-
else if (Array.isArray(options.stylesheet)) {
|
88
|
-
stylesheets = stylesheets.concat(options.stylesheet);
|
89
|
-
}
|
90
|
-
if (typeof options.stylesheets === 'string') {
|
91
|
-
options.stylesheets = [options.stylesheets];
|
92
|
-
}
|
93
|
-
if (options.stylesheets) {
|
94
|
-
stylesheets = stylesheets.concat(options.stylesheets);
|
95
|
-
}
|
96
|
-
insertStylesheets(stylesheets, document, el);
|
97
|
-
// insert any styles as <style>...</style> elements
|
98
|
-
let styles = [];
|
99
|
-
if (typeof options.style === 'string') {
|
100
|
-
styles.push(options.style);
|
101
|
-
}
|
102
|
-
else if (Array.isArray(options.style)) {
|
103
|
-
styles = styles.concat(options.style);
|
104
|
-
}
|
105
|
-
if (typeof options.styles === 'string') {
|
106
|
-
styles.push(options.styles);
|
107
|
-
}
|
108
|
-
else if (Array.isArray(options.styles)) {
|
109
|
-
styles = styles.concat(options.styles);
|
110
|
-
}
|
111
|
-
insertStyles(styles, document, el);
|
112
|
-
// now load any css files by path and add their content
|
113
|
-
// as <style>...</style> elements
|
114
|
-
let cssFiles = [];
|
115
|
-
if (typeof options.cssFile === 'string') {
|
116
|
-
cssFiles.push(options.cssFile);
|
117
|
-
}
|
118
|
-
else if (Array.isArray(options.cssFile)) {
|
119
|
-
cssFiles = cssFiles.concat(options.cssFile);
|
120
|
-
}
|
121
|
-
if (typeof options.cssFiles === 'string') {
|
122
|
-
cssFiles.push(options.cssFiles);
|
123
|
-
}
|
124
|
-
else if (Array.isArray(options.cssFiles)) {
|
125
|
-
cssFiles = cssFiles.concat(options.cssFiles);
|
126
|
-
}
|
127
|
-
return insertLocalCssFiles(cssFiles, document, el, options.log);
|
128
|
-
};
|
129
32
|
function setupHooks(optionalCallback) {
|
130
|
-
//
|
131
|
-
// file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
|
33
|
+
// We don't want CT side effects to run when e2e
|
132
34
|
// testing so we early return.
|
133
35
|
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
134
36
|
if (Cypress.testingType !== 'component') {
|
@@ -143,7 +45,6 @@ function setupHooks(optionalCallback) {
|
|
143
45
|
// @ts-ignore
|
144
46
|
Cypress.on('test:before:run', () => {
|
145
47
|
optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
|
146
|
-
cleanupStyles();
|
147
48
|
});
|
148
49
|
}
|
149
50
|
|
@@ -175,11 +76,15 @@ const getComponentDisplayName = (Component) => {
|
|
175
76
|
* mount(Counter, { props: { count: 42 } })
|
176
77
|
* cy.get('button').contains(42)
|
177
78
|
* })
|
79
|
+
*
|
80
|
+
* @see {@link https://on.cypress.io/mounting-svelte} for more details.
|
178
81
|
*/
|
179
82
|
function mount(Component, options = {}) {
|
83
|
+
checkForRemovedStyleOptions(options);
|
180
84
|
return cy.then(() => {
|
85
|
+
// Remove last mounted component if cy.mount is called more than once in a test
|
86
|
+
cleanup();
|
181
87
|
const target = getContainerEl();
|
182
|
-
injectStylesBeforeElement(options, document, target);
|
183
88
|
const ComponentConstructor = (Component.default || Component);
|
184
89
|
componentInstance = new ComponentConstructor(Object.assign({ target }, options));
|
185
90
|
// by waiting, we are delaying test execution for the next tick of event loop
|
@@ -190,7 +95,7 @@ function mount(Component, options = {}) {
|
|
190
95
|
Cypress.log({
|
191
96
|
name: 'mount',
|
192
97
|
message: [mountMessage],
|
193
|
-
})
|
98
|
+
});
|
194
99
|
}
|
195
100
|
})
|
196
101
|
.wrap({ component: componentInstance }, { log: false });
|
package/svelte/dist/index.d.ts
CHANGED
@@ -1 +1,201 @@
|
|
1
|
-
|
1
|
+
/// <reference types="cypress" />
|
2
|
+
|
3
|
+
declare module '*.svelte' {
|
4
|
+
export { SvelteComponentDev as default } from 'svelte/internal';
|
5
|
+
}
|
6
|
+
|
7
|
+
/**
|
8
|
+
* INTERNAL, DO NOT USE. Code may change at any time.
|
9
|
+
*/
|
10
|
+
interface Fragment {
|
11
|
+
key: string | null;
|
12
|
+
first: null;
|
13
|
+
c: () => void;
|
14
|
+
l: (nodes: any) => void;
|
15
|
+
h: () => void;
|
16
|
+
m: (target: HTMLElement, anchor: any) => void;
|
17
|
+
p: (ctx: any, dirty: any) => void;
|
18
|
+
r: () => void;
|
19
|
+
f: () => void;
|
20
|
+
a: () => void;
|
21
|
+
i: (local: any) => void;
|
22
|
+
o: (local: any) => void;
|
23
|
+
d: (detaching: 0 | 1) => void;
|
24
|
+
}
|
25
|
+
interface T$$ {
|
26
|
+
dirty: number[];
|
27
|
+
ctx: null | any;
|
28
|
+
bound: any;
|
29
|
+
update: () => void;
|
30
|
+
callbacks: any;
|
31
|
+
after_update: any[];
|
32
|
+
props: Record<string, 0 | string>;
|
33
|
+
fragment: null | false | Fragment;
|
34
|
+
not_equal: any;
|
35
|
+
before_update: any[];
|
36
|
+
context: Map<any, any>;
|
37
|
+
on_mount: any[];
|
38
|
+
on_destroy: any[];
|
39
|
+
skip_bound: boolean;
|
40
|
+
on_disconnect: any[];
|
41
|
+
root: Element | ShadowRoot;
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* Base class for Svelte components. Used when dev=false.
|
45
|
+
*/
|
46
|
+
declare class SvelteComponent {
|
47
|
+
$$: T$$;
|
48
|
+
$$set?: ($$props: any) => void;
|
49
|
+
$destroy(): void;
|
50
|
+
$on(type: any, callback: any): () => void;
|
51
|
+
$set($$props: any): void;
|
52
|
+
}
|
53
|
+
|
54
|
+
declare type Props = Record<string, any>;
|
55
|
+
interface ComponentConstructorOptions<Props extends Record<string, any> = Record<string, any>> {
|
56
|
+
target: Element | ShadowRoot;
|
57
|
+
anchor?: Element;
|
58
|
+
props?: Props;
|
59
|
+
context?: Map<any, any>;
|
60
|
+
hydrate?: boolean;
|
61
|
+
intro?: boolean;
|
62
|
+
$$inline?: boolean;
|
63
|
+
}
|
64
|
+
interface SvelteComponentDev$1 {
|
65
|
+
$set(props?: Props): void;
|
66
|
+
$on(event: string, callback: (event: any) => void): () => void;
|
67
|
+
$destroy(): void;
|
68
|
+
[accessor: string]: any;
|
69
|
+
}
|
70
|
+
/**
|
71
|
+
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
72
|
+
*/
|
73
|
+
declare class SvelteComponentDev$1 extends SvelteComponent {
|
74
|
+
/**
|
75
|
+
* @private
|
76
|
+
* For type checking capabilities only.
|
77
|
+
* Does not exist at runtime.
|
78
|
+
* ### DO NOT USE!
|
79
|
+
*/
|
80
|
+
$$prop_def: Props;
|
81
|
+
/**
|
82
|
+
* @private
|
83
|
+
* For type checking capabilities only.
|
84
|
+
* Does not exist at runtime.
|
85
|
+
* ### DO NOT USE!
|
86
|
+
*/
|
87
|
+
$$events_def: any;
|
88
|
+
/**
|
89
|
+
* @private
|
90
|
+
* For type checking capabilities only.
|
91
|
+
* Does not exist at runtime.
|
92
|
+
* ### DO NOT USE!
|
93
|
+
*/
|
94
|
+
$$slot_def: any;
|
95
|
+
constructor(options: ComponentConstructorOptions);
|
96
|
+
$capture_state(): void;
|
97
|
+
$inject_state(): void;
|
98
|
+
}
|
99
|
+
interface SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> {
|
100
|
+
$set(props?: Partial<Props>): void;
|
101
|
+
$on<K extends Extract<keyof Events, string>>(type: K, callback: (e: Events[K]) => void): () => void;
|
102
|
+
$destroy(): void;
|
103
|
+
[accessor: string]: any;
|
104
|
+
}
|
105
|
+
/**
|
106
|
+
* Base class to create strongly typed Svelte components.
|
107
|
+
* This only exists for typing purposes and should be used in `.d.ts` files.
|
108
|
+
*
|
109
|
+
* ### Example:
|
110
|
+
*
|
111
|
+
* You have component library on npm called `component-library`, from which
|
112
|
+
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
113
|
+
* you want to provide typings. Therefore you create a `index.d.ts`:
|
114
|
+
* ```ts
|
115
|
+
* import { SvelteComponentTyped } from "svelte";
|
116
|
+
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
117
|
+
* ```
|
118
|
+
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
119
|
+
* to provide intellisense and to use the component like this in a Svelte file
|
120
|
+
* with TypeScript:
|
121
|
+
* ```svelte
|
122
|
+
* <script lang="ts">
|
123
|
+
* import { MyComponent } from "component-library";
|
124
|
+
* </script>
|
125
|
+
* <MyComponent foo={'bar'} />
|
126
|
+
* ```
|
127
|
+
*
|
128
|
+
* #### Why not make this part of `SvelteComponent(Dev)`?
|
129
|
+
* Because
|
130
|
+
* ```ts
|
131
|
+
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
132
|
+
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
133
|
+
* ```
|
134
|
+
* will throw a type error, so we need to separate the more strictly typed class.
|
135
|
+
*/
|
136
|
+
declare class SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> extends SvelteComponentDev$1 {
|
137
|
+
/**
|
138
|
+
* @private
|
139
|
+
* For type checking capabilities only.
|
140
|
+
* Does not exist at runtime.
|
141
|
+
* ### DO NOT USE!
|
142
|
+
*/
|
143
|
+
$$prop_def: Props;
|
144
|
+
/**
|
145
|
+
* @private
|
146
|
+
* For type checking capabilities only.
|
147
|
+
* Does not exist at runtime.
|
148
|
+
* ### DO NOT USE!
|
149
|
+
*/
|
150
|
+
$$events_def: Events;
|
151
|
+
/**
|
152
|
+
* @private
|
153
|
+
* For type checking capabilities only.
|
154
|
+
* Does not exist at runtime.
|
155
|
+
* ### DO NOT USE!
|
156
|
+
*/
|
157
|
+
$$slot_def: Slots;
|
158
|
+
constructor(options: ComponentConstructorOptions<Props>);
|
159
|
+
}
|
160
|
+
/**
|
161
|
+
* Convenience type to get the props the given component expects. Example:
|
162
|
+
* ```html
|
163
|
+
* <script lang="ts">
|
164
|
+
* import type { ComponentProps } from 'svelte';
|
165
|
+
* import Component from './Component.svelte';
|
166
|
+
*
|
167
|
+
* const props: ComponentProps<Component> = { foo: 'bar' }; // Errors if these aren't the correct props
|
168
|
+
* </script>
|
169
|
+
* ```
|
170
|
+
*/
|
171
|
+
declare type ComponentProps<Component extends SvelteComponent> = Component extends SvelteComponentTyped<infer Props> ? Props : never;
|
172
|
+
|
173
|
+
declare type SvelteConstructor<T> = new (...args: any[]) => T;
|
174
|
+
declare type SvelteComponentOptions<T extends SvelteComponentDev$1> = Omit<ComponentConstructorOptions<ComponentProps<T>>, 'hydrate' | 'target' | '$$inline'>;
|
175
|
+
interface MountOptions<T extends SvelteComponentDev$1> extends SvelteComponentOptions<T> {
|
176
|
+
log?: boolean;
|
177
|
+
}
|
178
|
+
interface MountReturn<T extends SvelteComponentDev$1> {
|
179
|
+
component: T;
|
180
|
+
}
|
181
|
+
/**
|
182
|
+
* Mounts a Svelte component inside the Cypress browser
|
183
|
+
*
|
184
|
+
* @param {SvelteConstructor<T>} Component Svelte component being mounted
|
185
|
+
* @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
|
186
|
+
* @returns Cypress.Chainable<MountReturn>
|
187
|
+
*
|
188
|
+
* @example
|
189
|
+
* import Counter from './Counter.svelte'
|
190
|
+
* import { mount } from 'cypress/svelte'
|
191
|
+
*
|
192
|
+
* it('should render', () => {
|
193
|
+
* mount(Counter, { props: { count: 42 } })
|
194
|
+
* cy.get('button').contains(42)
|
195
|
+
* })
|
196
|
+
*
|
197
|
+
* @see {@link https://on.cypress.io/mounting-svelte} for more details.
|
198
|
+
*/
|
199
|
+
declare function mount<T extends SvelteComponentDev$1>(Component: SvelteConstructor<T>, options?: MountOptions<T>): Cypress.Chainable<MountReturn<T>>;
|
200
|
+
|
201
|
+
export { MountOptions, MountReturn, mount };
|
package/types/cypress.d.ts
CHANGED
@@ -641,12 +641,6 @@ declare namespace Cypress {
|
|
641
641
|
*/
|
642
642
|
off: Actions
|
643
643
|
|
644
|
-
/**
|
645
|
-
* Used to import dependencies within the cy.origin() callback
|
646
|
-
* @see https://on.cypress.io/origin
|
647
|
-
*/
|
648
|
-
require: (id: string) => any
|
649
|
-
|
650
644
|
/**
|
651
645
|
* Trigger action
|
652
646
|
* @private
|
@@ -781,20 +775,20 @@ declare namespace Cypress {
|
|
781
775
|
clear(options?: Partial<ClearOptions>): Chainable<Subject>
|
782
776
|
|
783
777
|
/**
|
784
|
-
* Clear a specific browser cookie.
|
778
|
+
* Clear a specific browser cookie for the current superdomain or for the domain specified.
|
785
779
|
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test.
|
786
780
|
*
|
787
781
|
* @see https://on.cypress.io/clearcookie
|
788
782
|
*/
|
789
|
-
clearCookie(name: string, options?:
|
783
|
+
clearCookie(name: string, options?: CookieOptions): Chainable<null>
|
790
784
|
|
791
785
|
/**
|
792
|
-
* Clear all browser cookies.
|
793
|
-
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear
|
786
|
+
* Clear all browser cookies for the current superdomain or for the domain specified.
|
787
|
+
* Cypress automatically clears all cookies before each test to prevent state from being shared across tests. You shouldn't need to use this command unless you're using it to clear all cookies or specific cookies inside a single test.
|
794
788
|
*
|
795
789
|
* @see https://on.cypress.io/clearcookies
|
796
790
|
*/
|
797
|
-
clearCookies(options?:
|
791
|
+
clearCookies(options?: CookieOptions): Chainable<null>
|
798
792
|
|
799
793
|
/**
|
800
794
|
* Clear data in local storage.
|
@@ -1095,7 +1089,7 @@ declare namespace Cypress {
|
|
1095
1089
|
*
|
1096
1090
|
* @see https://on.cypress.io/session
|
1097
1091
|
*/
|
1098
|
-
session(id: string | object, setup
|
1092
|
+
session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<null>
|
1099
1093
|
|
1100
1094
|
/**
|
1101
1095
|
* Get the window.document of the page that is currently active.
|
@@ -1254,18 +1248,18 @@ declare namespace Cypress {
|
|
1254
1248
|
get<S = any>(alias: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<S>
|
1255
1249
|
|
1256
1250
|
/**
|
1257
|
-
* Get a browser cookie by its name.
|
1251
|
+
* Get a browser cookie by its name for the current superdomain or for the domain specified.
|
1258
1252
|
*
|
1259
1253
|
* @see https://on.cypress.io/getcookie
|
1260
1254
|
*/
|
1261
|
-
getCookie(name: string, options?:
|
1255
|
+
getCookie(name: string, options?: CookieOptions): Chainable<Cookie | null>
|
1262
1256
|
|
1263
1257
|
/**
|
1264
|
-
* Get all of the browser cookies.
|
1258
|
+
* Get all of the browser cookies for the current superdomain or for the domain specified.
|
1265
1259
|
*
|
1266
1260
|
* @see https://on.cypress.io/getcookies
|
1267
1261
|
*/
|
1268
|
-
getCookies(options?:
|
1262
|
+
getCookies(options?: CookieOptions): Chainable<Cookie[]>
|
1269
1263
|
|
1270
1264
|
/**
|
1271
1265
|
* Navigate back or forward to the previous or next URL in the browser's history.
|
@@ -2639,6 +2633,14 @@ declare namespace Cypress {
|
|
2639
2633
|
cmdKey: boolean
|
2640
2634
|
}
|
2641
2635
|
|
2636
|
+
interface CookieOptions extends Partial<Loggable & Timeoutable> {
|
2637
|
+
/**
|
2638
|
+
* Domain to set cookies on or get cookies from
|
2639
|
+
* @default superdomain of the current app under test
|
2640
|
+
*/
|
2641
|
+
domain?: string
|
2642
|
+
}
|
2643
|
+
|
2642
2644
|
interface PEMCert {
|
2643
2645
|
/**
|
2644
2646
|
* Path to the certificate file, relative to project root.
|
@@ -2814,12 +2816,32 @@ declare namespace Cypress {
|
|
2814
2816
|
*/
|
2815
2817
|
supportFile: string | false
|
2816
2818
|
/**
|
2817
|
-
* The test isolation
|
2818
|
-
*
|
2819
|
-
*
|
2820
|
-
*
|
2819
|
+
* The test isolation ensures a clean browser context between tests. This option is only available when
|
2820
|
+
* `experimentalSessionAndOrigin=true`.
|
2821
|
+
*
|
2822
|
+
* Cypress will always reset/clear aliases, intercepts, clock, and viewport before each test
|
2823
|
+
* to ensure a clean test slate; i.e. this configuration only impacts the browser context.
|
2824
|
+
*
|
2825
|
+
* Note: the [`cy.session()`](https://on.cypress.io/session) command will inherent this value to determine whether
|
2826
|
+
* or not the page is cleared when the command executes. This command is only available in end-to-end testing.
|
2827
|
+
*
|
2828
|
+
* - on - The page is cleared before each test. Cookies, local storage and session storage in all domains are cleared
|
2829
|
+
* before each test. The `cy.session()` command will also clear the page and current browser context when creating
|
2830
|
+
* or restoring the browser session.
|
2831
|
+
* - off - The current browser state will persist between tests. The page does not clear before the test and cookies, local
|
2832
|
+
* storage and session storage will be available in the next test. The `cy.session()` command will only clear the
|
2833
|
+
* current browser context when creating or restoring the browser session - the current page will not clear.
|
2834
|
+
*
|
2835
|
+
* Tradeoffs:
|
2836
|
+
* Turning test isolation off may improve performance of end-to-end tests, however, previous tests could impact the
|
2837
|
+
* browser state of the next test and cause inconsistency when using .only(). Be mindful to write isolated tests when
|
2838
|
+
* test isolation is off. If a test in the suite impacts the state of other tests and it were to fail, you could see
|
2839
|
+
* misleading errors in later tests which makes debugging clunky. See the [documentation](https://on.cypress.io/test-isolation)
|
2840
|
+
* for more information.
|
2841
|
+
*
|
2842
|
+
* @default null, when experimentalSessionAndOrigin=false. The default is 'on' when experimentalSessionAndOrigin=true.
|
2821
2843
|
*/
|
2822
|
-
testIsolation: '
|
2844
|
+
testIsolation: null | 'on' | 'off'
|
2823
2845
|
/**
|
2824
2846
|
* Path to folder where videos will be saved after a headless or CI run
|
2825
2847
|
* @default "cypress/videos"
|
package/vue/CHANGELOG.md
CHANGED
@@ -1,121 +1,38 @@
|
|
1
|
-
# [@cypress/vue-
|
1
|
+
# [@cypress/vue-v5.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.0...@cypress/vue-v5.0.1) (2022-11-08)
|
2
2
|
|
3
3
|
|
4
4
|
### Bug Fixes
|
5
5
|
|
6
|
-
*
|
7
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
8
|
-
|
9
|
-
|
10
|
-
### Features
|
11
|
-
|
12
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
13
|
-
|
14
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-10-06)
|
15
|
-
|
16
|
-
|
17
|
-
### Bug Fixes
|
18
|
-
|
19
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
20
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
21
|
-
|
22
|
-
|
23
|
-
### Features
|
24
|
-
|
25
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
26
|
-
|
27
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-10-04)
|
28
|
-
|
29
|
-
|
30
|
-
### Bug Fixes
|
31
|
-
|
32
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
33
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
34
|
-
|
35
|
-
|
36
|
-
### Features
|
37
|
-
|
38
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
39
|
-
|
40
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-10-04)
|
41
|
-
|
42
|
-
|
43
|
-
### Bug Fixes
|
44
|
-
|
45
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
46
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
47
|
-
|
48
|
-
|
49
|
-
### Features
|
50
|
-
|
51
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
52
|
-
|
53
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-10-03)
|
54
|
-
|
55
|
-
|
56
|
-
### Bug Fixes
|
57
|
-
|
58
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
59
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
60
|
-
|
61
|
-
|
62
|
-
### Features
|
63
|
-
|
64
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
6
|
+
* make component derived info not throw ([#24571](https://github.com/cypress-io/cypress/issues/24571)) ([838dd4f](https://github.com/cypress-io/cypress/commit/838dd4fa2e0ec56633d0af2faf10a47d190b5594))
|
65
7
|
|
66
|
-
# [@cypress/vue-
|
8
|
+
# [@cypress/vue-v5.0.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.2.2...@cypress/vue-v5.0.0) (2022-11-07)
|
67
9
|
|
68
10
|
|
69
11
|
### Bug Fixes
|
70
12
|
|
71
|
-
*
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
### Features
|
76
|
-
|
77
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
78
|
-
|
79
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-09-30)
|
80
|
-
|
81
|
-
|
82
|
-
### Bug Fixes
|
83
|
-
|
84
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
85
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
13
|
+
* remove dependence on @cypress/<dep> types ([#24415](https://github.com/cypress-io/cypress/issues/24415)) ([58e0ab9](https://github.com/cypress-io/cypress/commit/58e0ab91604618ea6f75932622f7e66e419270e6))
|
14
|
+
* remove last mounted component upon subsequent mount calls ([#24470](https://github.com/cypress-io/cypress/issues/24470)) ([f39eb1c](https://github.com/cypress-io/cypress/commit/f39eb1c19e0923bda7ae263168fc6448da942d54))
|
15
|
+
* remove some CT functions and props ([#24419](https://github.com/cypress-io/cypress/issues/24419)) ([294985f](https://github.com/cypress-io/cypress/commit/294985f8b3e0fa00ed66d25f88c8814603766074))
|
86
16
|
|
87
17
|
|
88
18
|
### Features
|
89
19
|
|
90
|
-
*
|
91
|
-
|
92
|
-
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-09-30)
|
93
|
-
|
94
|
-
|
95
|
-
### Bug Fixes
|
96
|
-
|
97
|
-
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
98
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
20
|
+
* include component and wrapper in return type for vue mount adapter ([#24479](https://github.com/cypress-io/cypress/issues/24479)) ([33875d7](https://github.com/cypress-io/cypress/commit/33875d75505416b1f65ca7c6d5dedc46f3289f1b))
|
99
21
|
|
100
22
|
|
101
|
-
###
|
23
|
+
### BREAKING CHANGES
|
102
24
|
|
103
|
-
*
|
25
|
+
* remove last mounted component upon subsequent mount calls of mount
|
26
|
+
* Vue mount returns wrapper and component rather than wrapper only
|
104
27
|
|
105
|
-
# [@cypress/vue-v4.2.
|
28
|
+
# [@cypress/vue-v4.2.2](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.2.1...@cypress/vue-v4.2.2) (2022-11-01)
|
106
29
|
|
107
30
|
|
108
31
|
### Bug Fixes
|
109
32
|
|
110
|
-
*
|
111
|
-
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
112
|
-
|
113
|
-
|
114
|
-
### Features
|
115
|
-
|
116
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
33
|
+
* Hovering over mount in command log does not show component in AUT ([#24346](https://github.com/cypress-io/cypress/issues/24346)) ([355d210](https://github.com/cypress-io/cypress/commit/355d2101d38ea4d1e93b9c571cf77babab2bbbfc))
|
117
34
|
|
118
|
-
# [@cypress/vue-v4.2.
|
35
|
+
# [@cypress/vue-v4.2.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.2.0...@cypress/vue-v4.2.1) (2022-10-13)
|
119
36
|
|
120
37
|
|
121
38
|
### Bug Fixes
|
@@ -123,11 +40,6 @@
|
|
123
40
|
* fix regression in npm/vue ([#23954](https://github.com/cypress-io/cypress/issues/23954)) ([78779a2](https://github.com/cypress-io/cypress/commit/78779a2db13ca6555a6b830dbabeefd3d37bbfe5))
|
124
41
|
* **npm/vue:** update types ([#23890](https://github.com/cypress-io/cypress/issues/23890)) ([eb8ae02](https://github.com/cypress-io/cypress/commit/eb8ae02b61304d034136f7627da1ab23537e3ba4))
|
125
42
|
|
126
|
-
|
127
|
-
### Features
|
128
|
-
|
129
|
-
* adding svelte component testing support ([#23553](https://github.com/cypress-io/cypress/issues/23553)) ([f6eaad4](https://github.com/cypress-io/cypress/commit/f6eaad40e1836fa9db87c60defa5ae6f390c8fd8))
|
130
|
-
|
131
43
|
# [@cypress/vue-v4.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v4.1.0...@cypress/vue-v4.2.0) (2022-08-30)
|
132
44
|
|
133
45
|
|