cypress 10.11.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 +20 -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 +14 -0
- 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 +3 -3
- package/react/CHANGELOG.md +27 -0
- 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 +13 -0
- 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.d.ts +18 -10
- package/vue/CHANGELOG.md +34 -0
- package/vue/README.md +4 -8
- package/vue/dist/cypress-vue.cjs.js +68 -151
- package/vue/dist/cypress-vue.esm-bundler.js +68 -151
- package/vue/dist/index.d.ts +1352 -104
- package/vue/package.json +1 -1
- package/vue2/CHANGELOG.md +27 -0
- 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
@@ -775,20 +775,20 @@ declare namespace Cypress {
|
|
775
775
|
clear(options?: Partial<ClearOptions>): Chainable<Subject>
|
776
776
|
|
777
777
|
/**
|
778
|
-
* Clear a specific browser cookie.
|
778
|
+
* Clear a specific browser cookie for the current superdomain or for the domain specified.
|
779
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.
|
780
780
|
*
|
781
781
|
* @see https://on.cypress.io/clearcookie
|
782
782
|
*/
|
783
|
-
clearCookie(name: string, options?:
|
783
|
+
clearCookie(name: string, options?: CookieOptions): Chainable<null>
|
784
784
|
|
785
785
|
/**
|
786
|
-
* Clear all browser cookies.
|
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
|
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.
|
788
788
|
*
|
789
789
|
* @see https://on.cypress.io/clearcookies
|
790
790
|
*/
|
791
|
-
clearCookies(options?:
|
791
|
+
clearCookies(options?: CookieOptions): Chainable<null>
|
792
792
|
|
793
793
|
/**
|
794
794
|
* Clear data in local storage.
|
@@ -1089,7 +1089,7 @@ declare namespace Cypress {
|
|
1089
1089
|
*
|
1090
1090
|
* @see https://on.cypress.io/session
|
1091
1091
|
*/
|
1092
|
-
session(id: string | object, setup
|
1092
|
+
session(id: string | object, setup: () => void, options?: SessionOptions): Chainable<null>
|
1093
1093
|
|
1094
1094
|
/**
|
1095
1095
|
* Get the window.document of the page that is currently active.
|
@@ -1248,18 +1248,18 @@ declare namespace Cypress {
|
|
1248
1248
|
get<S = any>(alias: string, options?: Partial<Loggable & Timeoutable & Withinable & Shadow>): Chainable<S>
|
1249
1249
|
|
1250
1250
|
/**
|
1251
|
-
* Get a browser cookie by its name.
|
1251
|
+
* Get a browser cookie by its name for the current superdomain or for the domain specified.
|
1252
1252
|
*
|
1253
1253
|
* @see https://on.cypress.io/getcookie
|
1254
1254
|
*/
|
1255
|
-
getCookie(name: string, options?:
|
1255
|
+
getCookie(name: string, options?: CookieOptions): Chainable<Cookie | null>
|
1256
1256
|
|
1257
1257
|
/**
|
1258
|
-
* Get all of the browser cookies.
|
1258
|
+
* Get all of the browser cookies for the current superdomain or for the domain specified.
|
1259
1259
|
*
|
1260
1260
|
* @see https://on.cypress.io/getcookies
|
1261
1261
|
*/
|
1262
|
-
getCookies(options?:
|
1262
|
+
getCookies(options?: CookieOptions): Chainable<Cookie[]>
|
1263
1263
|
|
1264
1264
|
/**
|
1265
1265
|
* Navigate back or forward to the previous or next URL in the browser's history.
|
@@ -2633,6 +2633,14 @@ declare namespace Cypress {
|
|
2633
2633
|
cmdKey: boolean
|
2634
2634
|
}
|
2635
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
|
+
|
2636
2644
|
interface PEMCert {
|
2637
2645
|
/**
|
2638
2646
|
* Path to the certificate file, relative to project root.
|
package/vue/CHANGELOG.md
CHANGED
@@ -1,3 +1,37 @@
|
|
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
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
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))
|
7
|
+
|
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)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
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))
|
16
|
+
|
17
|
+
|
18
|
+
### Features
|
19
|
+
|
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))
|
21
|
+
|
22
|
+
|
23
|
+
### BREAKING CHANGES
|
24
|
+
|
25
|
+
* remove last mounted component upon subsequent mount calls of mount
|
26
|
+
* Vue mount returns wrapper and component rather than wrapper only
|
27
|
+
|
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)
|
29
|
+
|
30
|
+
|
31
|
+
### Bug Fixes
|
32
|
+
|
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))
|
34
|
+
|
1
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)
|
2
36
|
|
3
37
|
|
package/vue/README.md
CHANGED
@@ -34,23 +34,19 @@ describe('HelloWorld component', () => {
|
|
34
34
|
|
35
35
|
Look at the examples in [cypress/component](cypress/component) folder. Here is the list of examples showing various testing scenarios.
|
36
36
|
|
37
|
-
###
|
37
|
+
### Styles
|
38
38
|
|
39
|
-
|
39
|
+
One option for styling your components is to import stylesheets into your test file. See [docs/styles.md](./docs/styles.md) for full list of options.
|
40
40
|
|
41
41
|
```js
|
42
42
|
import Todo from './Todo.vue'
|
43
|
+
import '../styles/main.css'
|
43
44
|
const todo = {
|
44
45
|
id: '123',
|
45
46
|
title: 'Write more tests',
|
46
47
|
}
|
47
48
|
|
48
|
-
mount(Todo, {
|
49
|
-
propsData: { todo },
|
50
|
-
stylesheets: [
|
51
|
-
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css',
|
52
|
-
],
|
53
|
-
})
|
49
|
+
mount(Todo, { props: { todo } })
|
54
50
|
```
|
55
51
|
|
56
52
|
### Global Vue Options
|